Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
patnr committed Oct 31, 2024
1 parent 95c00ca commit eafd242
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 28 deletions.
8 changes: 4 additions & 4 deletions dapper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ your own **model** or **method**, then

- If it is a complex one, you may be better off using DAPPER
merely as *inspiration* (but you can still
[cite it](https://github.com/nansencenter/DAPPER#getting-started))
[cite it](../#getting-started))
rather than trying to squeeze everything into its templates.
- If it is relatively simple, however, you may well want to use DAPPER.
In that case, read this:
- [`mods`][]
- [`da_methods`][]
- [`mods`](mods)
- [`da_methods`](da_methods)

Since the generality of DAPPER is
[limited](https://github.com/nansencenter/DAPPER#similar-projects)
[limited](../#similar-projects)
it is quite likely you will also need to make changes to the DAPPER code itself.
4 changes: 1 addition & 3 deletions dapper/da_methods/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
Also see the section on
[DA Methods](https://github.com/nansencenter/DAPPER#DA-Methods)
in the main README
Also see [this section on DA Methods](../../#da-methods)
for an overview of the methods included with DAPPER.

## Defining your own method
Expand Down
37 changes: 17 additions & 20 deletions dapper/mods/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
See the README section on
[test cases (models)](https://github.com/nansencenter/DAPPER#Test-cases-models)
[test cases (models)](../../index.md#test-cases-models)
for a table overview of the included models.

## Defining your own model
Expand All @@ -8,33 +8,30 @@ Below is a sugested structuring followed by most models already within DAPPER.
However, you are free to organize your model as you see fit,
as long as it culminates in the definition of one or more [`mods.HiddenMarkovModel`][].
For the sake of modularity,
try not to import stuff from DAPPER outside of [`mods`][] and `liveplotting`.
try not to import stuff from DAPPER outside of [`mods`](.) and [`tools.liveplotting`][].

- Make a directory: `my_model`. It does not have to reside within the `dapper/mods` folder,
but make sure to look into some of the other dirs thereunder as examples,
for example `dapper/mods/DoublePendulum`.

- Make a file: `my_model/__init__.py` to hold the core workings of the model.
Further details are given [below](#details-on-my_model__init__py), but the
main work lies in defining a `step(x, t, dt)` function
(you can name it however you like, but `step` is the convention),
to implement the dynamical model/system mapping the state `x`
from one time `t` to another `t + dt`.

- Make a file: `my_model/demo.py` to run `step` and visually showcase
a simulation of the model without any DA, and verify it's working.

- Make a file: `my_model/my_settings_1.py` that defines
(or "configures", since there is usually little programming logic and flow taking place)
a complete [`mods.HiddenMarkovModel`][] ready for a synthetic experiment
(also called "twin experiment" or OSSE).
- Once you've made some experiments you believe are noteworthy you should add a
"suggested settings/tunings" section in comments at the bottom of
`my_model/my_settings_1.py`, listing some of the relevant DA method
configurations that you tested, along with the RMSE (or other stats) that
you obtained for those methods. You will find plenty of examples already in
DAPPER, used for cross-referenced with literature to verify the workings of DAPPER
(and the reproducibility of publications).
(or "configures", since there is usually little programming logic and flow taking place)
a complete [`mods.HiddenMarkovModel`][] ready for a synthetic experiment
(also called "twin experiment" or OSSE).
- Once you've made some experiments you believe are noteworthy you should add a
"suggested settings/tunings" section in comments at the bottom of
`my_model/my_settings_1.py`, listing some of the relevant DA method
configurations that you tested, along with the RMSE (or other stats) that
you obtained for those methods. You will find plenty of examples already in
DAPPER, used for cross-referenced with literature to verify the workings of DAPPER
(and the reproducibility of publications).


### Details on `my_model/__init__.py`
Expand All @@ -48,11 +45,11 @@ try not to import stuff from DAPPER outside of [`mods`][] and `liveplotting`.
- [`mods.Lorenz96`][]: use of relatively clever slice notation.
- [`mods.LorenzUV`][]: use of cleverer slice notation: `...` (ellipsis).
Consider pre-defining the slices like so:

iiX = (..., slice(None, Nx))
iiP = (..., slice(Nx, None))

to abbreviate the indexing elsewhere.
```python
iiX = (..., slice(None, Nx))
iiP = (..., slice(Nx, None))
```
to abbreviate the indexing elsewhere.

- [`mods.QG`][]: use of parallelized for loop (map).

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `docs/examples/basic_1.py`
you should begin with `basic_1.py`
before incorporating the aspects of `basic_2` and `basic_3`.

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

0 comments on commit eafd242

Please sign in to comment.