Pymob

Latest version: v0.5.5

Safety actively analyzes 723177 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

0.5.0

The release introduces various new features and redesigns to improve the functionality of `pymob`. The package now supports to specify hierarchical models with the config backend and to estimate parameters with numpyro.

Currently the package mainly focuses on numpyro, which at this time implements the widest functionality. In future versions, feature support for additional inference engines will be expanded

Currently supported algorithms and planned features

| Backend | Supported Algorithms | Inference | Hierarchical Models |
| :--- | --- | --- | --- |
| `numpyro` | Markov Chain Monte Carlo (MCMC), Stochastic Variational Inference (SVI) | ✅ | ✅ |
| `pymoo` | (Global) Multi-objective optimization | ✅ | plan |
| `pyabc` | Approximate Bayes | ✅ | plan |
| `scipy` | Local optimization (`minimize`) | dev | plan |
| `pymc` | MCMC | plan | plan |
| `sbi` | Simulation Based Inference (in planning) | hold | hold |
| `interactive ` | interactive backend in jupyter notebookswith parameter sliders | ✅ | plan |


Breaking changes

- Case study import from package. The previous architecture of case studies was clumsy and had frustrating behavior under various usage scenarios. In release 0.5.0 the design decision was made to require case studies to be installed as editable installs with `pip install -e CASE_STUDY`. This permanently adds the paths to the modules of the case study to the PYTHONPATH and thus makes use of the case studies possible from anywhere and get rid of annoying warnings. In addition, this choice will make case studies interoperable, meaning that Simulations of case studies can now easily be used to serve as parent classes for other case studies. While the previous methods of importing case studies (dynamic updating of sys.path to resolve the paths to the modules) continue to be supported in this version, support will be dropped in future versions.
- API Change: Evaluator dispatch, Feature: allow variable dimensional x_in and y0 by flo-schu in https://github.com/flo-schu/pymob/pull/78

New features

Implement infrastructure and tools for hierarchical modeling in PR https://github.com/flo-schu/pymob/pull/82 by flo-schu

- Implement loglikelihood and gradient checkers for numpyro by flo-schu in https://github.com/flo-schu/pymob/pull/75
- Rigorous dimensional tests in the Evaluator and `diffrax` Solver to make sure dimensions are correctly specified before evaluating a model
- Default posterior predictive checks in numpyro
- Default prior and posterior predictive checks in numpyro
- Likelihood landscapes. Works currently only for 2-D parameters
- Specification of priors with indexing variables to formulate hierarchical models
- implement experimental scipy backend for simple model fitting (Work in progress, sampling from priors is possible, inference not yet implemented)
- Support for truncated distributions in numpyro with the `low` and `high` keywords `alpha = value=0.5 min=0.1 max=5.0 prior=lognorm(s=0.1,scale=0.50,high=5) free=True`. In the future this will be developed to integrate with bounds specification (min/max) by flo-schu in https://github.com/flo-schu/pymob/pull/110

Reporting: Pymob now supports automatized report generation and reporting of parameter estimates 123 by flo-schu

Further reports will be added in future releases, e.g.:
+ NRMSE
+ BIC, AIC
+ Model discrepancy/inadequacy measures

By default, `pymob-infer` creates a report which is configurable via the `config.report` section. It can also be created in a script, with `from pymob.sim.report import Report; report = Report(config=sim.config)`. Then, a number of reports are possible, which write to a file in the `config.case_study.output_path` and return the path of the file.

Major documentation update! 122 by flo-schu

