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

Dynamical System Multilevel Model Notebook #351

Open
wants to merge 73 commits into
base: master
Choose a base branch
from

Conversation

SamWitty
Copy link
Collaborator

No description provided.

agrawalraj and others added 30 commits June 20, 2023 14:52
* initial notebook

* initial scaffolding

* initial ODE implementation

* more progress

* untested first pass at point intervention

* first successful interruption pass

* point intervention working

* first pass of observation handler

* modified CI

* adds tests for noop interventions and interruptions, failing, fixes issue where remaining tspan was expected for unsplit tspans.

* converts sir model to reusable fixture, adds todo test for affective point intervention.

* adds test of affective single and nested point interventinos.

* reduces permutations of a point intervention test.

* added stop which seems to help...

* recomplicates nested point intervention test parameters to cover additional case.

* pseudocode refac to non-recursive approach

* adds almost correct non-recursive point interruption thing that hopefully makes dynamic interventions easier to implement, raj todo some things.

* untested code implementing slicing and concat

* fixed some typos still not tested

* finishes refactor from recursive approach and passes some tests

* passes current suite of point interruption tests.

* adds errors and tests to confirm they throw, one is broken still.

* fixed tests

* fixed observation, no tests yet

* python3.8 type test error fix? Can't reproduce locally so sort of shooting in the dark

* added basic observation structure

* observation desired interface

* addded observation functionality with sample

* added intervention to example

* some progress on dynamic events, but will refactor to abstract out a simulate_to_next_event effectful operation that keeps all the torchdiffeq idiosyncrasies in one place.

* sketches out signatures and a plan (in comments) to refactor interruptions to better support dynamic events and the abstracting away of solver idiosyncrasies

* tests for point observations

* added tiny epsilon to observation interruption

* added error checking for time being equal to any element in full timespan just in case

* lint

* restructures intervention handling to better abstract solver idiosyncrasies away, preps to implement abstracted torchdiffeq solving.

* passes existing tests of point interruptions, preps for torchdiffeq implementation supporting dynamic interruptions.

* adds test case to single static intervention ensuring intervention only changes values after its time.

* refactors utilities for constructing torchdiffeq event functions.

* breaks out todos for double pass solver execution for dynamic event handling.

* finishes double solver pass using event function, passes current test suite.

* gets dynamic interventions working (at least for a single runtime test case + manual output check)

* initial notebook

* added synthetic data simulation section

* makes first dynamic intervention test actually test something

* runs linter

* bit hacky way to perform inference but recovers true sir params

* puts intervention blocking functionality in the SEL loop, rather than leaving it up to interventions themselves.

* added some inference evaluation but need more metrics

* switching to manual generation of predictions on observation sites

* cleaned up notebook and finished initial evaluation for just demonstrating conditioning functionality

* moved tutorial to docs folder

* issue with intervention tests not passing

* refactors PointObservation to work with SEL refactor.

* includes interventions

* poisson likelihood breaking for some reason

* fixed poisson likelihood issue

* test with exit stack works too...

* changed observation method to be the same as the test that somehow passes

* failing test that reproduces notebook error

* reverting noteback back to old version now that we understand why test is breaking

* added dynamic intervention to example

* adds test of nested dynamic interventions, and noop dynamic interruptions.

* added some todos and fixed some typos

* modifies svi integration test to avoid issue arising when observation occurs at start of tspan, adds test asserting that an error is explicitly thrown for that case.

* runs linter

* gets linter mostly happy.

* fixes idiosyncratic mypy issues, including meh breakout of dispatchable getitem for trajectory.

* quick mypy fix

* flake8 changes

* added import statement to make notebook work

* reran lint

* removed scratch notebook

---------

