Skip to content

Commit

Permalink
Update ref to examples/
Browse files Browse the repository at this point in the history
  • Loading branch information
patnr committed Oct 30, 2024
1 parent bc2e5ba commit a82d396
Show file tree
Hide file tree
Showing 8 changed files with 7,181 additions and 37 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ and then estimate that truth given the models and noisy observations.
## Getting started

[Install](#installation), then
read, run and try to understand `examples/basic_{1,2,3}.py`.
read, run and try to understand `docs/examples/basic_{1,2,3}.py`.
Some of the examples also exist as Jupyter notebooks, and can be run in the cloud
*without installation* (but requiring Google login): [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](http://colab.research.google.com/github/nansencenter/DAPPER).
This [screencast](https://www.youtube.com/watch?v=YtalK0Zkzvg&t=6475s)
Expand All @@ -49,7 +49,7 @@ through a variety of typical [test cases](#test-cases-models) and statistics. It
(b) facilitates comparative studies, thus promoting the
(a) reliability and
(b) relevance of the results.
For example, the figure below is generated by `examples/basic_3.py`,
For example, the figure below is generated by `docs/examples/basic_3.py`,
reproduces figure 5.7 of [these lecture notes](http://cerea.enpc.fr/HomePages/bocquet/teaching/assim-mb-en.pdf).
DAPPER is
(c) open source, written in Python, and
Expand All @@ -62,7 +62,7 @@ and makes it easy to adapt and extend.
![Comparative benchmarks with Lorenz-96 plotted as a function of the ensemble size (N)](https://github.com/nansencenter/DAPPER/raw/master/docs/images/ex3.svg)

DAPPER demonstrates how to parallelise ensemble forecasts (e.g., the QG model),
local analyses (e.g., the LETKF), and independent experiments (e.g., `examples/basic_3.py`).
local analyses (e.g., the LETKF), and independent experiments (e.g., `docs/examples/basic_3.py`).
It includes a battery of diagnostics and statistics,
which all get averaged over subdomains (e.g., "ocean" and "land") and then in time.
Confidence intervals are computed, including correction for auto-correlations,
Expand Down Expand Up @@ -132,7 +132,7 @@ You should now be able to do run your script with
`python path/to/script.py`.
For example, if you are in the DAPPER dir,

python examples/basic_1.py
python docs/examples/basic_1.py

**PS**: If you closed the terminal (or shut down your computer),
you'll first need to run `conda activate dapper-env`
Expand Down
2 changes: 1 addition & 1 deletion dapper/mods/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ try not to import stuff from DAPPER outside of [`mods`][] and `liveplotting`.

In parameter estimation problems, the parameters are treated as input
variables to the "forward model". This does not *necessarily* require OOP.
See `examples/param_estim.py`.
See `docs/examples/param_estim.py`.

- Optional: define a suggested/example initial state, `x0`.
This facilitates the specification of initial conditions for different synthetic
Expand Down
5 changes: 3 additions & 2 deletions dapper/mods/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def __init__(
sectors : dict, optional
Labelled indices referring to parts of the state vector.
When defined, field-mean statistics are computed for each sector.
Example use can be found in `examples/param_estim.py`
Example use can be found in `docs/examples/param_estim.py`
and `dapper/mods/Lorenz96/miyoshi2011.py`
name : str, optional
Label for the `HMM`.
Expand Down Expand Up @@ -184,7 +184,8 @@ class TimeDependentOperator:
The time instance should be specified by `ko`,
i.e. the index of an observation time.
Examples: `examples/time-dep-obs-operator.py` and `dapper/mods/QG/sakov2008.py`.
Examples: `docs/examples/time-dep-obs-operator.py`
and `dapper/mods/QG/sakov2008.py`.
"""

def __init__(self, **kwargs):
Expand Down
6 changes: 3 additions & 3 deletions dapper/xp_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def run_experiment(
):
"""Used by [xp_launch.xpList.launch][] to run each single (DA) experiment ("xp").
This involves steps similar to `examples/basic_1.py`, i.e.:
This involves steps similar to `docs/examples/basic_1.py`, i.e.:
- `setup` : Initialize experiment.
- `xp.assimilate` : run DA, pass on exception if fail_gently
Expand Down Expand Up @@ -227,7 +227,7 @@ class xpList(list):
Also see
--------
- Examples: `examples/basic_2`, `examples/basic_3`
- Examples: `docs/examples/basic_2`, `docs/examples/basic_3`
- [`xp_process.xpSpace`][], which is used for experient result **presentation**,
as opposed to this class (`xpList`), which handles **launching** experiments.
"""
Expand Down Expand Up @@ -482,7 +482,7 @@ def launch(self, HMM, save_as="noname", mp=False, fail_gently=None, **kwargs):
- If this dict field is empty, then all python files
in `sys.path[0]` are uploaded.
See `examples/basic_2.py` and `examples/basic_3.py` for example use.
See `docs/examples/basic_2.py` and `docs/examples/basic_3.py` for example use.
"""
# Parse mp option
if not mp:
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Here are some example scripts using DAPPER.
They all consist of one (or more) synthetic experiments.

Run them using `python examples/the_script.py`,
Run them using `python docs/examples/the_script.py`,
or with the `%run` command inside `ipython`.

Some of the scripts have also been converted to Jupyter notebooks (`.ipynb`).
Expand All @@ -14,7 +14,7 @@ and that it requires a Google login): [![Open In Collab](https://colab.research.
## Description

When adapting the scripts to your needs,
you should begin with `examples/basic_1.py`
you should begin with `docs/examples/basic_1.py`
before incorporating the aspects of `basic_2` and `basic_3`.

- `basic_1.py`: A single experiment, with Liveplotting.
Expand Down
Loading

0 comments on commit a82d396

Please sign in to comment.