Skip to content

Commit

Permalink
work on documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
b8raoult committed Mar 25, 2024
1 parent 1ec9f7b commit 05c7429
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 16 deletions.
5 changes: 5 additions & 0 deletions anemoi/datasets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,9 @@
# granted to it by virtue of its status as an intergovernmental organisation
# nor does it submit to any jurisdiction.

from .data import MissingDateError
from .data import open_dataset

__version__ = "0.1.0"

__all__ = ["open_dataset", "MissingDateError"]
2 changes: 1 addition & 1 deletion anemoi/datasets/commands/compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# nor does it submit to any jurisdiction.
#

from anemoi.datasets.data import open_dataset
from anemoi.datasets import open_dataset

from . import Command

Expand Down
2 changes: 1 addition & 1 deletion anemoi/datasets/commands/inspect/zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import semantic_version
import tqdm

from anemoi.datasets.data import open_dataset
from anemoi.datasets import open_dataset
from anemoi.datasets.data.stores import open_zarr
from anemoi.datasets.utils.humanize import bytes
from anemoi.datasets.utils.humanize import number
Expand Down
2 changes: 1 addition & 1 deletion anemoi/datasets/create/loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import numpy as np
import zarr

from anemoi.datasets.data import open_dataset
from anemoi.datasets import open_dataset
from anemoi.datasets.utils.dates.groups import Groups

from .check import DatasetName
Expand Down
2 changes: 0 additions & 2 deletions docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
Examples
##########

Here is a list of example notebooks to illustrate how to access data,
create plots, and do machine learning using CliMetLab.

.. toctree::
:maxdepth: 2
Expand Down
10 changes: 8 additions & 2 deletions docs/using/combining.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ chronological order with no gaps between them.

.. code:: python
from anemoi.datasets import open_dataset
ds = open_dataset(
"aifs-ea-an-oper-0001-mars-o96-1940-1978-1h-v2",
"aifs-ea-an-oper-0001-mars-o96-1979-2022-1h-v2",
Expand Down Expand Up @@ -70,12 +72,16 @@ Please note that you can join more than two ``zarr`` files.

.. code:: python
open_dataset(ensembles=[dataset1, dataset2, ...])
from anemoi.datasets import open_dataset
ds = open_dataset(ensembles=[dataset1, dataset2, ...])
*******
grids
*******

.. code:: python
open_dataset(grids=[dataset1, dataset2, ...], method=...)
from anemoi.datasets import open_dataset
ds = open_dataset(grids=[dataset1, dataset2, ...], method=...)
6 changes: 3 additions & 3 deletions docs/using/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ To open a dataset, you can use the `open_dataset` function.

.. code:: python
from anemoi_datasets import open_dataset
from anemoi.datasets import open_dataset
ds = open_dataset("path/to/dataset.zarr")
Expand All @@ -43,7 +43,7 @@ to subset or combine datasets.

.. code:: python
from anemoi_datasets import open_dataset
from anemoi.datasets import open_dataset
ds = open_dataset("path/to/dataset.zarr", start=2000, end=2020)
Expand All @@ -53,7 +53,7 @@ the `open_dataset` function:

.. code:: python
from anemoi_datasets import open_dataset
from anemoi.datasets import open_dataset
ds = open_dataset("path/to/dataset1.zarr", "path/to/dataset2.zarr")
Expand Down
8 changes: 4 additions & 4 deletions docs/using/opening.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@

.. code:: python
from anemoi_datasets import open_dataset
from anemoi.datasets import open_dataset
ds = open_dataset("path/to/dataset.zarr", option1=value1, option2=value2, ...)
or

.. code:: python
from anemoi_datasets import open_dataset
from anemoi.datasets import open_dataset
ds = open_dataset(combine=["path/to/dataset1.zarr",
"path/to/dataset2.zarr", ...])
Expand All @@ -23,7 +23,7 @@ or

.. code:: python
from anemoi_datasets import open_dataset
from anemoi.datasets import open_dataset
ds = open_dataset(combine=["path/to/dataset1.zarr",
"path/to/dataset2.zarr", ...],
Expand All @@ -38,7 +38,7 @@ The term `combine` is one of `join`, `concat`, `ensembles`, etc. See

.. code:: python
from anemoi_datasets import open_dataset
from anemoi.datasets import open_dataset
ds = open_dataset(combine=[{"dataset": "path/to/dataset1.zarr",
"option1"=value1, "option2"=value2, ...},
Expand Down
2 changes: 1 addition & 1 deletion tests/create/test_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
import requests
from climetlab import load_source

from anemoi.datasets import open_dataset
from anemoi.datasets.create import Creator
from anemoi.datasets.data import open_dataset
from anemoi.datasets.data.stores import open_zarr

TEST_DATA_ROOT = "https://object-store.os-api.cci1.ecmwf.int/ml-tests/test-data/anemoi-datasets/create/"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import numpy as np
import zarr

from anemoi.datasets.data import open_dataset
from anemoi.datasets import open_dataset
from anemoi.datasets.data.concat import Concat
from anemoi.datasets.data.ensemble import Ensemble
from anemoi.datasets.data.grids import Grids
Expand Down

0 comments on commit 05c7429

Please sign in to comment.