Skip to main content

CASE_STUDY:

Short summary of the case study

Instructions

Prerequisites

Install git (https://git-scm.com/downloads), conda (https://docs.anaconda.com/free/miniconda/) and datalad (https://handbook.datalad.org/en/latest/intro/installation.html)

Development

If pymob is installed as editable, stub packages need also to be isntalled. This is important! Otherwise nothing will work.

pip uninstall types-pymob-guts-base

While test files are shipped (data/testing/*nc), it is recommended to generate them, when the observations datasets (.nc files) that are expected by GutsBase change. This can be done with the command

python tests/_create_fixtures.py

Installation

Prerequisites

If the case study was not already installed as a submodule with a meta package, you can install the package as follows.

Open a command line utility (cmd, bash, ...) and execute

git clone git@github.com:flo-schu/CASE_STUDY
cd CASE_STUDY

Create environment, activate it and install model package.

conda create -n CASE_STUDY
conda activate guts
conda install python=3.11
pip install -r requirements.txt

In order to install additional inference backends, use:

pip install pymob[numpyro]

For the available backends see https://pymob.readthedocs.io/en/latest/

Download or start tracking datasets

Download potentially existing results datasets

datalad clone git@gin.g-node.org:/flo-schu/CASE_STUDY__results.git results

if this is not possible create a new dataset (see section below)

datalad create -c text2git results
datalad create -c text2git data

Case study layout

This is the layout of your folder. Files like README, requirements, LICENSE and .gitignore are not shown, because they are not strictly necessary for the case study but contain important metadata

└─ test_case_study
    ├─ data
    │   └─ ...
    ├─ results
    │   └─ ...
    ├─ scenarios
    │   ├─ test_scenario
    │   └─ test_scenario_2
    ├─ scripts
    │   └─ ...
    ├─ __init__.py
    ├─ data.py
    ├─ mod.py
    ├─ plot.py
    ├─ prob.py
    ├─ sim.py
    ├─ ...

Usage

The case studies should now be ready to use. To get started, see: https://pymob.readthedocs.io/en/latest/

Command line

there is a command line script provided by the pymob package which will directly run inference accroding to the scenario settings.cfg file provided in the scenario folder of the respective case study. For details see https://pymob.readthedocs.io/en/latest/case_studies.html

pymob-infer --case_study CASE_STUDY --scenario SCENARIO --inference_backend numpyro

The options in the settings.cfg are the same as used when preparing the publication

The results will be stored in the results directory of the respective case study unless otherwise specified in the settings.cfg

Tracking results and data with datalad and gin

  1. create a new results dataset in the root of the repository

datalad create -c text2git results

if the directory already exists, use the -f flag:

datalad create -f -c text2git results

  1. save the results as they come in in order to keep a version history.

datalad save -m "Computed posterior with nuts"

Upload the dataset to gin.

  1. Create a new repository on gin https://gin.g-node.org/

  2. add the repository as a remote for the dataset

datalad siblings add -d . --name gin --url git@gin.g-node.org:/flo-schu/CASE_STUDY__results.git

The remote is now connected to the sibling gin.

  1. Push new results to gin datalad push --to gin

Using a case study as a foundation for building new models

You may have noticed an __init__.py file. This file makes the case study a package. This way, the package can be installed as a submodule in any other package.

This means, case-studies can be stacked on top of each other. This way, only the changes need to be captured in the new case study and can be transferred into the next project.

The downside is that pymob versions need to be compatible for this use case.

Download files

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

Source Distribution

guts_base-2.3.1.tar.gz (140.9 kB view details)

Uploaded Source

Built Distribution

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

guts_base-2.3.1-py3-none-any.whl (128.0 kB view details)

Uploaded Python 3

File details

Details for the file guts_base-2.3.1.tar.gz.

File metadata

  • Download URL: guts_base-2.3.1.tar.gz
  • Upload date:
  • Size: 140.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.16

File hashes

Hashes for guts_base-2.3.1.tar.gz
Algorithm Hash digest
SHA256 9db312c8680035805b31dd9491bc53512670066c63e9f4006bdd202a646133a9
MD5 3c25efcffbe75e6b347cceca0145f3de
BLAKE2b-256 dca00d5892a62c3f2ff6e7fbd2ddde55c3db8f405437476275dadc428525924c

See more details on using hashes here.

File details

Details for the file guts_base-2.3.1-py3-none-any.whl.

File metadata

  • Download URL: guts_base-2.3.1-py3-none-any.whl
  • Upload date:
  • Size: 128.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.16

File hashes

Hashes for guts_base-2.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ca3e9724755f44ec3d14750dfbf67862934296f96f74c5b857c28bf13be27ab6
MD5 ea05b90c4a19206be20efd9ef02ce814
BLAKE2b-256 27b75f8cceacdece66e1d6f3f4111ea84656e211a9c2e9d10892ae15aaa8b5bc

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2.3.1 This release

2 files

2.3.0

2 files

2.2.2

2 files

2.2.1

2 files

2.2.0

2 files

2.1.0

2 files

2.0.0

2 files

1.0.9

2 files

1.0.8

2 files

1.0.7

2 files

1.0.6

2 files

1.0.5

2 files

1.0.4

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

0.8.6

2 files

0.8.5

2 files

0.8.4

2 files

0.8.3

2 files

0.8.2

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page