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

Release cycle, December 2024 #375

Merged
merged 174 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
174 commits
Select commit Hold shift + click to select a range
8974cc4
fixes the argument call to the plot of emcee chains
jcblemai Sep 16, 2024
1453303
finish the plot
jcblemai Sep 16, 2024
e4bbd8c
fix emcee rmse error spotted by Tim in #300
jcblemai Sep 16, 2024
311a20b
Save seir, spar and snpi on save, + made more granullar to access a f…
jcblemai Sep 17, 2024
80e63b8
fix
jcblemai Sep 17, 2024
bf7c37a
change the order so it fails fast if something already exist
jcblemai Sep 17, 2024
6725bf6
a very hacky and stupid batch hack to fight memory creep...
jcblemai Sep 18, 2024
70bbee8
trying to trigger a llik reevaluation
jcblemai Sep 19, 2024
465d0bb
solve #316: likelihood are discarded during resume
jcblemai Sep 19, 2024
2c54cfd
upgrade plot to show the transformed data
jcblemai Sep 20, 2024
f1ecbe6
plotting proections
jcblemai Sep 25, 2024
b5409a7
file structure
jcblemai Sep 25, 2024
ebbf2c2
add poisson likelihood
twallema Sep 25, 2024
589af08
add new distributions - retain old distributions
twallema Sep 25, 2024
b797cf7
miscopied the poisson from pySODM
twallema Sep 25, 2024
3ca0c7a
match data format gempyor --> not summed over dates --> happens after
twallema Sep 25, 2024
88686cd
fix plot-fit for one outcome
twallema Sep 26, 2024
1b1ddb2
tentative: propose cocktail of emcee "moves"
twallema Sep 26, 2024
7e2a061
compatibility with python on longleaf. To remove ?
jcblemai Sep 27, 2024
8849b24
Merge branch 'emcee_batch' of https://github.com/HopkinsIDD/flepiMoP …
jcblemai Sep 27, 2024
6caa83f
plot fix
jcblemai Sep 28, 2024
a843710
Merge branch 'emcee_batch' of https://github.com/HopkinsIDD/flepiMoP …
jcblemai Sep 28, 2024
ae86e52
nicer grid
jcblemai Sep 28, 2024
965ef19
simplify my life
jcblemai Sep 30, 2024
33bd35c
reload groundtruth to help with usage
jcblemai Oct 3, 2024
b590d92
default to making config plots
jcblemai Oct 3, 2024
5ee0f2b
new config
jcblemai Oct 3, 2024
ce59add
cocktail change
jcblemai Oct 3, 2024
fabc759
energy savings :D
jcblemai Oct 3, 2024
d80f213
add a precheck for config sensitivity after what happen on Flu R1 2024
jcblemai Oct 4, 2024
fb5618f
error
jcblemai Oct 4, 2024
823d81f
this check is vad...
jcblemai Oct 15, 2024
88e305b
postprocessing script
jcblemai Oct 15, 2024
ec12e4b
gen markdown
jcblemai Oct 15, 2024
37f7901
draft of modifiers support of out of reach subpops, still unsafe
jcblemai Oct 30, 2024
f186244
remove print
jcblemai Oct 31, 2024
a18d170
temp
jcblemai Oct 31, 2024
b99afec
merge
jcblemai Oct 31, 2024
3ddc975
very iugly code for cli that plot modifiers activation and time series
jcblemai Nov 7, 2024
5ea3d41
add outcoems parameters
jcblemai Nov 7, 2024
a3541d5
tried the outcoems NPI plot
jcblemai Nov 7, 2024
6da7439
tried the outcoems NPI plot
jcblemai Nov 7, 2024
29de35e
fix one subpop
jcblemai Nov 7, 2024
d827993
Modify GitHub actions to work on dev branch
TimothyWillard Oct 29, 2024
8cf5cf0
initial demo for patching configs capability
pearsonca Oct 8, 2024
83584d5
add config patching
pearsonca Oct 9, 2024
0f314fd
address cleanup comments
pearsonca Oct 10, 2024
9c32070
Update flepimop/gempyor_pkg/src/gempyor/cli.py
pearsonca Oct 10, 2024
ea7d701
further pare down tutorial configs
pearsonca Oct 10, 2024
6c18229
expand cli coverage
pearsonca Oct 10, 2024
a19fda1
remove non-used click imports
pearsonca Oct 10, 2024
148eabf
update tutorial testing
pearsonca Oct 10, 2024
29edd64
adding internal comments to cli.py
pearsonca Oct 10, 2024
d0ba0f1
non-working WIP; issue with (non)scenario parsing
pearsonca Oct 10, 2024
7fcf9e2
update scenario parsing, test files
pearsonca Oct 11, 2024
1da4613
incorporate backwards compat
pearsonca Oct 11, 2024
349af52
deal with None cases
pearsonca Oct 11, 2024
c06b475
addressing some tw comments
pearsonca Oct 14, 2024
4da0748
add back in commented out
pearsonca Oct 14, 2024
77215ba
add back in commented out + whitespace
pearsonca Oct 14, 2024
95bdcc9
reorder imports in shared cli
pearsonca Oct 14, 2024
8cc838a
fix scenario parsing issues, re-route gempyor-simulate calls
pearsonca Oct 14, 2024
93ab641
re-add trailing comma
pearsonca Oct 14, 2024
e937413
revert tutorial pruning
pearsonca Oct 14, 2024
c785100
revert more tutorial pruning
pearsonca Oct 14, 2024
d4a0f12
maybe fix CI?
pearsonca Oct 14, 2024
736616e
another attempt to fix dispatch
pearsonca Oct 14, 2024
bf3c8d8
address cli testing issue
pearsonca Oct 14, 2024
e98396e
update examples and cli testing
pearsonca Oct 15, 2024
04a8b3e
prune deprecated, some shared_cli reorg
pearsonca Oct 15, 2024
44d3d34
WIP on kwargs approach to cli [skip ci]
pearsonca Oct 15, 2024
3f15fb0
dynamically generated docstrings
pearsonca Oct 16, 2024
34672aa
kwargs-ify parse_config_files
pearsonca Oct 16, 2024
53fda99
Update flepimop/gempyor_pkg/src/gempyor/shared_cli.py
pearsonca Oct 16, 2024
fc30bf7
kwargs-ify simulate
pearsonca Oct 16, 2024
04b6660
adding gempyor-simulate deprecation
pearsonca Oct 16, 2024
b83f178
deprecate gempyor-simulate
pearsonca Oct 16, 2024
ef10edf
stub in parse config [skip ci]
pearsonca Oct 16, 2024
cca888c
leverage click.Parameter typecasting / validation
pearsonca Oct 16, 2024
9b69cc6
introduce passing click context if available
pearsonca Oct 18, 2024
e198517
add unit testing for parse config
pearsonca Oct 21, 2024
6f685ba
handle tuple case in shared_cli
pearsonca Oct 21, 2024
728a000
full option testing
pearsonca Oct 21, 2024
4adc388
apply black formatting [skip ci]
pearsonca Oct 21, 2024
54d9ac6
WIP test patch [skip ci]
pearsonca Oct 21, 2024
f999b56
working patch test
pearsonca Oct 21, 2024
d761c5a
Update flepimop/gempyor_pkg/src/gempyor/shared_cli.py
pearsonca Oct 22, 2024
fe4f289
Update flepimop/gempyor_pkg/src/gempyor/shared_cli.py
pearsonca Oct 22, 2024
605fb64
prune yaml import from test
pearsonca Oct 22, 2024
986aafa
docstring generation tweaking
pearsonca Oct 22, 2024
a1bb715
reconstitute simulate interface [skip ci]
pearsonca Oct 24, 2024
80023ec
issue warnings for config files with duplicate keys
pearsonca Oct 24, 2024
158a2bc
clarify click version requirement and remove string filtering
pearsonca Oct 28, 2024
48eca06
correct click version
pearsonca Oct 28, 2024
af1566d
update documentation to remove reference to gempyor-simulate [skip ci]
pearsonca Oct 29, 2024
f4810cf
add multi-config documentation
pearsonca Oct 29, 2024
65e7fea
update multi-configs gitbook to give caveat example
pearsonca Oct 29, 2024
2c73f38
Apply black formatter
TimothyWillard Nov 4, 2024
d7345dd
Conditional deactivate env, then activate new env
TimothyWillard Nov 7, 2024
8da1720
Split conda activate into three cases
TimothyWillard Nov 7, 2024
24c17ac
Convert `setup.cfg` to `pyproject.toml`
TimothyWillard Nov 8, 2024
48842f6
Add missing `h5py` and `dask[dataframe]` deps
TimothyWillard Nov 8, 2024
454c664
Restrict max python version
TimothyWillard Nov 8, 2024
50c195e
Update flepimop/gempyor_pkg/pyproject.toml
TimothyWillard Nov 8, 2024
b1cda6e
Update home page in `pyproject.toml`
TimothyWillard Nov 8, 2024
0439fcd
added postprocessing for several subpop
jcblemai Nov 8, 2024
7a57dc5
Add `ModelInfo` type hints
TimothyWillard Nov 13, 2024
69d1a44
WIP on NPIs
pearsonca Nov 13, 2024
9dd5cb0
linting applied
pearsonca Nov 13, 2024
22d8950
fix npi test
pearsonca Nov 13, 2024
70f9cd7
Update flepimop/gempyor_pkg/src/gempyor/NPI/base.py
pearsonca Nov 13, 2024
ab86912
Pull HPC init/build from `main` into `emcee_batch`
TimothyWillard Nov 15, 2024
c76f83d
Add index to development, init git/github docs
TimothyWillard Oct 29, 2024
45612b2
Add more details to git/GitHub dev docs
TimothyWillard Oct 29, 2024
a095942
Add development links to `SUMMARY.md`
TimothyWillard Oct 29, 2024
051a636
Add description of operations to git/GitHub
TimothyWillard Oct 29, 2024
0d1ef15
Add branch prefixing to docs
TimothyWillard Oct 29, 2024
605e068
Remove outdated sections from python guidelines
TimothyWillard Nov 18, 2024
5aea02d
Add minor notes about docs in workflow
TimothyWillard Nov 18, 2024
7ae2917
Pull postprocessing from `emcee_batch`
TimothyWillard Nov 19, 2024
3977b8d
Pull examples from `emcee_batch`
TimothyWillard Nov 19, 2024
0c67060
Merge emcee_batch into feature/403/emcee_batch
TimothyWillard Nov 19, 2024
029f8c8
Apply `black` formatter post-merge
TimothyWillard Nov 19, 2024
d58f6d9
Update tests for `Statistics` to pass
TimothyWillard Nov 19, 2024
0055ed8
Missing compartments runtime error and tests
TimothyWillard Nov 19, 2024
fc23642
Edits to make `test_outcome_scenario` pass
TimothyWillard Nov 19, 2024
9347849
Update `test_outcome_modifiers_scenario_with_load`
TimothyWillard Nov 21, 2024
aeb3a77
Update `test_outcomes_npi` test
TimothyWillard Nov 21, 2024
b65276c
Update `test_outcomes_npi_custom_pname` test
TimothyWillard Nov 21, 2024
413690b
Updates to make inference tests pass
TimothyWillard Nov 21, 2024
dfc2ae3
Fix `test_full_npis_read_write` test
TimothyWillard Nov 21, 2024
0c1bb46
Update `test_spatial_groups` test config
TimothyWillard Nov 21, 2024
e3cb537
Bug fix `compute_all_multioutcomes`
TimothyWillard Nov 21, 2024
05b760b
Update the 'Inference with EMCEE' gitbook docs
TimothyWillard Nov 22, 2024
f7d19eb
Updated sample/tutorial files
alsnhll Nov 26, 2024
6cbfa5e
Remove confusing/unneeded lines
TimothyWillard Dec 2, 2024
eda84e4
Use confuse `as_str_seq` getter for subpop
TimothyWillard Dec 2, 2024
f0f5fe7
Merge pull request #370 from HopkinsIDD/dev-docs
TimothyWillard Dec 3, 2024
481e63f
Add test for `flepimop modifiers config-plot`
TimothyWillard Dec 3, 2024
df76d3f
modified to capture stdout and stderr to log in using system2() being…
kjsato Aug 7, 2024
b3ba872
Minor edits to log file construction
TimothyWillard Nov 18, 2024
d883bfb
Move log file to working directory
TimothyWillard Nov 18, 2024
7f9d3f0
Use `flepimop-inference-slot` cmd directly
TimothyWillard Dec 2, 2024
9ae6bd3
Add CLI docs to `flepimop modifiers config-plot`
TimothyWillard Dec 3, 2024
0ebb08d
Merge pull request #289 from HopkinsIDD/main-#169
TimothyWillard Dec 3, 2024
73d2a2f
Merge dev into feature/403/emcee_batch
TimothyWillard Dec 3, 2024
980429e
Quick fix for GH-373
TimothyWillard Dec 4, 2024
8a83236
Initialize `GempyorInference.static_sim_arguments`
TimothyWillard Dec 4, 2024
0aca24f
Improving readability/consistency of errors/exceptions in gempyor (se…
emprzy Dec 4, 2024
9ba0c24
Merge dev into feature/403/emcee_batch
TimothyWillard Dec 4, 2024
7674af0
Merge pull request #407 from HopkinsIDD/update_examples
TimothyWillard Dec 4, 2024
7d10aa1
Update partial configs to match full
TimothyWillard Dec 4, 2024
5f5f6d6
Merge pull request #404 from HopkinsIDD/feature/403/emcee_batch
TimothyWillard Dec 4, 2024
48c2425
Add `NEWS.md` for release GH-375
TimothyWillard Dec 5, 2024
b32cad8
Casting bound values as `float` in `inference_parameter.py` to preven…
emprzy Dec 6, 2024
8e5baa3
Correct formula for poisson log-likelihood
TimothyWillard Dec 9, 2024
10e5d98
Add test case with poisson and zeros
TimothyWillard Dec 9, 2024
14d9bf3
Simplify poisson LL tests with only one variable
TimothyWillard Dec 10, 2024
b21cfcc
`flepimop patch` unit test for `seir::parameters`
TimothyWillard Dec 10, 2024
a104210
Rename dup `get_logloss` to `simulate_proposal`
TimothyWillard Dec 10, 2024
02678a3
Fix `parse_config_files` TL key override behavior
TimothyWillard Dec 11, 2024
fe1dc2b
Add `--indent` option to `flepimop patch`
TimothyWillard Dec 11, 2024
ba22f0b
Add detailed example to `flepimop patch --help`
TimothyWillard Dec 11, 2024
d3f89d2
Force default indent of `flepimop patch` to 4
TimothyWillard Dec 11, 2024
b5142d9
Upgrade TL key collision from warning to error
TimothyWillard Dec 11, 2024
b34792d
modify approach to handling help
pearsonca Dec 11, 2024
7ae1037
Add `_dump_formatted_yaml` for custom yaml dump
TimothyWillard Dec 11, 2024
b1d8404
Merge pull request #420 from HopkinsIDD/hotfix/correct-poisson-statis…
TimothyWillard Dec 11, 2024
0fe483e
`flepimop patch --help` uses example configs
TimothyWillard Dec 11, 2024
719c23b
update multi-configs gitbook
pearsonca Dec 11, 2024
11d8a2d
`parse_config_files` error includes config name
TimothyWillard Dec 11, 2024
ba9b527
Resolve seir/outcome modifier scenarios
TimothyWillard Dec 11, 2024
c88c524
`flepimop patch` documenation edits
TimothyWillard Dec 11, 2024
c5bde34
Merge pull request #423 from HopkinsIDD/hotfix/patching-abilities-doc…
TimothyWillard Dec 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/conda-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ on:
- build/create_environment_yml.R
- flepimop/R_packages/*/DESCRIPTION
branches:
- main
- dev
pull_request:
paths:
- build/create_environment_yml.R
- flepimop/R_packages/*/DESCRIPTION
branches:
- dev
- main

jobs:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/flepicommon-ci.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
name: flepicommon-ci
name: flepicommon CI

on:
workflow_dispatch:
push:
paths:
- flepimop/R_packages/flepicommon/**/*
branches:
- main
- dev
pull_request:
paths:
- flepimop/R_packages/flepicommon/**/*
branches:
- dev
- main

jobs:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/gempyor-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: gempyor-ci
name: gempyor CI

on:
workflow_dispatch:
Expand All @@ -7,12 +7,13 @@ on:
- examples/**/*
- flepimop/gempyor_pkg/**/*
branches:
- main
- dev
pull_request:
paths:
- examples/**/*
- flepimop/gempyor_pkg/**/*
branches:
- dev
- main

jobs:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/inference-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: inference-ci
name: inference CI

on:
workflow_dispatch:
Expand All @@ -10,11 +10,12 @@ on:
paths:
- flepimop/R_packages/inference/**/*
branches:
- main
- dev
pull_request:
paths:
- flepimop/R_packages/inference/**/*
branches:
- dev
- main

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ packrat/lib*/
dist/
SEIR.egg-info/
Outcomes.egg-info/
venv/
*venv*/
.venv/

# R package manuals
Expand Down
27 changes: 27 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# December 11th, 2024

**Bug Fixes:**

- The HPC init script no longer fails if a conda environment is already active, GH-388.
- Stdout/stderr from `flepimop-inference-slot` called by `flepimop-inference-main` are piped to a log file via `system2` instead of pipes to support MINGW64, GH-289.

**Dependencies:**

- `click` minimum is now 8.1.7 (latest as of Aug 17, 2023).
- Added missing `h5py` dependency to `gempyor` requirements and specified `dask` dependency to include `dataframe` optional dependencies, GH-391.

**Deprecates:**

- `gempyor-simulate ...` in favor of `flepimop simulate ...`.
- Soft deprecated the `-c/--config_files` option (config file(s) are now *arguments* not options).

**New Features:**

- Basic support for multiple config files
- A `patch` command that takes multiple config files and yields the merged result
- Converted `gempyor`'s `setup.cfg` to the more modern `pyproject.toml`, GH-391. No user facing changes.
- Added `flepimop modifiers` subcommand with one action, `config-plot`, for plotting the effects of modifiers on a config, GH-404.

**Removes/Modifies:**

- `gempyor-(seir|outcomes) ...` - these were already no longer supported, just pruning entry points
8 changes: 8 additions & 0 deletions batch/hpc_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ if [ -z "${FLEPI_CONDA}" ]; then
fi
echo "Using '$FLEPI_CONDA' for \$FLEPI_CONDA."
fi
CURRENT_CONDA_ENV=$( conda info | grep "active environment" | awk -F ':' '{print $2}' | xargs )
if [ "$CURRENT_CONDA_ENV" = "$FLEPI_CONDA" ]; then
echo "Detected the activate conda environment is '$FLEPI_CONDA' already, but will refresh."
conda deactivate
elif [ "$CURRENT_CONDA_ENV" != "None" ]; then
echo "Detected an active conda environment '$CURRENT_CONDA_ENV'. This will be deactivated and the '$FLEPI_CONDA' environment wil be activated."
conda deactivate
fi
conda activate $FLEPI_CONDA

# Check the conda environment is valid
Expand Down
4 changes: 3 additions & 1 deletion documentation/gitbook/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@

* [Before any run](how-to-run/before-any-run.md)
* [Quick Start Guide](how-to-run/quick-start-guide.md)
* [Multiple Configuration Files](multi-configs.md)
* [Advanced run guides](how-to-run/advanced-run-guides/README.md)
* [Running with Docker locally 🛳](how-to-run/advanced-run-guides/running-with-docker-locally.md)
* [Running locally in a conda environment 🐍](how-to-run/advanced-run-guides/quick-start-guide-conda.md)
Expand All @@ -57,8 +58,9 @@
* [Useful commands](how-to-run/useful-commands.md)
* [Tips, tricks, FAQ](how-to-run/tips-tricks-faq.md)

## 🗜️ Development
## [Development](./development/README.md)

* [Git and GitHub Usage](./development/git-and-github-usage.md)
* [Guidelines for contributors](development/python-guidelines-for-developers.md)

## Deprecated pages
Expand Down
3 changes: 3 additions & 0 deletions documentation/gitbook/development/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Development

This section covers development/contribution guidelines, including tutorials on how to setup your environment and guides on how we use git/GitHub.
27 changes: 27 additions & 0 deletions documentation/gitbook/development/git-and-github-usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Git and GitHub Usage

We now use a modified gitflow style workflow for working with git and GitHub. For a detailed overview of this topic please refer to [Atlassian's article on Gitflow workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow).


## New Features

New features should be developed in a new branch checked out from the `dev` branch and then merged back into the `dev` branch via a PR on GitHub when ready for review. These feature branches can be deleted after merging into `dev`, unless someone from operations requests that it be kept around. For example, operations may want to merge the feature into their operational branch to get new functionality in advance of a release. By convention feature branches should be prefixed with `feature/<GitHub issue>/`, I.e. `feature/99/cool-new-thing`. Feature branch should also include edits to the GitBook documentation that describe their changes.


## Hot Fixes

Hot fixes should be developed in a new branch checked out from the `main` branch and merged back into the `main` branch via a PR on GitHub when ready for review. After successfully merging into `main` the hot fix branch should then be merged into `dev`, making appropriate adjustments to stabilize the feature. The priority for hot fixes is to correct a major issue quickly, so it is okay to delay detailed testing/documentation until merging into `dev`. By convention hot fix branches should be prefixed with `hotfix/`, I.e. `hotfix/important-fix-to-something`, and then converted into a feature branch after merging into main. These do not have to include edits to the GitBook documentation, but if the hotfix conflicts with what is described in the GitBook documentation it's **strongly recommended**.


## Creating Releases

Periodically releases will be created by merging the `dev` branch into `main` via a PR on GitHub and creating a new release the `main` branch after merging. These PRs should avoid discussion of individual feature changes, those discussions should be reserved for and handled in the feature PRs. If there is a feature that poses a significant problem in the process of creating a new release those changes should be treated like a new feature. The main purpose of this PR is to:

1. Resolve merge conflicts generated by hot fixes,
2. Making minor edits to documentation to make it clearer or more cohesive, and
3. Updating the `NEWS.md` file with a summary of the changes included in the release.


## Operations

Operational work should be developed in a new branch checked out from the `main` branch if there are modifications needed to the `flepiMoP` codebase. Pre-released features can be merged directly into this operational branch from the corresponding feature branch as needed via a git merge or rebase not a GitHub PR. After the operational cycle is over, the operations branch **should not** be deleted, instead should be kept around for archival reasons. Operational work needs to move quickly and usually does not involve documenting or testing code and is therefore unsuitable for merging into `dev` or `main` directly. Instead potential features should be extracted from an operations branch into a feature branch using [git cherry-pick](https://git-scm.com/docs/git-cherry-pick) and then modified into an appropriates state for merging into `dev` like a feature branch. By convention operations branch names should be prefixed with `operations/`, I.e. `operations/flu-SMH-2023-24`.
Original file line number Diff line number Diff line change
Expand Up @@ -78,58 +78,3 @@ For those using a Mac or Linux system for development this command is also avail
```bash
cp -f bin/pre-commit .git/hooks/
```

#### Structure of the main classes

The code is structured so that each of the main classes **owns** a config segment, and only this class should parse and build the related object. To access this information, other classes first need to build the object.

{% hint style="warning" %}
Below, this page is still underconstruction
{% endhint %}

The main classes are:

* `Coordinates:` this is a light class that stores all the coordinates needed by every other class (e.g the time serie
* `Parameter`
* `Compartments`
* `Modifers`
* `Seeding`,
* `InitialConditions`
* a `writeDF`
* function to plot
* (TODO: detail pipeline internal API)

### Batch folder

Here are some notes useful to improve the batch submission:

Setup site wide Rprofile.

```
export R_PROFILE=$COVID_PATH/slurm_batch/Rprofile
```

> SLURM copies your environment variables by default. You don't need to tell it to set a variable on the command line for sbatch. Just set the variable in your environment before calling sbatch.

> There are two useful environment variables that SLURM sets up when you use job arrays:

> SLURM\_ARRAY\_JOB\_ID, specifies the array's master job ID number. SLURM\_ARRAY\_TASK\_ID, specifies the job array index number. https://help.rc.ufl.edu/doc/Using\_Variables\_in\_SLURM\_Jobs

SLURM does not support using variables in the #SBATCH lines within a job script (for example, #SBATCH -N=$REPS will NOT work). A very limited number of variables are available in the #SBATCH just as %j for JOB ID. However, values passed from the command line have precedence over values defined in the job script. and you could use variables in the command line. For example, you could set the job name and output/error files can be passed on the sbatch command line:

```
RUNTYPE='test'
RUNNUMBER=5
sbatch --job-name=$RUNTYPE.$RUNNUMBER.run --output=$RUNTYPE.$RUNUMBER.txt --export=A=$A,b=$b jobscript.sbatch
```

However note in this example, the output file doesn't have the job ID which is not available from the command line, only inside the sbatch shell script.

#### File descriptions

launch\_job.py and runner.py for non inference job

inference\_job.py launch a slurm or aws job, where it uses

* \`inference\_runner.sh\` and inference\_copy.sh for aws
* ;batch/inference\_job.run for slurm
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,10 @@ where:

#### Non-inference run

Stay in the `$DATA_PATH` folder, and run a simulation directly from forward-simulation Python package `gempyor`. To do this, call `gempyor-simulate` providing the name of the configuration file you want to run (ex. `config.yml`). An example config is provided in `flepimop_sample/config_sample_2pop_interventions.yml.`
Stay in the `$DATA_PATH` folder, and run a simulation directly from forward-simulation Python package `gempyor`. To do this, call `flepimop simulate` providing the name of the configuration file you want to run (ex. `config.yml`). An example config is provided in `flepimop_sample/config_sample_2pop_interventions.yml.`

```
gempyor-simulate -c config.yml
flepimop simulate config.yml
```

{% hint style="warning" %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,10 @@ flepimop-inference-main -j 1 -n 1 -k 1 -c config.yml

### Non-inference run

Stay in the `$DATA_PATH` folder, and run a simulation directly from forward-simulation Python package `gempyor,`call `gempyor-simulate` providing the name of the configuration file you want to run (ex. `config.yml` ;
Stay in the `$DATA_PATH` folder, and run a simulation directly from forward-simulation Python package `gempyor,`call `flepimop simulate` providing the name of the configuration file you want to run (ex. `config.yml`):

```
gempyor-simulate -c config.yml
flepimop simulate config.yml
```

{% hint style="warning" %}
Expand All @@ -216,7 +216,7 @@ Rscript build/local_install.R
pip install --no-deps -e flepimop/gempyor_pkg/
cd $DATA_PATH
rm -rf model_output
gempyor-simulate -c config.yml
flepimop simulate config.yml
</code></pre>

## Finishing up
Expand Down
48 changes: 48 additions & 0 deletions documentation/gitbook/how-to-run/multi-configs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
description: >-
Patching together multiple configuration files.
---

# Using Multiple Configuration Files

## 🧱 Set up

Create a sample project by copying from the examples folder:

```bash
mkdir myflepimopexample # or wherever
cd myflepimopexample
cp -r $FLEPI_PATH/examples/tutorials/* .
ls
```

You should see an assortment of yml files as a result of that `ls` command.

## Usage

If you run:

```bash
flepimop simulate config_sample_2pop.yml
```

You'll get a basic forward simulation of this example model. However, you might also note there are several `*_part.yml` files, corresponding to partial configs. You can `simulate` using the combination of multiple configs with, for example:

```bash
flepimop simulate config_sample_2pop.yml config_sample_2pop_outcomes_part.yml
```

While simulate can run your patched configuration, we also suggest you check your configuration file using the patch command:

```bash
flepimop patch config_sample_2pop.yml config_sample_2pop_outcomes_part.yml > config_new.yml
cat config_new.yml
```

You may provide an arbitrary number of separate configuration files to combine to create a complete configuration.

## Caveats

At this time, only simulate directly supports multiple configuration files, and our current patching capabilities only allow for the addition of new sections as given in our tutorials. This is helpful for building models piece-by-piece from a simple compartmental forward simulation, to including outcome probabilities, and finally, adding modifier sections. If multiple configuration files specify the same higher level configuration chunks (e.g., seir, outcomes), this will yield an error.

We are expanding coverage of this capability to other flepimop actions, e.g. inference, and are exploring options for smarter patching.
10 changes: 5 additions & 5 deletions documentation/gitbook/how-to-run/quick-start-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ To get started, let's start with just running a forward simulation (non-inferenc

### Non-inference run

Stay in the `PROJECT_PATH` folder, and run a simulation directly from forward-simulation Python package gempyor. Call `gempyor-simulate` providing the name of the configuration file you want to run. For example here, we use `config_sample_2pop.yml` from _flepimop\_sample_.
Stay in the `PROJECT_PATH` folder, and run a simulation directly from forward-simulation Python package gempyor. Call `flepimop simulate` providing the name of the configuration file you want to run. For example here, we use `config_sample_2pop.yml` from _flepimop\_sample_.

```
gempyor-simulate -c config_sample_2pop.yml
flepimop simulate config_sample_2pop.yml
```

This will produce a `model_output` folder, which you can look using provided post-processing functions and scripts.
Expand All @@ -189,14 +189,14 @@ cd $FLEPI_PATH
pip install --no-deps -e flepimop/gempyor_pkg/
cd $PROJECT_PATH
rm -rf model_output
gempyor-simulate -c config.yml
flepimop simulate config.yml
```

Note that you only have to re-run the installation steps once each time you update any of the files in the flepimop repository (either by pulling changes made by the developers and stored on Github, or by changing them yourself). If you're just running the same or different configuration file, just repeat the final steps

```
rm -rf model_output
gempyor-simulate -c new_config.yml
flepimop simulate new_config.yml
```

### Inference run
Expand Down Expand Up @@ -257,7 +257,7 @@ Rscript $FLEPI_PATH/flepimop/main_scripts/inference_main.R -c config_inference_n

## 📈 Examining model output

If your run is successful, you should see your output files in the model\_output folder. The structure of the files in this folder is described in the [Model Output](../gempyor/output-files.md) section. By default, all the output files are .parquet format (a compressed format which can be imported as dataframes using R's arrow package `arrow::read_parquet` or using the free desktop application [Tad ](https://www.tadviewer.com/)for quick viewing). However, you can add the option `--write-csv` to the end of the commands to run the code (e.g., `> gempyor-simulate -c config.yml --write-csv)` to have everything saved as .csv files instead ;
If your run is successful, you should see your output files in the model\_output folder. The structure of the files in this folder is described in the [Model Output](../gempyor/output-files.md) section. By default, all the output files are .parquet format (a compressed format which can be imported as dataframes using R's arrow package `arrow::read_parquet` or using the free desktop application [Tad ](https://www.tadviewer.com/) for quick viewing). However, you can add the option `--write-csv` to the end of the commands to run the code (e.g., `flepimop simulate --write-csv config.yml`) to have everything saved as .csv files instead ;

## 🪜 Next steps

Expand Down
Loading
Loading