Co-authored-by: Sam Witty <[email protected]>
Co-authored-by: Andy Zane <[email protected]>
Co-authored-by: Raj Agrawal <[email protected]>
Co-authored-by: Andy Zane <[email protected]>
* Add top-level subpackage imports in indexed and interventional modules (#169)

* move cf handlers out of init

* add imports

* Replaces [@ref] Linked References w/ Manual Ref and Bib (#171)

* replaces linked refs with manual refs for now due to only highly complex and error prone alternatives available for automation

* adds sphinx bibtex to setup for tests

* Add broadcasting test cases (#168)

* Update code in deep SCM notebook (#134)

* start

* update code

* refs merge

* fix json

* grammatical fixes, re-applying these changes as the original branch got conflated with something in stash

* add plot description

* adds link to referenced pyro tutorial

---------

Co-authored-by: Andy Zane <[email protected]>

* Update text and code of CEVAE notebook (#131)

* notebook and fixes

* notebook works

* temp commit that gives mae=.02 when removing no grad line when generating data

* seems to work, verbose loss output

* removed loss outputs and fixed some small typos

---------

Co-authored-by: Raj Agrawal <[email protected]>

* Added CONTRIBUTING.md file (#172)

* initial pass that makes small modifications to CONTRIBUTING.md file in pyro

* calls lint script instead

* fixed to call clean.sh script

* replaced with clean script

---------

Co-authored-by: Raj Agrawal <[email protected]>

* Create publish_docs.yml (#180)

* removed old files (#184)

Co-authored-by: Raj Agrawal <[email protected]>

* Added docstring for intervene following issue #113 (#182)

* added docstring for intervene following issue #113

* removed extra spacing

* adds docstring for DoMessenger

* removes generic type hint on _intervene_atom so that intervene signatures properly show up in docs.

---------

Co-authored-by: Raj Agrawal <[email protected]>
Co-authored-by: Andy Zane <[email protected]>

* Add a draft logo to replace placeholder (#185)

* add a draft logo to replace placeholder

* add svg

* Update text and code of mediation analysis notebook (#132)

* notebook and fixes

* notebook works

* update notebook

* working

* revert cevae to master in this branch

* pull in changes

* fix typo

* adds (live, see comment) link to backdoor example, replacing inline TODO

* properly uses relative link for backdoor notebook.

---------

Co-authored-by: Andy Zane <[email protected]>

* Causal Pyro README (#170)

* copied and pasted index.rst and auto converted to markdown

* reformatted, added table to tutorials and examples, still need to add cites

* fixed small spacing typos

* added status badge

* points readme documentation links to live docs.

* making the readme an rst that matches landing page

* converted tutorial links

* converted back to table format for links

* table still messed up

* gave up on tables, now a bulleted list for examples

* added documentation section

* small changes

* added back missing bullets

* fixed to queried_model

* review with Sam for cleaning up readme over a call

* fixed typo

* small edit

---------

Co-authored-by: Raj Agrawal <[email protected]>
Co-authored-by: Andy Zane <[email protected]>

* links github rendered readme as getting started page of sphinx docs. (#191)

* Fix HTML Outline rendering (#188)

* fixed outline rendering

* fixes outline links in mediation notebook.

* fixes outline and links for backdoor notebook.

* fixes outline links in cevae notebook.

* fixes slc notebook outline links.

* adds outline back into deep scm notebook.

* address remaining reference issues, building now with now warnings

---------

Co-authored-by: Andy Zane <[email protected]>

* Design Notes Concat (#174)

* first pass at stitching design notes together into cohesive contributor tutorial.

* cleans up local bibs, adds omega citation.

* updates mention of omega and predicate conditioning

* re-integrates the original point being made at the top of observations.rst

* renames things to be less redundant

* Change name of package throughout codebase (#192)

* code and tests

* scripts

* remove

* code misses

* docs

* Causal Pyro

* causal pyro

* lint

* Create GitHub Actions workflow for PyPI (#181)

* Update setup.py arguments (#193)

* Update setup.py args

* classifier

* Update publish_docs.yml

* trigger docs deployment

* configure docs

* Add requirements.txt for docs workflow (#194)

* pandoc

* Add observe operation and new condition handler (#175)

* Separate observe and condition

* Split up files and create observational handlers folder

* imports

* lint

* rename test

* add test about commutativity of do and condition

* doc

* union

* fix particle test case

* fix bug

* chirho

* Add path to conf.py for docs workflow (#195)

* Refactor counterfactuals to use observe and condition (#176)

* Separate observe and condition

* Split up files and create observational handlers folder

* imports

* lint

* rename test

* add test about commutativity of do and condition

* doc

* union

* Refactor counterfactuals to use observe

* appease mypy

* Vindex fixes particle errors

* update backdoor

* update slc

* fix particle test case

* add cf commutativity test

* fix bug

* revert slc handler order

* add predictive smoke test

* nit

* elbo

* reorder test

* Add a stronger infer_discrete test

* move notebooks to separate branch

* test

* chirho

* merge fail

* Update and re-run example notebooks with new condition (#178)

* Update and re-run backdoor and SLC notebooks

* deepscm

* cevae

* import

* mediation

* merge

* update notebooks

* merge

* merge 2

* toc

* populate autodoc

* tweak

* Restores (via cherry-pick) Notebook Link and Formatting Changes (#205)

* fixed outline rendering

* fixes outline links in mediation notebook.

* fixes outline and links for backdoor notebook.

* fixes outline links in cevae notebook.

* fixes slc notebook outline links.

* adds outline back into deep scm notebook.

* address remaining reference issues, building now with now warnings

---------

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

---------

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

* Fixed symbolic link in tutorial (#206)

* fixed symbolic link in tutorial

* Revert changes to figure paths

* Reverted accidental newline from previous commit

* Fix image duplication in intro tutorial (#209)

* Fix image duplication

* fix the one other warning in the docs build

* Bump version to 0.1.0-alpha (#208)

* Bump prerelease version to 0.1.0-alpha

* Comply with pep440

* update paths

* imports

* notebook

* condition

* lint

---------

Co-authored-by: Andy Zane <[email protected]>
Co-authored-by: Andy Zane <[email protected]>
Co-authored-by: Raj Agrawal <[email protected]>
Co-authored-by: Raj Agrawal <[email protected]>
Co-authored-by: Sam Witty <[email protected]>
* Add top-level subpackage imports in indexed and interventional modules (#169)

* move cf handlers out of init

* add imports

* Replaces [@ref] Linked References w/ Manual Ref and Bib (#171)

* replaces linked refs with manual refs for now due to only highly complex and error prone alternatives available for automation

* adds sphinx bibtex to setup for tests

* Add broadcasting test cases (#168)

* Update code in deep SCM notebook (#134)

* start

* update code

* refs merge

* fix json

* grammatical fixes, re-applying these changes as the original branch got conflated with something in stash

* add plot description

* adds link to referenced pyro tutorial

---------

Co-authored-by: Andy Zane <[email protected]>

* Update text and code of CEVAE notebook (#131)

* notebook and fixes

* notebook works

* temp commit that gives mae=.02 when removing no grad line when generating data

* seems to work, verbose loss output

* removed loss outputs and fixed some small typos

---------

Co-authored-by: Raj Agrawal <[email protected]>

* Added CONTRIBUTING.md file (#172)

* initial pass that makes small modifications to CONTRIBUTING.md file in pyro

* calls lint script instead

* fixed to call clean.sh script

* replaced with clean script

---------

Co-authored-by: Raj Agrawal <[email protected]>

* Create publish_docs.yml (#180)

* removed old files (#184)

Co-authored-by: Raj Agrawal <[email protected]>

* Added docstring for intervene following issue #113 (#182)

* added docstring for intervene following issue #113

* removed extra spacing

* adds docstring for DoMessenger

* removes generic type hint on _intervene_atom so that intervene signatures properly show up in docs.

---------

Co-authored-by: Raj Agrawal <[email protected]>
Co-authored-by: Andy Zane <[email protected]>

* Add a draft logo to replace placeholder (#185)

* add a draft logo to replace placeholder

* add svg

* Update text and code of mediation analysis notebook (#132)

* notebook and fixes

* notebook works

* update notebook

* working

* revert cevae to master in this branch

* pull in changes

* fix typo

* adds (live, see comment) link to backdoor example, replacing inline TODO

* properly uses relative link for backdoor notebook.

---------

Co-authored-by: Andy Zane <[email protected]>

* Causal Pyro README (#170)

* copied and pasted index.rst and auto converted to markdown

* reformatted, added table to tutorials and examples, still need to add cites

* fixed small spacing typos

* added status badge

* points readme documentation links to live docs.

* making the readme an rst that matches landing page

* converted tutorial links

* converted back to table format for links

* table still messed up

* gave up on tables, now a bulleted list for examples

* added documentation section

* small changes

* added back missing bullets

* fixed to queried_model

* review with Sam for cleaning up readme over a call

* fixed typo

* small edit

---------

Co-authored-by: Raj Agrawal <[email protected]>
Co-authored-by: Andy Zane <[email protected]>

* links github rendered readme as getting started page of sphinx docs. (#191)

* Fix HTML Outline rendering (#188)

* fixed outline rendering

* fixes outline links in mediation notebook.

* fixes outline and links for backdoor notebook.

* fixes outline links in cevae notebook.

* fixes slc notebook outline links.

* adds outline back into deep scm notebook.

* address remaining reference issues, building now with now warnings

---------

Co-authored-by: Andy Zane <[email protected]>

* Design Notes Concat (#174)

* first pass at stitching design notes together into cohesive contributor tutorial.

* cleans up local bibs, adds omega citation.

* updates mention of omega and predicate conditioning

* re-integrates the original point being made at the top of observations.rst

* renames things to be less redundant

* Change name of package throughout codebase (#192)

* code and tests

* scripts

* remove

* code misses

* docs

* Causal Pyro

* causal pyro

* lint

* Create GitHub Actions workflow for PyPI (#181)

* Update setup.py arguments (#193)

* Update setup.py args

* classifier

* Update publish_docs.yml

* trigger docs deployment

* configure docs

* Add requirements.txt for docs workflow (#194)

* pandoc

* Add observe operation and new condition handler (#175)

* Separate observe and condition

* Split up files and create observational handlers folder

* imports

* lint

* rename test

* add test about commutativity of do and condition

* doc

* union

* fix particle test case

* fix bug

* chirho

* Add path to conf.py for docs workflow (#195)

* Refactor counterfactuals to use observe and condition (#176)

* Separate observe and condition

* Split up files and create observational handlers folder

* imports

* lint

* rename test

* add test about commutativity of do and condition

* doc

* union

* Refactor counterfactuals to use observe

* appease mypy

* Vindex fixes particle errors

* update backdoor

* update slc

* fix particle test case

* add cf commutativity test

* fix bug

* revert slc handler order

* add predictive smoke test

* nit

* elbo

* reorder test

* Add a stronger infer_discrete test

* move notebooks to separate branch

* test

* chirho

* merge fail

* Update and re-run example notebooks with new condition (#178)

* Update and re-run backdoor and SLC notebooks

* deepscm

* cevae

* import

* mediation

* merge

* update notebooks

* merge

* merge 2

* toc

* populate autodoc

* tweak

* Restores (via cherry-pick) Notebook Link and Formatting Changes (#205)

* fixed outline rendering

* fixes outline links in mediation notebook.

* fixes outline and links for backdoor notebook.

* fixes outline links in cevae notebook.

* fixes slc notebook outline links.

* adds outline back into deep scm notebook.

* address remaining reference issues, building now with now warnings

---------

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

---------

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

* Fixed symbolic link in tutorial (#206)

* fixed symbolic link in tutorial

* Revert changes to figure paths

* Reverted accidental newline from previous commit

* Fix image duplication in intro tutorial (#209)

* Fix image duplication

* fix the one other warning in the docs build

* Bump version to 0.1.0-alpha (#208)

* Bump prerelease version to 0.1.0-alpha

* Comply with pep440

* update paths

* imports

* notebook

* condition

* support dynamical counterfactuals on scalar variables

* replace tensor with stack

* type

* lint

---------

Co-authored-by: Andy Zane <[email protected]>
Co-authored-by: Andy Zane <[email protected]>
Co-authored-by: Raj Agrawal <[email protected]>
Co-authored-by: Raj Agrawal <[email protected]>
Co-authored-by: Sam Witty <[email protected]>
* adds and tests a non-interrupting observation handler

* swaps out new handler in performance analysis of observation handler.

* recovering params when beta and gamma fixed across all regions

* adds batched handler for non interrupting observations, passes equivalency test of logprob and shape.

* inference working now, going to refactor and remove out covariates

* uncomitted changes

* adds auto broadcasting for the vectorized point observation.

* adds check to not call to_event on deterministic 'sample' operation

* working demo end-to-end

* finished pass

* finished demo

* added uncertainty over intervention assignments

* finished notebook run w/ new uncertain interventions

* undid some linting to make more readable

* lints

---------

Co-authored-by: Raj Agrawal <[email protected]>
Co-authored-by: Sam Witty <[email protected]>
* removes non vectorized interrupting point observation

* cleans up tests of NonInterruptingPointObservation

* removes redundant test now that non vectorized non interrupting observation handler is removed.

* changes order of point observation in equivalence test to make sure non issue.

* lints
* Fixes for PyroModule

* remove t

* add unit test
* removes non vectorized interrupting point observation

* cleans up tests of NonInterruptingPointObservation

* removes redundant test now that non vectorized non interrupting observation handler is removed.

* changes order of point observation in equivalence test to make sure non issue.

* lints

* adds file for handler composition tests.

* brokenish sketch of possible composition of counterfactual and dynamic point observation case.

* gets hacky poc for dynamical counterfactual query w post intervention noise working

* adds trajectory and state getitem support for broadcastable boolean masks, removes .to_event hack in vectorized non interrupting point observation, fails tests due to latter.

* modifies tests to reflect requirement of manual shape management

* adds shape and inference smoke test composing many dynamical handlers.

* lints

* adds comment explaining the handler blocking that induces the conditional model.
* fixes issue where gradients weren't propagating through dynamic interventions.

* lints
* removes non vectorized interrupting point observation

* cleans up tests of NonInterruptingPointObservation

* removes redundant test now that non vectorized non interrupting observation handler is removed.

* changes order of point observation in equivalence test to make sure non issue.

* lints

* adds file for handler composition tests.

* changed to condition only

* brokenish sketch of possible composition of counterfactual and dynamic point observation case.

* gets hacky poc for dynamical counterfactual query w post intervention noise working

* adding basic structure for counterfactual

* adds trajectory and state getitem support for broadcastable boolean masks, removes .to_event hack in vectorized non interrupting point observation, fails tests due to latter.

* counterfactual example seems to work, need to clean up notebook

* modifies tests to reflect requirement of manual shape management

* working cf demo

* different times for superspreader

* changed cf values

* adds shape and inference smoke test composing many dynamical handlers.

* lints

* adds comment explaining the handler blocking that induces the conditional model.

* adjusts counterfactual story to have partially shared noise between worlds based on a screening machine story, still needs updates to text and comments.

* gets initial conditions set correctly

* adds comment on cf guide

---------

Co-authored-by: Andy Zane <[email protected]>
Co-authored-by: Raj Agrawal <[email protected]>
* fixed test to reflect PyroModule changes

* lint
* Add an effect handler for inserting factor statements (#238)

* Add a Factors handler for inserting new factors

* docs and test

* lint

* Add a BiasedPreemptions handler (#239)

* Add BiasedPreemptions handler

* test and tiny refactoring

* updated copywrite (#254)

* pin sphinx version to 7.1.2 to fix docs building (#256)

* pin sphinx version to 7.1.2 fixes doc building locally

* remove pypandoc

* Update requirements.txt

* Update setup.py

* pin sphinx_rtd_theme==1.3.0 to fix docs deployment (#262)

* Fix inference in backdoor adjustment example (#258)

* Fix inference in backdoor adjustment example

* text and matching ci

* typo

* device

---------

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

* Fixed typo (#267)

* changed headers for examples to be consistent (#271)

* Make tutorial run end to end (#274)

* Eli's data type and condition fixes

* convert to floats and convert to ints when indexing

* clean up

---------

Co-authored-by: Raj Agrawal <[email protected]>

* Single-Cell RNA Seq Example (#265)

* data processing code

* model doesnt compile yet

* fixed dimensions but module naming issue

* before switching to interaction version of model

* presentation w/ alvin

* cleaned up summary stats section and focus on one drug

* before switching to multiworld for ate

* eli shape corrections

* uncomitted changes w/ eli re. shapes

* eli's fix of counterfactual

* clean up

* rewording

* change of notation and reran notebook

* removed old sentence

* fixed typo

* removed some masking and redundancy

* made dropout a function of confounders too

* Ra aq scrna (#263)

* Add an effect handler for inserting factor statements (#238)

* Add a Factors handler for inserting new factors

* docs and test

* lint

* Add a BiasedPreemptions handler (#239)

* Add BiasedPreemptions handler

* test and tiny refactoring

* updated copywrite (#254)

* pin sphinx version to 7.1.2 to fix docs building (#256)

* pin sphinx version to 7.1.2 fixes doc building locally

* remove pypandoc

* Update requirements.txt

* Update setup.py

* pin sphinx_rtd_theme==1.3.0 to fix docs deployment (#262)

* 1. add preprocessing method for expression normalization
2. test more HDAC drugs
3. reproduce raj results

* add pseudobulk comparison

* add T>0 for theta_drug; clean up notebook for one drug with high IC50

* change T>0 to T for theta_drug; did a bunch of experiments for library size, not improved yet

* use corrected gene expression for ate estimation

* replace the likelihood to Poisson; it seems working for HDACi

---------

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

* cleaned up notebook and fixed some bugs

* fixed some bugs and cleaned up references and some notation

* fixed drug typo and removed treatment mask

* query models, add latent factor per cell

* removed old file, did not finish running on all genes so moving to gcp

* cleaned up some more text

* target genes specified, kernel crashes on last fig

* fixed missing ref

* reducted num samples to fix memory issue

* fixed typo

* updated target genes w/ chip targets and fixed plotting bug

* added alvins descriptions + some rewriting

* fixed some typos

* added pca discussion

* forgot to save when committing

* fixed typo

---------

Co-authored-by: Raj Agrawal <[email protected]>
Co-authored-by: Alvin Qin <[email protected]>
Co-authored-by: eb8680 <[email protected]>
Co-authored-by: Sam Witty <[email protected]>

* Document counterfactual operations and handlers (#275)

* counterfactual ops docs

* typo

* minor edits

* lint

* more linting

* docs for BaseCounterfactualMessenger

* docs for SingleWorldCounterfactual

* a bit more detail about marginal distributions

* lint and minor edits

* added example usage for counterfactual handlers

* docs for multiworld counterfactual

* added pass of TwinWorldCounterfactual documentation

* Add RNAseq example to readme and docs (#277)

* Add RNAseq example to readme and docs

* fix header level

* Fix docstring propagation in counterfactual ops (#278)

* Fix docstring propagation in counterfactual ops

* lint

* Fix TOC link for single RNA seq example notebook (#280)

* fix toc link

* fixed toc and equation rendering issues

---------

Co-authored-by: Raj Agrawal <[email protected]>

* Bump version to 0.1.0 (#279)

* Adding undo_split and a test thereof (+small lint) (#264)

* added undo_split and a test thereof (+small lint)

* moved undo_split, added a test

* unlinting counterfactual

* unlinting ops

* parametrize test WIP

* parametrizing test WIP

* reverting linting on test_internals.p

* isort fix on test_internals.py

* parametrizing test WIP

* linting WIP

* tests linted

* cleanup

* removed implicit Optional

* isort/lint test_internals.py

* reverting test_internals to orginal

* black linted no -l 120, to prevent github check failure

* make lint, make format

* format

* fix multi-antecedent case and format

* remove obsolete comments

* appease flake8

* add to sphinx

---------

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

* Replace Preemptions handler implementation (#250)

* Replace Preemptions implementation with BiasedPreemption

* format

* remove nondeterministic default behavior for preempt

* address comments

* Ru consequent differs (#268)

* added undo_split and a test thereof (+small lint)

* moved undo_split, added a test

* unlinting counterfactual

* unlinting ops

* parametrize test WIP

* parametrizing test WIP

* reverting linting on test_internals.p

* isort fix on test_internals.py

* parametrizing test WIP

* linting WIP

* tests linted

* cleanup

* removed implicit Optional

* isort/lint test_internals.py

* setting up  consequent differs for pr

* reverting test_internals.py to original

* reverting test_internals to orginal

* consequent_differs WIP

* consequent differs WIP

* consequent differs WIP

* consequent_differs in explanation, docstring

* added consequent_differs and a test for it

* black linted no -l 120, to prevent github check failure

* lint

* make lint, make format

* make lint, make format

* format

* fix multi-antecedent case and format

* remove obsolete comments

* appease flake8

* add to sphinx

* fix event_dim>0 in tests

---------

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

---------

Co-authored-by: eb8680 <[email protected]>
Co-authored-by: Raj Agrawal <[email protected]>
Co-authored-by: Raj Agrawal <[email protected]>
Co-authored-by: Alvin Qin <[email protected]>
Co-authored-by: rfl-urbaniak <[email protected]>
Co-authored-by: Eli <[email protected]>
…modules (#286)

* factored out generic Dynamics class from ODEDynamics and moved torchdiffeq specific implementations out of ODEDynamics class

* update dynamics test imports

* moved non user-facing objects and operations to internals.py

* split out operations, handlers, and internals

* moved around ODE operations and handlers

* lint

* lint again
eb8680 and others added 23 commits October 11, 2023 16:26
…#311)

* Rename NonInterruptingPointObservationArray

* lint
* Rename Dynamics to InPlaceDynamics

* type

* remove unused type variable

* union

* remove dynamics for now
* consolidate backend interface in one file

* consolidate patterns

* rename indexed to _patterns

* rename to backend

* rename pattern

* rename pattern and lint

* import

* reorder file

* remove deleted file

* fix merge

* fix error

* lint

* dead code

* move append and rename _utils

* get_solver

* fix
* Remove trivial test cases

* nit

* expand
* refactor trajectory.__getitem__ to use gather

* Remove trivial test cases

* nit

* expand

* add back len

* save
* refactor trajectory.__getitem__ to use gather

* Remove trivial test cases

* nit

* expand

* add back len

* save

* move interruptions into one file

* fix imports

* rename dynamical to event_loop

* rename dynamictrace to logtrajectory

* fix import

* remove circular import

* typing nits

* rename solver modules

* add missing files

* add back check

* first ops renaming

* ops file

* revert changes to staticbatchobservation

* rename trace->trajectory

* comments

* rename test file
* Move State.var_order to internals

* utils

* Update _utils.py
…vation (#324)

* various fixes to logtrajectory

* nit

* post
* remove len

* fix merge

---------

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

* remove trajectory getitem

* remove getitem method

* fix almost all tests

* lint

* fix remaining tests
* remove len

* remove trajectory getitem

* remove getitem method

* fix almost all tests

* lint

* fix remaining tests

* remove Trajectory.to_state

---------

Co-authored-by: Sam Witty <[email protected]>
* Separate Observable and Dynamics

* trajectory

* remove inplacedynamics
* remove len

* remove trajectory getitem

* remove getitem method

* fix almost all tests

* lint

* fix remaining tests

* remove Trajectory.to_state

* delete trajectory type

* remove typevar

* address comments

* fix merge error

---------

Co-authored-by: Sam Witty <[email protected]>
* Move keys property of state into a function

* Fix merge

---------

Co-authored-by: Sam Witty <[email protected]>
* Remove stale skipped tests

* lint
* Add dynamical sphinx config

* add notebook to index and fix rendering and indentation errors
* change observation interface and fix tests

* restore stale test for merge

* lint and restore test for merge

* Update _utils.py
* change observation interface and fix tests

* restore stale test for merge

* lint and restore test for merge

* Switch to functional interface for dynamical systems models

---------

Co-authored-by: Sam Witty <[email protected]>
@SamWitty SamWitty added status:WIP Work-in-progress not yet ready for review module:dynamical labels Oct 18, 2023
@SamWitty SamWitty self-assigned this Oct 18, 2023
@SamWitty SamWitty changed the base branch from master to staging-dynamic October 18, 2023 19:44
@SamWitty SamWitty changed the base branch from staging-dynamic to master October 18, 2023 20:03
@eb8680 eb8680 added this to the ASKEM November 2023 hackathon milestone Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module:dynamical status:WIP Work-in-progress not yet ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants