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

Results and Control updates for testing and stepwise. #375

Draft
wants to merge 23 commits into
base: main
Choose a base branch
from

Conversation

kbonney
Copy link
Collaborator

@kbonney kbonney commented Aug 31, 2023

Summary

  • Extended functionality of the results object by adding the ability to perform operations such as addition between two results objects.
  • Added _shift method to Control base class and implemented on some sub classes- "Shift any SimTimeConditions within larger condition rules by value seconds (backward)."
  • set_initial_conditions() method added to water network model class which "Sets the initial conditions of the network based on prior simulation results." This method utilized the _shift method defined above.
  • Updates the link_status conversions performed during inp file reading to reflect conditions more accurately.

Tests and documentation

Updates to result object are used to restructure test_multiple_simuluations.py, which has been split into the following files:

  • test_stop_start_sim.py: tests the use of set_initial_conditions to perform a simulation in multiple steps. (EpanetSim and WNTRSim).
  • test_pickle_reset: tests that results are consistent when pickling a water network and using reset_initial_conditions
  • test_reset_initial_values: tests that reset_initial_values gives approximately the same results before and after its use.

Additionally, a test for the new results object was added in test_results.py

Acknowledgement

By contributing to this software project, I acknowledge that I have reviewed the software quality assurance guidelines and that my contributions are submitted under the Revised BSD License.

@coveralls
Copy link

coveralls commented Aug 31, 2023

Coverage Status

coverage: 84.553% (+0.1%) from 84.404%
when pulling 29fa5c9 on kbonney:results
into 435d505 on USEPA:main.

@kbonney kbonney changed the title Adding results files to fresh branch Results and Control updates for Stepwise Oct 23, 2023
@kbonney kbonney changed the title Results and Control updates for Stepwise Results and Control updates for testing and stepwise. Oct 23, 2023
@kbonney
Copy link
Collaborator Author

kbonney commented Oct 23, 2023

TODO:

  • Check reset_initial_values function to make sure it is working properly and add a test.
  • Make sure WNTR resets after running sim so that it is aligned with EPANET.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Pull out reset/set initial conditions tests to separate test file

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.

3 participants