Skip to content
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

Contract Market with feed in policy and market premium #248

Merged
merged 9 commits into from
Mar 5, 2024
Merged

Conversation

maurerle
Copy link
Member

This PR implements a feed in policy, which calculates the value a special demand agent pays on top of the market prices as a feed-in-tariff.
The contract is accepted on a monthly base for example, and evaluated on a weekly base.
For this, the generation and market_price of the last week is requested using the data_request mechanism developed in #247 - then the resulting orderbook is created and sent to the contract participants using the already existing clearing process.

This works in general, though the results are not correct yet. I think the volume and price is applied for the whole series and the dashboard needs some polishment too.

@maurerle maurerle self-assigned this Nov 10, 2023
Copy link

codecov bot commented Nov 10, 2023

Codecov Report

Attention: Patch coverage is 30.18868% with 148 lines in your changes are missing coverage. Please review.

Project coverage is 78.53%. Comparing base (dbd53ad) to head (2747bd7).

Files Patch % Lines
assume/markets/clearing_algorithms/contracts.py 31.31% 125 Missing ⚠️
assume/strategies/extended.py 20.68% 23 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #248      +/-   ##
==========================================
- Coverage   79.86%   78.53%   -1.33%     
==========================================
  Files          41       42       +1     
  Lines        4704     4916     +212     
==========================================
+ Hits         3757     3861     +104     
- Misses        947     1055     +108     
Flag Coverage Δ
pytest 78.53% <30.18%> (-1.33%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@maurerle maurerle marked this pull request as ready for review November 13, 2023 21:20
@nick-harder nick-harder marked this pull request as draft November 14, 2023 07:31
@nick-harder
Copy link
Member

@maurerle why do you believe the feed-in premium should be handled by an extra demand agent, ant not an additional market party?
Also, it would be better to add functionality when it is 100% operational and tested. So please same here, check functionality, and add tests for the new market clearing algorithms. Thanks :-)

@maurerle maurerle force-pushed the markets branch 4 times, most recently from ce7a20f to be2bd63 Compare January 19, 2024 14:55
@maurerle maurerle force-pushed the markets branch 3 times, most recently from 61dc0f1 to 49b8941 Compare January 22, 2024 13:04
@maurerle maurerle marked this pull request as ready for review January 22, 2024 13:04
@nick-harder
Copy link
Member

@maurerle is this now ready?

@maurerle
Copy link
Member Author

I'd still like to add some tests - but I don't think that I find time this week.
So we can merge this :)

@nick-harder
Copy link
Member

@maurerle there is also no description of the new methods, no docstrings, and any mention of the new clearings in the documentation. It would be helpful to have them. Let's merge when tests and documentation are there, it can wait :-)

bool: True if agent fulfills requirements
"""
if self.limitation:
if self.limitation == "only_co2emissionless":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we could make these technologies as a part of the config instead of hard coding them at this spot?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to improve this once we have more than 2 possible limitations of market participants.
What do you mean with "part of the config"?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since now we have additional configs for each market, we could list such technologies there

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point.
But I don't know if this will only stay "a list of allowed technologies" - one could also specifiy to limit this market to agents with a max_power > 10MW or whatever - so I would like to keep this loose for now

Copy link
Member

@nick-harder nick-harder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have left some comments

@maurerle maurerle merged commit af02045 into main Mar 5, 2024
2 of 4 checks passed
@maurerle maurerle deleted the markets branch March 5, 2024 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants