Skip to content

Commit

Permalink
Refactor PyCIEMSS to use ChiRho and remove stale functionality (#396)
Browse files Browse the repository at this point in the history
* remove all files except interfaces and integration demo

* remove tests

* minor refactor of dependencies and added lint

* added back in github workflows

* add quote around 3.10

* added makefile for offline lint testing

* ran make format

* removed Ensemble

* added types for interfaces, and deleted ODE implementations

* lint

* fixed makefile for tests

* get test_modules_import working

* lint

* remove src from directory

* remove stale notebooks

* remove src from lint scripts

* modify setup.cfg

* added pytest cov

* remove .gitignore in notebook

* remove stale INSTALL.md

* remove pytest-cov

* rename test to tests

* update scripts with new tests filepath

* fix Makefile to point to correct tests

* AMR and MIRA integration with Chirho (#398)

* added scaffolding for ODE

* tidying and linting

* get modules importing and update mira

* got initial state working

* revise tests and lint

* manually added torchdiffeq to requirements

* revert debugging

* remove empty interfaces

* minor refactor

* minor refactor

* moved compile_deriv and compile_initial_state into init method for other factory methods to have access to. also removed eval_rate_law, because that might be confusing if users change it and it does nothing

* typo

* `simulate` TA4 interface (#399)

* progress towards TA4 interfaces

* minor tidying, still incomplete

* more tidying

* remove attempt at pickling, and added intervention test

* dynamic intervention tests working

* got predictive working

* added additional test

* update types

* update types

* fix upstream time collisions in ChiRho (#400)

* rename simulate to sample

* add pyciemss_logging_wrapper and documentation

* revise tests

* remove placeholder parameters (#403)

* Support for regulatory networks (#404)

* add support for regnet now that mira has been fixed

* lint

* uncomment other mistakenly commented tests

* swap out dict access for explicit iteration

* lint

* Remove package finding AND add to module exports (#407)

* Remove package finding AND add to module exports

* Clear out top-level `__init__.py`

* Reinclude explicit exports

* Include subpackages

* Skip incorrect lint error

* reorder imports for lint

* revert previous commit and add missing space before noqa

---------

Co-authored-by: Sam Witty <[email protected]>

* Add basic output formatting (#405)

* initial pass at output processing

* lint

* add pandas and numpy dependencies

* remove outdated docstring

* Remove package finding AND add to module exports (#407) (#409)

* Remove package finding AND add to module exports

* Clear out top-level `__init__.py`

* Reinclude explicit exports

* Include subpackages

* Skip incorrect lint error

* reorder imports for lint

* revert previous commit and add missing space before noqa

---------

Co-authored-by: Five Grant <[email protected]>

---------

Co-authored-by: Five Grant <[email protected]>

* `calibrate` TA4 interface (#401)

* progress towards TA4 interfaces

* minor tidying, still incomplete

* more tidying

* remove attempt at pickling, and added intervention test

* dynamic intervention tests working

* got predictive working

* added additional test

* update types

* update types

* fix upstream time collisions in ChiRho (#400)

* early progress on calibration

* added noise model

* minor change to sampling interface

* more progress

* lint

* lint

* more merge fixes

* add back petri models

* temporary test fixtures while waiting on PRs to land

* make

* update tests and lint

* lint

* got calibrate working

* move start_time to kwarg

* added test of simulating from deterministic parameters

* lint

* add documentation

* update fixtures to include permalink to models

* remove aggregate parameters

* Basic functionality for sampling from an ensemble of dynamical systems models (#411)

* first pass at ensemble

* revision to tests

* added ensemble sampling interface and tests

* lint nit

* register nit

* added documentation?

* line length

* lint

* Update test fixtures to include new gold-standard AMRs (#415)

* scaled noise according to size of state variable

* update AMRs

* add back regnet and stockflow

* trivial change to trigger CI build

* Add basic integration notebook and CI for testing notebooks (#416)

* add basic notebook and nbval test

* nbval CI

* make ensemble a module

* changed imports in CI builds and added imports throughout

* reran interfaces

* lint

* Add observables to sample output (#412)

* first pass at observables

* lint

* fix result processing

* add correction with empty observables

* minor fix to name

* nitpick on name

* retrigger checks

* updating urls for petri and stock flow example amrs (#419)

* updating urls for petri and stock flow example amrs

* Shortening url lengths to address linting issue

* Fixing urls for linting issue

* Changing AMR url in interfaces notebook

* Updating model_2_path to correct url

* Bump ChiRho version in dependencies and update any changes resulting from API changes (#422)

* bumped chirho version

* pull out solver

* removed IEL and pulled out solver

* revised tests

* reverted fixtures chagne

* lint

* nit

* updated compiled dynamics

* updated tests

* lint

* nit

* revert changes to fixtures

* updating urls for petri and stock flow example amrs (#419) (#423)

* updating urls for petri and stock flow example amrs

* Shortening url lengths to address linting issue

* Fixing urls for linting issue

* Changing AMR url in interfaces notebook

* Updating model_2_path to correct url

Co-authored-by: sabinala <[email protected]>

* reverted changes to types

* lint

---------

Co-authored-by: sabinala <[email protected]>

* scale back tests (#427)

* Parameter Intervention (#424)

* added separate persistent params to make bookkeeping interventions more reliable

* implemented parameter intervention

* added tests with annotation of important paramaters

* lint

* added dynamic interventions on parameters (#425)

* lint and doc

* Add interfaces and refactor tests (#426)

* added interfaces and refactored interruptions

* refactor and add to tests

* scale back tests (#427)

* easier tests

* Adding regnet urls to fixtures, and limiting number of examples to three per type (#428)

* Update fixtures.py to include regnets and three examples per type

* Update fixtures.py

* lint

---------

Co-authored-by: Sam Witty <[email protected]>

* Add parameter interventions to calibrate and refactor interface tests (#429)

* Added parameter interventions to calibrate

* refactored calibrate tests

* refactor observables

* fix bug in test

* ignore test with underflow

* made interventions a bit lighter

* Add datafile input for `calibrate` (#432)

* add data loading utilities

* added data loading utilities to calibrate interface

* updated tests with new data loading utilities

* lint

* bump pyciemss version (#433)

* bump pyciemss version

* remove stale setup config

---------

Co-authored-by: Five Grant <[email protected]>
Co-authored-by: sabinala <[email protected]>
  • Loading branch information
3 people authored Dec 18, 2023
1 parent 1c37f55 commit 4ca1d6a
Show file tree
Hide file tree
Showing 352 changed files with 2,833 additions and 2,452,036 deletions.
File renamed without changes.
38 changes: 38 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Lint

on:
push:
branches: [ main, staging-refactor ]
pull_request:
branches: [ main, staging-refactor ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]

steps:
- uses: actions/checkout@v2

- name: pip cache
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: lint-pip-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
lint-pip-
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[tests]
- name: Lint
run: ./scripts/lint.sh
40 changes: 0 additions & 40 deletions .github/workflows/python-package.yml

This file was deleted.

53 changes: 53 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Test

on:
push:
branches: [ main, staging-refactor ]
pull_request:
branches: [ main, staging-refactor ]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9, '3.10']
os: [ubuntu-latest] # , macos-latest]

steps:
- uses: actions/checkout@v2
- name: Ubuntu cache
uses: actions/cache@v1
if: startsWith(matrix.os, 'ubuntu')
with:
path: ~/.cache/pip
key:
${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.python-version }}-
- name: macOS cache
uses: actions/cache@v1
if: startsWith(matrix.os, 'macOS')
with:
path: ~/Library/Caches/pip
key:
${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.python-version }}-
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[tests]
- name: Test
shell: bash
run: |
pytest tests/ -s -n auto
40 changes: 40 additions & 0 deletions .github/workflows/test_notebooks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Test notebooks

on:
schedule:
- cron: '0 0 * * 6' # Run at midnight on Saturdays
push:
branches: [ main, staging-refactor ]
pull_request:
branches: [ main, staging-refactor ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]

steps:
- uses: actions/checkout@v2

- name: pip cache
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: lint-pip-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
lint-pip-
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[tests]
- name: Run Notebook Test
run: python -m pytest --nbval-lax docs/source/interfaces.ipynb
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -339,3 +339,4 @@ venv/
*~
*_schema.json
*data_with_missing_entries.csv
*.nix
17 changes: 0 additions & 17 deletions INSTALL.md

This file was deleted.

10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
lint: FORCE
./scripts/lint.sh

format:
./scripts/clean.sh

tests: lint FORCE
pytest -v tests -n auto

FORCE:
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
exclude_patterns = []

extensions += ['sphinx.ext.autodoc', 'autoapi.extension']
autoapi_dirs = ['../../src']
autoapi_dirs = ['../../pyciemss']


# -- Options for HTML output -------------------------------------------------
Expand Down
Loading

0 comments on commit 4ca1d6a

Please sign in to comment.