Skip to content

Remove error when time overshoots maximum time#77

Merged
kaelyndunnell merged 4 commits into
mainfrom
avoid-error
Jan 14, 2025
Merged

Remove error when time overshoots maximum time#77
kaelyndunnell merged 4 commits into
mainfrom
avoid-error

Conversation

@RemDelaporteMathurin
Copy link
Copy Markdown
Collaborator

This pull request includes changes to improve error handling and add a new test case. The most important changes include modifying the get_row method in src/hisp/scenario.py to use a warning instead of raising an error, and adding a new test case in test/test_mb_model_festim.py to check for model overshoot at the last timestep.

Error handling improvements:

  • src/hisp/scenario.py: Changed the get_row method to issue a UserWarning instead of raising a ValueError when the time t is out of bounds. This allows the method to return a value even when the time is out of bounds.

Testing enhancements:

  • test/test_mb_model_festim.py: Added a new test case test_model_last_timestep_overshoot to verify the behavior of the model when the last timestep overshoots. This test case initializes a scenario and model, sets the model parameters, and checks the iteration process.

Copy link
Copy Markdown
Collaborator

@kaelyndunnell kaelyndunnell left a comment

Choose a reason for hiding this comment

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

Looks good!

@kaelyndunnell kaelyndunnell merged commit 8ccc4ed into main Jan 14, 2025
@kaelyndunnell kaelyndunnell deleted the avoid-error branch January 14, 2025 22:03
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