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

Enable saving results only at the end of the simulation #193

Merged
merged 7 commits into from
Sep 20, 2023

Conversation

nick-harder
Copy link
Member

-adds a function to store all results at the end
-fixes cvs_path creating an empty folder when not defined

-fixes cvs_path creating an empty folder when not defined
@codecov
Copy link

codecov bot commented Sep 16, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (163fb56) 79.00% compared to head (0686de7) 79.00%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #193   +/-   ##
=======================================
  Coverage   79.00%   79.00%           
=======================================
  Files          40       40           
  Lines        4048     4048           
=======================================
  Hits         3198     3198           
  Misses        850      850           
Flag Coverage Δ
pytest 79.00% <100.00%> (ø)

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

Files Changed Coverage Δ
assume/common/outputs.py 81.44% <100.00%> (ø)

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

assume/common/outputs.py Outdated Show resolved Hide resolved
learning_mode: bool = False,
):
super().__init__()

# store needed date
self.simulation_id = simulation_id
self.save_frequency_hours = save_frequency_hours
self.save_frequency_hours = save_frequency_hours or (end - start).days * 24
Copy link
Member

Choose a reason for hiding this comment

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

When would you want to disable saving results in given intervals?
Stating "same_process=False" should fix consuming performance, by using a separate process

The remaining data will always be written in on_stop of the outputs role

Copy link
Member Author

Choose a reason for hiding this comment

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

as of right now this saving each day consumes a big chunk of time as multithread is not working. We should have this until second thread works. Also, sometime you really don't need all that data every day of the run...

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 believe this is also not because of the db, but the csv files, those require a lot of time

assume/common/outputs.py Outdated Show resolved Hide resolved
assume/common/outputs.py Outdated Show resolved Hide resolved
examples/examples.py Outdated Show resolved Hide resolved
@nick-harder
Copy link
Member Author

@maurerle soll es durch?

@maurerle
Copy link
Member

Ich wollte es noch nachstellen, ob das = None tatsächlich notwendig ist..

@nick-harder
Copy link
Member Author

ach ja stimmt, jetzt ist 24 wieder default

@maurerle maurerle merged commit 4508c2b into main Sep 20, 2023
@maurerle maurerle deleted the add-save-at-the-end-feature branch September 20, 2023 10:44
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