- Improved quickstart guide
- Added information about package structure and inference capabilities
![image](https://github.com/user-attachments/assets/b8ec9eeb-6537-4c30-8392-e239db1fb460)
- Preparation for doctesting (will be automated in 0.5.1)
- Outsourced case study testing to case studies
- Added examples from case studies as executed jupyter notebooks, to ensure integration of pymob with case studies
- Parameterized testing: Pymob now starts to exploit `pytest` parameterization and fixtures to test the package with a wide selection and combination of configuration options. This will be expanded in future releases

Details and Bug Fixes

- Resolved various linting errors and improved test reliability by fixing package handling errors and refining error messages in multiple functions
- Fixed bugs in prediction utilities and handling parameters in solvers, ensuring that all edge cases, like empty likelihood dictionaries, are addressed.
- Add commandline interface for modifying config files by flo-schu in https://github.com/flo-schu/pymob/pull/107
- Add index to posterior by flo-schu in https://github.com/flo-schu/pymob/pull/106
- fix multichain numpyro idata bug by flo-schu in https://github.com/flo-schu/pymob/pull/111
- Implement an experimental symbolic solver class for solving simple ODE models analytically and providing the solution as latex and python code by flo-schu in https://github.com/flo-schu/pymob/pull/81

New case studies

Since this version, case studies are published as regular Python packages. This means case studies subclass `pymob.SimulationBase` and override methods or provide their own methods to extend pymob for use-case specific requirements. As a growing suite of self documented examples, the case studies are openly made available and will be (in very near future) also tested as part of a larger integration testing to ensure that newly implemented pymob features are also weather-proof with respect to more complex simulation and estimation tasks and don't break existing case-studies.

- TKTD RNA Pulse: https://github.com/flo-schu/tktd_rna_pulse, a TKTD model that integrates nrf2 expression data to approximate damage after exposure to chemicals and before death.
- Lotka-Volterra Case study: https://github.com/flo-schu/lotka_volterra_case_study, the classic example of population dynamics. This example serves as the test case for many pymob tests and is also a simple example into modelling with pymob

Full Changelog

https://github.com/flo-schu/pymob/compare/0.4.1...0.5.0

0.4.0

A simple useage example can be found in the documentation: https://pymob.readthedocs.io/en/latest/user_guide/quickstart.html

Details
* Merge dev into main from release 0.3.0 by flo-schu in https://github.com/flo-schu/pymob/pull/53
* Deploy documentation by flo-schu in https://github.com/flo-schu/pymob/pull/54
* Add a convenience method to traverse to the case studies directory fr… by flo-schu in https://github.com/flo-schu/pymob/pull/57
* Add parameter anaylsis to pymob by flo-schu in https://github.com/flo-schu/pymob/pull/58
* Implements pydantic for parsing and writing configuration files by flo-schu in https://github.com/flo-schu/pymob/pull/3
* write tests for the api by flo-schu in https://github.com/flo-schu/pymob/pull/62
* Add additional fixtures for different Simulation setup APIs by flo-schu in https://github.com/flo-schu/pymob/pull/63
* Implement a minimal simulation test by flo-schu in https://github.com/flo-schu/pymob/pull/66
* Implement scripting API for bufferGUTS by flo-schu in https://github.com/flo-schu/pymob/pull/67
* implement more flexible control over data dimensionality by flo-schu in https://github.com/flo-schu/pymob/pull/73


**Full Changelog**: https://github.com/flo-schu/pymob/compare/0.3.5...0.4.0

0.3.5

New features

* Implements parameter analysis methods developed in the reversible-damage project 58
* Minor fixes to case-study import functionality 58

Bugfixes

* Correct directory structure in documentation 58

**Full Changelog**: https://github.com/flo-schu/pymob/compare/0.3.4...0.3.5

0.3.4

New features

* implemens a convenience function to traverse the directory tree upwards until the case studies directory is encountered 57
* Updates workflow versions to avoid deprecation errors in the future 57


**Full Changelog**: https://github.com/flo-schu/pymob/compare/0.3.3...0.3.4

0.3.3

0.3.0

This is the first proper release of pymob. While it is still bumpy and the API will undergo breaking changes. It provides a package that is tested and documented in parts.

Merged pull requests:

* Conclude reversible damage project by flo-schu in https://github.com/flo-schu/pymob/pull/25

New Features

- **Simulation API Enhancements**
- Added `create_interpolation` method for datasets (commit hash: ade1bae)
- Introduced `load_functions` method to `SimulationBase` (commit hash: a087bec)
- Implemented `posterior_analysis` tools (commit hash: c89d2d6)
- Added `posterior_predictions` method for automatic generation of posterior predictions (commit hash: 571eeab)

- **Parameter Inference and Optimization**
- Implemented stochastic variational inference (SVI) for parameter estimation (commit hash: 6fc5e2b)
- Enabled bic to handle different posteriors (commit hash: e879221)
- Implemented log-likelihood computation from the probability model (commit hash: 90fec70)
- Added support for parallelization in posterior predictions (commit hash: 5db5788)

- **PyABC Integration**
- Improved compatibility with PyABC for test case studies (commit hash: be70fae)

Enhancements

- **Documentation**
- Expanded narrative documentation (commit hash: 12e158a)
- Enhanced case study documentation (commit hash: e7aab55)

- **Performance Improvements**
- Optimized chain concatenation for speed improvement (commit hash: fea8ec5)

Bug Fixes

- **General**
- Fixed various indexing bugs (commit hashes: 41fa4b2, a4cde74, 87f5822, 8f299de)
- Resolved import errors (commit hashes: 33aedaf, 8f1c195, 4cfed81)

- **Numpyro Backend**
- Fixed config bug (commit hash: e1fca53)
- Stabilized SVI with the `stable_update` option (commit hash: 8addd63)
- Fixed 2 indexing bugs (commit hash: b58d83e)
- Corrected error in prior specification (commit hash: 556bb73)

Miscellaneous

- **Testing and Quality Assurance**
- All tests are passing (commit hash: 139554d)
- Added new test scenarios (commit hashes: 69b4126, 7bfe7ca)
- Improved test coverage for various functionalities (commit hashes: c996dec, 5aa9f15, 92c2c7e)

- **Dependencies**
- Updated dependencies (commit hashes: 411831d, d15d766, 4941f2b)


**Full Changelog**: https://github.com/flo-schu/pymob/compare/0.3.0a5...0.3.0

Page 1 of 2

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.