Skip to content

Commit a32b1c4

Browse files
committed
Update documentation links, add description of data formats
1 parent d025815 commit a32b1c4

File tree

2 files changed

+29
-5
lines changed

2 files changed

+29
-5
lines changed

README.md

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
[![PyPI - Version](https://img.shields.io/pypi/v/DeepDiagnostics?style=flat&logo=pypi&labelColor=grey&color=blue)](https://pypi.org/project/DeepDiagnostics/)
2-
![status](https://img.shields.io/badge/License-MIT-lightgrey) [![test](https://github.com/deepskies/DeepDiagnostics/actions/workflows/test.yaml/badge.svg?branch=main)](https://github.com/deepskies/DeepDiagnostics/actions/workflows/test.yaml) [![Documentation Status](https://readthedocs.org/projects/deepdiagnostics/badge/?version=latest)](https://deepdiagnostics.readthedocs.io/en/latest/?badge=latest)
2+
![status](https://img.shields.io/badge/License-MIT-lightgrey)
3+
[![test](https://github.com/deepskies/DeepDiagnostics/actions/workflows/test.yaml/badge.svg?branch=main)](https://github.com/deepskies/DeepDiagnostics/actions/workflows/test.yaml)
4+
[![Documentation Status](https://github.com/deepskies/DeepDiagnostics/actions/workflows/documentation.yml/badge.svg)](https://deepskies.github.io/DeepDiagnostics/)
35

46
# DeepDiagnostics
57
DeepDiagnostics is a package for diagnosing the posterior from an inference method. It is flexible, applicable for both simulation-based and likelihood-based inference.
68

79
## Documentation
8-
### [readthedocs](https://deepdiagnostics.readthedocs.io/en/latest/)
10+
### [Read our docs on github.io](https://deepskies.github.io/DeepDiagnostics/)
911

1012
## Installation
1113
### From PyPi
@@ -15,19 +17,38 @@ pip install deepdiagnostics
1517
```
1618
### From Source
1719

20+
This project is built from poetry, if working from source we recommend using `poetry run` to run any commands that use the package.
21+
You can also use `poetry env activate` to get the path to the python virtual environment used by poetry.
22+
For additional information - [please view poetry's environment management documentation](https://python-poetry.org/docs/managing-environments).
23+
1824
``` sh
1925
git clone https://github.com/deepskies/DeepDiagnostics/
2026
pip install poetry
2127
poetry env activate
22-
source {result of env activate}
2328
poetry install
24-
pytest
29+
poetry run pytest
30+
poetry run diagnose --config {config path}
2531
```
2632

2733
## Quickstart
2834

2935
[View the template yaml here for a minimally working example with our supplied sample data to get started.](https://github.com/deepskies/DeepDiagnostics/blob/main/config.yml.template)
3036

37+
### Data and Model Requirements
38+
39+
To access your trained model, use the `SBIModel` class to load in a trained model in the form of a `.pkl` file.
40+
[This format specifics are shown here](https://sbi-dev.github.io/sbi/latest/faq/question_05_pickling/)
41+
If you wish to use a different model format, we encourage you to open a [new issue](https://github.com/deepskies/DeepDiagnostics/issues) requesting it, or even better, write an subclass of `deepdiagnostics.models.Model` to include it!
42+
43+
To read in your own data, supply an `.h5` or `.pkl` file and specify your format in the `data`.`data_engine` field of the configuration file. [The possible fields are listed here.](https://deepskies.github.io/DeepDiagnostics/data.html) We recommend an `.h5` file.
44+
45+
The data must have the following fields:
46+
* `xs` - The range of data your parameters have been tested against. For example, if you are modeling `y = mx + b`, your `xs` are the values you have tested for `x`. Please ensure they are of the shape (x_size, n_samples).
47+
* `thetas` - The parameters that characterize your problem. For example, if you are modeling `y = mx + b`, your `thetas` are `m` and `b`. Please ensure they are in the shape of (n_parameters, n_samples) and ordered the same way `parameter_labels` is supplied in your configuration file to prevent mislabelled plots.
48+
49+
If you do not supply a simulator method, including a `ys` field can allow for the use of a `lookup-table` simulator substitute.
50+
51+
3152
### Pipeline
3253
`DeepDiagnostics` includes a CLI tool for analysis.
3354
* To run the tool using a configuration file:
@@ -45,6 +66,7 @@ pytest
4566

4667
Additional arguments can be found using ``diagnose -h``
4768

69+
4870
### Standalone
4971

5072
`DeepDiagnostics` comes with the option to run different plots and metrics independently.
@@ -78,6 +100,8 @@ These child classes need a few methods. A minimal example of both a metric and a
78100

79101
It is strongly encouraged to provide typing for all inputs of the `plot` and `calculate` methods so they can be automatically documented.
80102

103+
Please ensure the proxy format `DataDisplay` is used for all plots, which ensures results can be re-plotted.
104+
81105
### Metric
82106
``` py
83107
from deepdiagnostics.metrics import Metric

src/deepdiagnostics/models/sbi_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
class SBIModel(Model):
88
"""
99
Load a trained model that was generated with Mackelab SBI :cite:p:`centero2020sbi`.
10-
`Read more about saving and loading requirements here <https://sbi-dev.github.io/sbi/faq/question_05/>`_.
10+
`Read more about saving and loading requirements here <https://sbi-dev.github.io/sbi/latest/faq/question_05_pickling/>`_.
1111
1212
Args:
1313
model_path (str): relative path to a model - must be a .pkl file.

0 commit comments

Comments
 (0)