Skip to content

Commit

Permalink
more doc
Browse files Browse the repository at this point in the history
  • Loading branch information
b8raoult committed Mar 29, 2024
1 parent 696c96c commit 0e928d9
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion anemoi/datasets/data/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def load_config():
CONFIG = {}

CONFIG.setdefault("datasets", {})
CONFIG["datasets"].setdefault("lookup", [])
CONFIG["datasets"].setdefault("path", [])
CONFIG["datasets"].setdefault("named", {})

return CONFIG
Expand Down
2 changes: 1 addition & 1 deletion anemoi/datasets/data/stores.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ def zarr_lookup(name):
return config["named"][name]

tried = []
for location in config["lookup"]:
for location in config["path"]:
if not location.endswith("/"):
location += "/"
full = location + name + ".zarr"
Expand Down
16 changes: 12 additions & 4 deletions docs/using/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,20 @@
Configuration
###############

When the ``open_dataset`` function is called with a string that does
not ends with ``.zarr`` or ``.zip``, it is considered a dataset name and not
When the ``open_dataset`` function is called with a string that does not
ends with ``.zarr`` or ``.zip``, it is considered a dataset name and not
a path or a URL.

In that case, the *Anemoi* configuration is read from ``~/.anemoi.toml``. Below is an
example of such a configuration:
In that case, the *Anemoi* configuration is read from
``~/.anemoi.toml``. Below is an example of such a configuration:

.. literalinclude:: configuration.toml
:language: toml

Then, the name passed to ``open_dataset`` is used to look up for a
possible path or URL:

- If the name is listed in the ``[datasets.named]``, the corresponding
path is used
- Otherwise suffix ``.zarr`` is added to the name and the file is
searched at every location listed in the ``path`` list.
2 changes: 1 addition & 1 deletion docs/using/configuration.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[datasets]
lookup = [
path = [
"/home/mlx/ai-ml/datasets/stable",
"/home/mlx/ai-ml/datasets/experimental",
"/home/mlx/ai-ml/datasets/testing",
Expand Down
4 changes: 2 additions & 2 deletions docs/using/selecting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
Selecting variables
#####################

Selecting is the action of filtering the dataset by its second dimension (variables).

Selecting is the action of filtering the dataset by its second dimension
(variables).

.. _select:

Expand Down
3 changes: 2 additions & 1 deletion docs/using/subsetting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
Subsetting datasets
#####################

Subsetting is the action of filtering the dataset by its first dimension (dates).
Subsetting is the action of filtering the dataset by its first dimension
(dates).

.. _start:

Expand Down

0 comments on commit 0e928d9

Please sign in to comment.