-
Notifications
You must be signed in to change notification settings - Fork 10
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 the new building DSM class #480
base: main
Are you sure you want to change the base?
Conversation
-add buildiong class -modify DSM naive bidding strategy -refactor function and move common functions to DSMFlex -add tests for the building class -some code refactoring
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #480 +/- ##
==========================================
+ Coverage 76.71% 76.85% +0.14%
==========================================
Files 50 51 +1
Lines 6412 6650 +238
==========================================
+ Hits 4919 5111 +192
- Misses 1493 1539 +46
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
-improve docstrings
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 to me, thanks!
@HafnerMichael there was a small mistake on your branch in the sell_to_market constraints, please compare your working branch with this one to fix the issue since it can affect your results, if you are using that feature |
Ok, no I dont use it there but thanks for the reminder! |
assume/units/building.py
Outdated
unit_operator: str, | ||
index: pd.DatetimeIndex, | ||
bidding_strategies: dict, | ||
components: dict[str, dict], |
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 please check my comment at #476. In the RL scenario I faced an issue, that non RL bidding households get initialized with e.g. dict[str, PVPlant]
instead of dict[str, dict]
@nick-harder I added a small example (example_01h) |
pv_profile.index = self.model.time_steps | ||
self.components["pv_plant"][ | ||
"power_profile" if not uses_power_profile else "availability_profile" | ||
] = pv_profile |
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.
I had to add the index here
self.model = pyo.ConcreteModel() | ||
self.define_sets() |
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.
and to move the init of the model and its time steps up here
# Validate provided components against the list of optional technologies | ||
for component in self.components.keys(): | ||
if component not in self.optional_technologies: | ||
raise ValueError( |
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.
New looping format updated
Returns: | ||
Orderbook: The bids consisting of the start time, end time, only hours, price and volume. | ||
""" | ||
|
||
# calculate the optimal operation of the unit | ||
unit.calculate_optimal_operation_if_needed() | ||
|
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.
executing flexibility
assume/units/building.py
Outdated
|
||
# Select the first available solver from the predefined list | ||
solvers = check_available_solvers(*SOLVERS) | ||
if len(solvers) < 1: | ||
raise Exception(f"None of {SOLVERS} are available") | ||
|
||
self.solver = SolverFactory(solvers[0]) | ||
self.solver_options = { | ||
"output_flag": False, | ||
"log_to_console": False, | ||
"LogToConsole": 0, | ||
} | ||
|
||
self.opt_power_requirement = None | ||
self.variable_cost_series = None | ||
|
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.
passing dictionary to map flexibility measure
flexibility_measure (str): Metric used to assess the building's flexibility, e.g., "max_load_shift". | ||
""" | ||
|
||
# List of optional technologies that a building unit can incorporate |
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.
container for required technologies fixed
Both variables are defined over the `time_steps` set and are continuous real numbers. | ||
""" | ||
self.model.variable_power = pyo.Var(self.model.time_steps, within=pyo.Reals) | ||
self.model.variable_cost = pyo.Var(self.model.time_steps, within=pyo.Reals) |
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.
variable_power refactored to total_power_input
Pull Request
Related Issue
Closes #454
Description
This add a Building DSM class and combines all residential components into one class by @HafnerMichael.
Changes Proposed
-add building class
-modify DSM naive bidding strategy
-refactor function and move common functions to DSMFlex -add tests for the building class
-some code refactoring
Testing
[Describe the testing you've done, including any specific test cases or scenarios]
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]