Skip to main content

Calibration tool for IDM-Tools

Project description

emodpy

Build docs and deploy to GH Pages Lint Build and publish package to Pypi Tests

idmtools-calibra

Table of Contents

User Installation

pip install idmtools-calibra 

Pre-requisites

  • Python 3.10, 3.11, 3.12, 3.13, 31.4 x64

Development Environment Setup

When setting up your environment for the first time, you can use the following instructions

First Time Setup

  1. Clone the repository:
    > git clone https://github.com/InstituteforDiseaseModeling/idmtools_calibra.git
    
  2. Create a virtualenv. On Windows, please use venv to create the environment python -m venv idmtools_calibra On Unix(Mac/Linux) you can use venv or virtualenv
  3. Activate the virtualenv
  4. Then run python ./.dev_scripts/bootstrap.py. This will install all the tools.

Development Tips

There is a Makefile file available for most common development tasks. Here is a list of commands

clean       -   Clean up temproary files
lint        -   Lint package and tests
test        -   Run All tests
docs        -   Build mkdocs documentation
bump-patch  -   Bump patch version
bump-minor  -   Bump minor version
bump-major  -   Bump major version

Documentation

Documentation available at https://institutefordiseasemodeling.github.io/idmtools-calibra/.

Build mkdocs locally

Create and activate a venv. Navigate to the root directory of the repo.

cd docs
pip install -r requirments.txt
mkdocs build  # build docs
mkdocs serve  # view docs from  http://127.0.0.1:8000/idmtools_calibra/
mkdocs gh-deploy # deploy to github (need to be on the specific branch)

Build and publish document from Github Actions

Go to Github Actions -> Run GHA job: Deploy MkDocs via GitHub Pages API

Resume Supports Parameters

CalibManager's run_calibration method supports the following parameters for resume action, for example:

run_calibration(resume=True, iteration=2, iter_step='analyze')

  • resume: bool, default=False, required for resume Note: resume=True is required for resume, otherwise all the parameters will be ignored
  • iteration: int, default=None, from which iteration to resume Note: in None case, calibra will detect and take the last iteration from last run
  • iter_step: str, default=None, from which calibration step to resume Note: in None case, calibra will detect and take the valid step of the iteration
  • loop: bool, default=True, if like to continue to next iteration Note: by default, resume will continue to run next iteration
  • max_iterations, int, default=None, user can override the max_iterations defined in calib_manager Note: in None case, calibra will take max_iterations defined in calib_manager
  • backup: bool, default=False, if like to backup Calibration.json Note: by default, resume will not make a backup of Calibration.json
  • dry_run: bool, default=False, if like to really execute resume action Note: by default (dry_run= False), resume will go ahead to execute resume action

iter_step supports the following options:

  • commission: will start to run a new iteration
  • analyze: analyze the output data from given iteration
  • plot: just plot for given iteration
  • next_point: go directly to next iteration

Examples as Reference

The examples/ directory contains canonical usage patterns:

  • examples/solar/ — Simplest: fits a linear model (y = mx + c) to data using OptimTool + RMSE
  • examples/sir/ — SIR epidemiological model with multiple output configuration options
  • examples/emod_sir/ — EMOD sir disease model calibrations using COMPS platform When implementing new features or debugging, the solar example (solar_optimtool_linear_model.py) is the clearest end-to-end reference.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

idmtools_calibra-3.0.0.tar.gz (123.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

idmtools_calibra-3.0.0-py3-none-any.whl (184.5 kB view details)

Uploaded Python 3

File details

Details for the file idmtools_calibra-3.0.0.tar.gz.

File metadata

  • Download URL: idmtools_calibra-3.0.0.tar.gz
  • Upload date:
  • Size: 123.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for idmtools_calibra-3.0.0.tar.gz
Algorithm Hash digest
SHA256 c0adcd32bd757696ff2ec436ce9762d97b6449a4a14418629eeee85ea98cf085
MD5 11c7c7b81be0662d3c897b7d2972ae2f
BLAKE2b-256 ffb351af9658d086651ae248a65dd7b276edc2dd3f21223e20bfe217ab6754db

See more details on using hashes here.

Provenance

The following attestation bundles were made for idmtools_calibra-3.0.0.tar.gz:

Publisher: publish-pypi.yml on InstituteforDiseaseModeling/idmtools-calibra

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file idmtools_calibra-3.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for idmtools_calibra-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 43d0b05bd51e76d8a1cd82299455bb5547bbc7f0c7ce6737b6825cdcb8bfe78a
MD5 ad2306f00037a479e11d13d2f188c6e5
BLAKE2b-256 95ba8e95488eaa74bcd7433a97992b7d889a04620aaeb6fc2a20f61cba2407c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for idmtools_calibra-3.0.0-py3-none-any.whl:

Publisher: publish-pypi.yml on InstituteforDiseaseModeling/idmtools-calibra

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page