Skip to content

Commit

Permalink
Merge pull request #745 from DHI/docs
Browse files Browse the repository at this point in the history
Minor fix to docs + bump quartodoc version
  • Loading branch information
ecomodeller authored Nov 10, 2024
2 parents 362c905 + 20272a8 commit 3053600
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 27 deletions.
4 changes: 2 additions & 2 deletions docs/user-guide/data-structures.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

MIKE IO has these primary data structures:

* [**Dataset**](dataset.qmd) - a collection of DataArrays corresponding to the contents of a dfs file; typically obtained from {py:meth}`mikeio.read`
* [**Dataset**](dataset.qmd) - a collection of DataArrays corresponding to the contents of a dfs file; typically obtained from [](`mikeio.read`)
* [**DataArray**](dataarray.qmd) - data and metadata corresponding to one "item" in a dfs file.
* **Geometry** - spatial description of the data in a dfs file; comes in different flavours:
[Grid1D](`mikeio.Grid1D`), [Grid2D](`mikeio.Grid2D`), [Grid3D](`mikeio.Grid3D`), [GeometryFM2](`mikeio.spatial.GeometryFM2D`), [GeometryFM3D](`mikeio.spatial.GeometryFM3D`), etc. corresponding to different types of dfs files.
[Grid1D](`mikeio.Grid1D`), [Grid2D](`mikeio.Grid2D`), [Grid3D](`mikeio.Grid3D`), [GeometryFM2D](`mikeio.spatial.GeometryFM2D`), [GeometryFM3D](`mikeio.spatial.GeometryFM3D`), etc. corresponding to different types of dfs files.
* **Dfs** - an object returned by `dfs = mikeio.open()` containing the metadata (=header) of a dfs file ready for reading the data (which can be done with `dfs.read()`); exists in different specialized versions: [Dfs0](`mikeio.Dfs0`), [Dfs1](`mikeio.Dfs1`), [Dfs2](`mikeio.Dfs2`), [Dfs3](`mikeio.Dfs3`), [Dfsu2DH](`mikeio.dfsu.Dfsu2DH`), [Dfsu3D](`mikeio.dfsu.Dfsu3D`), [Dfsu2DV](`mikeio.dfsu.Dfsu2DV`), [DfsuSpectral](`mikeio.dfsu.DfsuSpectral`).

42 changes: 18 additions & 24 deletions mikeio/dataset/_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,10 @@ def n_elements(self) -> int:
return n_elem

def describe(self, **kwargs: Any) -> pd.DataFrame:
"""Generate descriptive statistics by wrapping :py:meth:`pandas.DataFrame.describe`."""
"""Generate descriptive statistics.
Wraps [](`pandas.DataFrame.describe`).
"""
data = {x.name: x.to_numpy().ravel() for x in self}
df = pd.DataFrame(data).describe(**kwargs)

Expand Down Expand Up @@ -1067,7 +1070,7 @@ def interp_time(
) -> "Dataset":
"""Temporal interpolation.
Wrapper of :py:class:`scipy.interpolate.interp1d`
Wrapper of [](`scipy.interpolate.interp1d`).
Parameters
----------
Expand All @@ -1090,27 +1093,18 @@ def interp_time(
Examples
--------
>>> ds = mikeio.read("tests/testdata/HD2D.dfsu")
>>> ds
<mikeio.Dataset>
Dimensions: (9, 884)
Time: 1985-08-06 07:00:00 - 1985-08-07 03:00:00
Items:
0: Surface elevation <Surface Elevation> (meter)
1: U velocity <u velocity component> (meter per sec)
2: V velocity <v velocity component> (meter per sec)
3: Current speed <Current Speed> (meter per sec)
>>> dsi = ds.interp_time(dt=1800)
>>> dsi
<mikeio.Dataset>
Dimensions: (41, 884)
Time: 1985-08-06 07:00:00 - 1985-08-07 03:00:00
Items:
0: Surface elevation <Surface Elevation> (meter)
1: U velocity <u velocity component> (meter per sec)
2: V velocity <v velocity component> (meter per sec)
3: Current speed <Current Speed> (meter per sec)
>>> dsi = ds.interp_time(freq='2H')
```{python}
ds = mikeio.read("../data/HD2D.dfsu")
ds
```
```{python}
ds.interp_time(dt=1800)
```
```{python}
ds.interp_time(freq='2h')
```
"""
if freq:
Expand Down Expand Up @@ -1618,7 +1612,7 @@ def ptp(self, axis: int | str = 0, **kwargs: Any) -> "Dataset":
def average(self, *, weights, axis=0, **kwargs) -> "Dataset": # type: ignore
"""Compute the weighted average along the specified axis.
Wraps :py:meth:`numpy.average`
Wraps [](`numpy.average`)
Parameters
----------
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ classifiers = [
[project.optional-dependencies]
dev = ["pytest",
"quarto-cli",
"quartodoc==0.8.0",
"quartodoc==0.9.1",
"shapely",
"pyproj",
"xarray",
Expand Down

0 comments on commit 3053600

Please sign in to comment.