Loading .gitlab-ci.yml +1 −1 Original line number Diff line number Diff line Loading @@ -411,7 +411,7 @@ test:cli: - utopia run ForestFire -d --num-seeds=3 --run-mode single --note no_sweep # Test using a configuration set to specify run and plots config - utopia run ForestFire -d --cs universe_example -N 10 - utopia run ForestFire -d --cs long_run -N 10 - if utopia run ForestFire --cs bad_config_set_name; then exit 1; else echo -e "\nFailed as expected"; fi # .. Evaluation ........................................................... Loading doc/usage/run/config.rst +1 −1 Original line number Diff line number Diff line Loading @@ -128,7 +128,7 @@ The following command will invoke a ``ForestFire`` model simulation with the run .. code-block:: bash utopia run ForestFire --cfg-set multiverse_example utopia run ForestFire --cfg-set p_lightning_sweep A config set is simply a directory containing a ``run.yml`` file and/or an ``eval.yml`` file. In the above example, the directory's name is ``multiverse_example`` and it contains both of these files. Loading python/model_tests/SEIRD/test_SEIRD.py +27 −0 Original line number Diff line number Diff line Loading @@ -323,3 +323,30 @@ def test_directed_movement(): # If there are infected ones, there should be movement in the # high density population assert (data.isel(time=t) != data.isel(time=t + 1)).any() def test_run_and_eval_cfgs(): """Carries out all additional configurations that were specified alongside the default model configuration. This is done automatically for all run and eval configuration pairs that are located in subdirectories of the ``cfgs`` directory (at the same level as the default model configuration). If no run or eval configurations are given in the subdirectories, the respective defaults are used. See :py:meth:`~utopya.model.Model.run_and_eval_cfg_paths` for more info. """ for cfg_name, cfg_paths in mtc.default_config_sets.items(): print(f"\nRunning '{cfg_name}' configuration ...") mv, _ = mtc.create_run_load( from_cfg=cfg_paths.get("run"), parameter_space=dict( num_steps=50, SEIRD=dict(cell_manager=dict(grid=dict(resolution=48))), ), ) mv.pm.plot_from_cfg(plots_cfg=cfg_paths.get("eval")) print(f"Succeeded running and evaluating '{cfg_name}'.\n") python/utopia_base_plots.yml +18 −2 Original line number Diff line number Diff line Loading @@ -195,11 +195,10 @@ _: # ============================================================================= # start: .animation # The default animation config # NOTE These do not enable animation, but merely set parameters. # Use `.animation.enabled` or the specific `.animation.<writer>` configs. .animation.defaults: based_on: - .animation.defaults # from utopya - .animation.medium_dpi # from here # By default, use the ffmpeg writer and the mp4 output format file_ext: mp4 Loading @@ -207,6 +206,13 @@ _: writer: ffmpeg # Animation defaults that are disabled by default .animation.disabled: based_on: - .animation.defaults - .animation.disabled - .defaults.file_ext # Base configs enabling animation for a writer & including the Utopia defaults .animation.ffmpeg: Loading @@ -220,6 +226,16 @@ _: - .animation.defaults # from here # DPI settings .animation.medium_dpi: animation: writer_kwargs: frames: saving: dpi: 96 ffmpeg: saving: dpi: 96 Loading src/utopia/models/ForestFire/cfgs/universe_example/eval.yml→src/utopia/models/ForestFire/cfgs/long_run/eval.yml +0 −0 File moved. View file Loading
.gitlab-ci.yml +1 −1 Original line number Diff line number Diff line Loading @@ -411,7 +411,7 @@ test:cli: - utopia run ForestFire -d --num-seeds=3 --run-mode single --note no_sweep # Test using a configuration set to specify run and plots config - utopia run ForestFire -d --cs universe_example -N 10 - utopia run ForestFire -d --cs long_run -N 10 - if utopia run ForestFire --cs bad_config_set_name; then exit 1; else echo -e "\nFailed as expected"; fi # .. Evaluation ........................................................... Loading
doc/usage/run/config.rst +1 −1 Original line number Diff line number Diff line Loading @@ -128,7 +128,7 @@ The following command will invoke a ``ForestFire`` model simulation with the run .. code-block:: bash utopia run ForestFire --cfg-set multiverse_example utopia run ForestFire --cfg-set p_lightning_sweep A config set is simply a directory containing a ``run.yml`` file and/or an ``eval.yml`` file. In the above example, the directory's name is ``multiverse_example`` and it contains both of these files. Loading
python/model_tests/SEIRD/test_SEIRD.py +27 −0 Original line number Diff line number Diff line Loading @@ -323,3 +323,30 @@ def test_directed_movement(): # If there are infected ones, there should be movement in the # high density population assert (data.isel(time=t) != data.isel(time=t + 1)).any() def test_run_and_eval_cfgs(): """Carries out all additional configurations that were specified alongside the default model configuration. This is done automatically for all run and eval configuration pairs that are located in subdirectories of the ``cfgs`` directory (at the same level as the default model configuration). If no run or eval configurations are given in the subdirectories, the respective defaults are used. See :py:meth:`~utopya.model.Model.run_and_eval_cfg_paths` for more info. """ for cfg_name, cfg_paths in mtc.default_config_sets.items(): print(f"\nRunning '{cfg_name}' configuration ...") mv, _ = mtc.create_run_load( from_cfg=cfg_paths.get("run"), parameter_space=dict( num_steps=50, SEIRD=dict(cell_manager=dict(grid=dict(resolution=48))), ), ) mv.pm.plot_from_cfg(plots_cfg=cfg_paths.get("eval")) print(f"Succeeded running and evaluating '{cfg_name}'.\n")
python/utopia_base_plots.yml +18 −2 Original line number Diff line number Diff line Loading @@ -195,11 +195,10 @@ _: # ============================================================================= # start: .animation # The default animation config # NOTE These do not enable animation, but merely set parameters. # Use `.animation.enabled` or the specific `.animation.<writer>` configs. .animation.defaults: based_on: - .animation.defaults # from utopya - .animation.medium_dpi # from here # By default, use the ffmpeg writer and the mp4 output format file_ext: mp4 Loading @@ -207,6 +206,13 @@ _: writer: ffmpeg # Animation defaults that are disabled by default .animation.disabled: based_on: - .animation.defaults - .animation.disabled - .defaults.file_ext # Base configs enabling animation for a writer & including the Utopia defaults .animation.ffmpeg: Loading @@ -220,6 +226,16 @@ _: - .animation.defaults # from here # DPI settings .animation.medium_dpi: animation: writer_kwargs: frames: saving: dpi: 96 ffmpeg: saving: dpi: 96 Loading
src/utopia/models/ForestFire/cfgs/universe_example/eval.yml→src/utopia/models/ForestFire/cfgs/long_run/eval.yml +0 −0 File moved. View file