Skip to content

Commit a2993fd

Browse files
authored
Merge pull request #360 from DHI/docs
Twek index / getting started pages
2 parents 9b10b06 + 456671e commit a2993fd

File tree

4 files changed

+33
-34
lines changed

4 files changed

+33
-34
lines changed

README.md

+8-7
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
[ModelSkill](https://github.com/DHI/modelskill) is a python package for scoring [MIKE](https://www.mikepoweredbydhi.com) models (other models can be evaluated as well).
88

9-
Read more about the [vision and scope](https://dhi.github.io/modelskill/vision.html). Contribute with new ideas in the [discussion](https://github.com/DHI/modelskill/discussions), report an [issue](https://github.com/DHI/modelskill/issues) or browse the [documentation](https://dhi.github.io/modelskill/). Access observational data (e.g. altimetry data) from the sister library [WatObs](https://github.com/DHI/watobs).
9+
Contribute with new ideas in the [discussion](https://github.com/DHI/modelskill/discussions), report an [issue](https://github.com/DHI/modelskill/issues) or browse the [documentation](https://dhi.github.io/modelskill/). Access observational data (e.g. altimetry data) from the sister library [WatObs](https://github.com/DHI/watobs).
1010

1111

1212
## Use cases
@@ -30,20 +30,21 @@ Or the development version:
3030

3131
## Example notebooks
3232

33-
* [Quick_and_dirty_compare.ipynb](https://nbviewer.jupyter.org/github/DHI/modelskill/blob/main/notebooks/Quick_and_dirty_compare.ipynb)
34-
* [SW_DutchCoast.ipynb](https://nbviewer.jupyter.org/github/DHI/modelskill/blob/main/notebooks/SW_DutchCoast.ipynb)
35-
* [Multi_model_comparison.ipynb](https://nbviewer.jupyter.org/github/DHI/modelskill/blob/main/notebooks/Multi_model_comparison.ipynb)
33+
34+
* [Hydrology_Vistula_Catchment.ipynb](https://nbviewer.jupyter.org/github/DHI/modelskill/blob/main/notebooks/Hydrology_Vistula_Catchment.ipynb)
35+
* [Metocean_multi_model_comparison.ipynb](https://nbviewer.jupyter.org/github/DHI/modelskill/blob/main/notebooks/Metocean_multi_model_comparison.ipynb)
3636
* [Multi_variable_comparison.ipynb](https://nbviewer.jupyter.org/github/DHI/modelskill/blob/main/notebooks/Multi_variable_comparison.ipynb)
37-
* [Track_comparison.ipynb](https://nbviewer.jupyter.org/github/DHI/modelskill/blob/main/notebooks/Track_comparison.ipynb) (including global wave model example)
38-
* [NetCDF_ModelResult.ipynb](https://nbviewer.jupyter.org/github/DHI/modelskill/blob/main/notebooks/NetCDF_ModelResult.ipynb)
37+
* [Metocean_track_comparison_global.ipynb](https://nbviewer.jupyter.org/github/DHI/modelskill/blob/main/notebooks/Metocean_track_comparison_global.ipynb)
38+
* [Gridded_NetCDF_ModelResult.ipynb](https://nbviewer.jupyter.org/github/DHI/modelskill/blob/main/notebooks/Gridded_NetCDF_ModelResult.ipynb)
39+
* [Directional_data_comparison.ipynb](https://nbviewer.jupyter.org/github/DHI/modelskill/blob/main/notebooks/Directional_data_comparison.ipynb)
3940
* [Combine_comparers.ipynb](https://nbviewer.jupyter.org/github/DHI/modelskill/blob/main/notebooks/Combine_comparers.ipynb)
4041

4142

4243
## Workflow
4344

4445
1. Define **ModelResults**
4546
2. Define **Observations**
46-
3. **Compare** Observations and ModelResults
47+
3. **Match** Observations and ModelResults
4748
4. Do plotting, statistics, reporting using the **Comparer**
4849

4950
Read more about the workflow in the [getting started guide](https://dhi.github.io/modelskill/getting-started.html).

docs/getting-started.md

+16-16
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,17 @@ The typical ModelSkill workflow consists of these five steps:
1818

1919
### 1. Define ModelResults
2020

21-
The result of a MIKE 21/3 simulation is stored in one or more dfs files.
22-
The most common formats are .dfsu for distributed data and .dfs0 for
23-
time series point data. A ModelSkill ModelResult is defined by the
24-
result file path and a name:
21+
The result of a simulation is stored in one or more result files, e.g. dfsu, dfs0, nc, csv.
2522

26-
```python
23+
The name is used to identify the model result in the plots and tables.
24+
25+
```python hl_lines="4"
2726
import modelskill as ms
28-
mr = ms.DfsuModelResult("SW/HKZN_local_2017_DutchCoast.dfsu", name='HKZN_local', item="Sign. Wave Height")
27+
mr = ms.DfsuModelResult("SW/HKZN_local_2017_DutchCoast.dfsu",
28+
item="Sign. Wave Height",
29+
name='HKZN_local')
2930
```
3031

31-
Currently, ModelResult supports .dfs0 and .dfsu files and pandas
32-
DataFrame. Only the file header is read when the ModelResult object is
33-
created. The data will be read later.
34-
3532
### 2. Define Observations
3633

3734
The next step is to define the measurements to be used for the skill
@@ -40,12 +37,15 @@ assessment. Two types of observation are available:
4037
- [PointObservation](api/observation/point.md)
4138
- [TrackObservation](api/observation/track.md)
4239

43-
Let\'s assume that we have one PointObservation and one
44-
TrackObservation:
40+
Let's assume that we have one PointObservation and one
41+
TrackObservation (`name` is used to identify the observation, similar to the `name` of the model above).
4542

46-
```python
47-
hkna = ms.PointObservation("HKNA_Hm0.dfs0", item=0, x=4.2420, y=52.6887, name="HKNA")
48-
c2 = ms.TrackObservation("Alti_c2_Dutch.dfs0", item=3, name="c2")
43+
```python hl_lines="3 5"
44+
hkna = ms.PointObservation("HKNA_Hm0.dfs0", item=0,
45+
x=4.2420, y=52.6887,
46+
name="HKNA")
47+
c2 = ms.TrackObservation("Alti_c2_Dutch.dfs0", item=3,
48+
name="c2")
4949
```
5050

5151
In this case both observations are provided as .dfs0 files but pandas
@@ -57,7 +57,7 @@ file, the item number (or item name) and a name. A PointObservation
5757
further needs to be initialized with it\'s x-, y-position.
5858

5959

60-
### 3. Connect observations and ModelResults
60+
### 3. Match observations and ModelResults
6161

6262
```python
6363
cc = ms.match([hkna, c2], mr)

docs/index.md

+8-10
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,19 @@ ModelSkill is compatible with Python 3.8 and later versions on Windows and Linux
2626
Are your observations and model results already matched?
2727

2828
```python
29-
>>> import modelskill as ms
30-
>>> cmp = ms.from_matched("matched_data.dfs0", obs_item="obs_WL", mod_item="WL")
31-
>>> cmp.skill()
32-
...
29+
import modelskill as ms
30+
cmp = ms.from_matched("matched_data.dfs0", obs_item="obs_WL", mod_item="WL")
31+
cmp.skill()
3332
```
3433

3534
Or do you need to match the observations and results first?
3635

3736
```python
38-
>>> import modelskill as ms
39-
>>> o = ms.PointObservation("obs.dfs0", item="obs_WL")
40-
>>> mr = ms.PointModelResult("model.dfs0", item="WL")
41-
>>> cmp = ms.match(o, mr)[0]
42-
>>> cmp.skill()
43-
...
37+
import modelskill as ms
38+
o = ms.PointObservation("obs.dfs0", item="obs_WL")
39+
mr = ms.PointModelResult("model.dfs0", item="WL")
40+
cmp = ms.match(o, mr)
41+
cmp.skill()
4442
```
4543

4644
Read more in the [Getting started guide](getting-started.md) or in the [overview](overview.md) of the package.

notebooks/Metocean_track_comparison_global.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
"metadata": {},
7373
"outputs": [],
7474
"source": [
75-
"cmp = ms.match(o1, mr)[0] # compare returns a list of comparison objects, here we only have one"
75+
"cmp = ms.match(o1, mr)"
7676
]
7777
},
7878
{

0 commit comments

Comments
 (0)