-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #404 from tomalrussell/feature/run_once
Run a single model for a single timestep, with CLI subcommands. Run 'smif run <modelrun> --dry-run' to see how to use these subcommands to step through running a model run. Essentially there are three steps: - 'smif decide' sets up decisions and reports on the timesteps and decisions that the DecisionManager says should run - 'smif before_step' initialises a model - this should only need to be run once per modelrun, and not all models do work in this step - 'smif step' runs a single model for a single timestep and single decision, setting up the data handle and calling Model.simulate Other changes of note: - Skip testing database connection, which is otherwise unused - may be worth stripping out if there are no active plans to develop database backend. - Handle one-dimensional DataArray to Dataframe conversions, with round-trip testing and in particular single-level MultiIndex handling. Surprising bug when dimension elements were not in alphabetical order led to misordered data. - Allow concrete instances of Model, SectorModel to avoid needing to instantiate wrapper classes (with all dependencies) in the main smif process. - Refactor CLI tests to call smif.cli.main for ~4x speed-up (from about 2m to 30s), using pytest capsys fixture to capture stdout and stderr.
- Loading branch information
Showing
24 changed files
with
720 additions
and
239 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.