Skip to content

Add increment kwarg to model.py's run() method#445

Merged
briandrawert merged 23 commits into
developfrom
incrementKwargFix
Sep 24, 2021
Merged

Add increment kwarg to model.py's run() method#445
briandrawert merged 23 commits into
developfrom
incrementKwargFix

Conversation

@Fin109

@Fin109 Fin109 commented Sep 30, 2020

Copy link
Copy Markdown
Contributor
  • Allows user to specify "increment" when running a model ex: model.run(solver=mysolver, increment=.01)

  • This functions the same as setting models timeline to something that will produce a specific increment, such as; numpy.linspace(0,100,10001) (increment of .01)

@briandrawert

Copy link
Copy Markdown
Member

This should throw an error if they both specify model.timespan and model.increment.

@briandrawert briandrawert added this to the 1.6 milestone Sep 30, 2020
@briandrawert
briandrawert marked this pull request as draft April 19, 2021 18:18
@ethangreen-dev ethangreen-dev added the enhancement New feature or request label Jun 8, 2021
@briandrawert briandrawert modified the milestones: 1.6.0, 1.7.0 Jun 21, 2021
@briandrawert briandrawert modified the milestones: 1.7.0, 1.6.1 Jun 21, 2021
Base automatically changed from develop to main June 22, 2021 15:12
@ethangreen-dev
ethangreen-dev changed the base branch from main to develop June 25, 2021 21:27
@ethangreen-dev
ethangreen-dev removed their request for review June 25, 2021 21:30
@ethangreen-dev ethangreen-dev mentioned this pull request Jun 25, 2021
@ethangreen-dev
ethangreen-dev marked this pull request as ready for review June 25, 2021 21:43
@ethangreen-dev ethangreen-dev modified the milestones: 1.6.1, 1.7.0 Jun 28, 2021
@briandrawert briandrawert modified the milestones: 1.7.0, 1.6.4 Sep 13, 2021
@briandrawert

Copy link
Copy Markdown
Member

@jtcooper10 : raises an error if increment and self.timespan are both set... but self.timespan is always set, if the user doesn't provide a timespan then a timespan is created for them. So this approach will cause an error to be raised anytime that increment is provided, no matter what

@briandrawert briandrawert modified the milestones: 1.7.0, 1.6.4 Sep 20, 2021
…eck that ensures that both the tspan and increment are not set.

@jtcooper10 jtcooper10 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Timespan set in constructor if not provided by the user, causing increment to raise an error. Conversely, removing the default construction of a timespan might be considered a breaking change.

Comment thread gillespy2/core/model.py Outdated
@BryanRumsey
BryanRumsey marked this pull request as ready for review September 20, 2021 21:27
@briandrawert
briandrawert merged commit 38559c9 into develop Sep 24, 2021
@briandrawert
briandrawert deleted the incrementKwargFix branch September 24, 2021 19:39
@seanebum seanebum mentioned this pull request Sep 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants