assume-framework / assume

ASSUME - Agent-based Simulation for Studying and Understanding Market Evolution
https://assume.readthedocs.io
20 stars 5 forks source link

Tests and classes of Dst components, steel plant, flexibility script #344

Open Manish-Khanra opened 2 months ago

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 25.63694% with 467 lines in your changes missing coverage. Please review.

Project coverage is 72.22%. Comparing base (c0dfe40) to head (245635f). Report is 31 commits behind head on main.

:exclamation: Current head 245635f differs from pull request most recent head 74001cc

Please upload reports for the commit 74001cc to get more accurate results.

Files Patch % Lines
assume/units/dst_components.py 34.49% 226 Missing :warning:
assume/units/steel_plant.py 10.55% 195 Missing :warning:
assume/scenario/loader_csv.py 28.00% 18 Missing :warning:
assume/strategies/naive_strategies.py 16.66% 15 Missing :warning:
assume/common/forecasts.py 35.00% 13 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #344 +/- ## ========================================== - Coverage 74.92% 72.22% -2.70% ========================================== Files 43 45 +2 Lines 5120 5693 +573 ========================================== + Hits 3836 4112 +276 - Misses 1284 1581 +297 ``` | [Flag](https://app.codecov.io/gh/assume-framework/assume/pull/344/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=assume-framework) | Coverage Δ | | |---|---|---| | [pytest](https://app.codecov.io/gh/assume-framework/assume/pull/344/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=assume-framework) | `72.22% <25.63%> (-2.70%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=assume-framework#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

nick-harder commented 1 month ago

[data_format = "timescale" # "local_db" or "timescale"](https://github.com/assume-framework/assume/blob/79d7c749aef0664aba4ba2d5340f906d03457f24/examples/examples.py#L75-L82) here is a test problem comment @Manish-Khanra

Manish-Khanra commented 1 month ago

@nick-harder Hi Nick, Could you please run the example_04_base_case_steel_plant_2019, and check whats the issue? I am getting the below error with our new update: RuntimeWarning: invalid value encountered in cast new_result = trans(result).astype(dtype)

nick-harder commented 1 month ago

@nick-harder Hi Nick, Could you please run the example_04_base_case_steel_plant_2019, and check whats the issue? I am getting the below error with our new update: RuntimeWarning: invalid value encountered in cast new_result = trans(result).astype(dtype)

@Manish-Khanra works fine for me! I would suggest to complete delete the folder local_db and try again. this error looks like it is cming from writing data at some point

Manish-Khanra commented 1 month ago

@nick-harder also tried deleting the folder, still getting the same error.

nick-harder commented 1 month ago

@Manish-Khanra now I am getting the following error: File "/Users/nick/GitHub/assume/assume/units/steel_plant.py", line 414, in calculate_marginal_cost +value(self.components["electrolyser"].b.electrolyser_operating_cost[t]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "pyomo/core/expr/numvalue.pyx", line 229, in pyomo.core.expr.numvalue.value File "pyomo/core/expr/numvalue.pyx", line 215, in pyomo.core.expr.numvalue.value ValueError: No value for uninitialized NumericValue object electrolyser_operating_cost[0]

could you please take a look at it and let me know when it's fixed. I will look into your other issue further afterwards. thanks!

Manish-Khanra commented 1 month ago

@Manish-Khanra now I am getting the following error: File "/Users/nick/GitHub/assume/assume/units/steel_plant.py", line 414, in calculate_marginal_cost +value(self.components["electrolyser"].b.electrolyser_operating_cost[t]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "pyomo/core/expr/numvalue.pyx", line 229, in pyomo.core.expr.numvalue.value File "pyomo/core/expr/numvalue.pyx", line 215, in pyomo.core.expr.numvalue.value ValueError: No value for uninitialized NumericValue object electrolyser_operating_cost[0]

could you please take a look at it and let me know when it's fixed. I will look into your other issue further afterwards. thanks!

This error stems from the same issue. The previous error message occured when I have commented out marginal cost function. This error message is when I have again included the marginal cost function. I suspect this error is related to the sequencing of the pyomo components while creating an instance of a model called 'model_opt'. Could figure out the solution yet