-
Notifications
You must be signed in to change notification settings - Fork 18
Add elastic demand #575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add elastic demand #575
Conversation
- add tests
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #575 +/- ##
==========================================
+ Coverage 79.51% 79.67% +0.16%
==========================================
Files 52 52
Lines 7342 7416 +74
==========================================
+ Hits 5838 5909 +71
- Misses 1504 1507 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.
Files not reviewed (1)
- docs/source/release_notes.rst: Language not supported
Comments suppressed due to low confidence (2)
tests/test_naive_strategies.py:104
- The variables 'start' and 'end' are used without an apparent definition in this test. Ensure they are defined or imported so that the test runs as intended.
product_tuples = [(start, end, None)]
assume/strategies/naive_strategies.py:437
- Silently continuing when ratio <= 0 in the isoelastic branch might result in fewer bids than expected. Consider handling this condition explicitly to ensure the expected bid count is always generated or to provide a clear error message.
if ratio <= 0:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you elabortae a bit on the find_first_block_bid() function? How can Power * price be a volume?
Also with first you mean highest yes?
@gugrimm could you please add a better explanation for the way the first bid is derived as Kim suggested? |
The thing with the units is: this is not physics and units do not necessarly need to fit. It took me a while to understand, but what we are looking is a relation between quantity and price, a behavioral relationship based on some economic theory. As far as i understand, in this case units do not match dimensions, unlike in physics where units of an equation always fit. In our case the behavioral relationship must be enriched with knowledge "of the x and y axis" to make sense in real world... |
…o add-elastic-demand
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Two small things.
Should we maybe rename it to flexible_demand? As the other strategy is called inflexible, or we switch it to inelastic?
And can you maybe add documentation to this demand type?
The picture you drew is exactly how it works, yes! I don't get why you call it "isometric" demand - probably a mistake? "Isoelastic" is the correct term. |
Pull Request
Description
This PR introduces an elastic demand bidding strategy by @gugrimm.
Changes Proposed
Testing
Added tests for the new bidding strategy. Also added checks inside the demand unit in case elasticity is provided.
Checklist
Please check all applicable items:
doc
folder updates)pyproject.toml
doc/release_notes.rst
of the upcoming release is includedAdditional Notes (if applicable)
[Any additional information, concerns, or areas you want reviewers to focus on]
Screenshots (if applicable)
[Add screenshots to demonstrate visual changes]