Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/key_functionality.rst
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ and continue loading the SDF file as normal. This file contains the initial
simulation setup information which is not present in SDF outputs. By loading
this file, you can access these parameters as part of your dataset's metadata.
To do this, use the ``deck_path`` parameter when loading an SDF file with
`xarray.open_dataset`, `sdf_xarray.open_datatree`, `sdf_xarray.open_mfdataset`
or `sdf_xarray.open_mfdatatree`.
`sdf_xarray.open_dataset`, `xarray.open_dataset`, `sdf_xarray.open_datatree`,
`xarray.open_datatree`, `sdf_xarray.open_mfdataset` or `sdf_xarray.open_mfdatatree`.

There are a few ways you can load an input deck:

Expand Down
18 changes: 9 additions & 9 deletions src/sdf_xarray/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def open_dataset(


def open_mfdataset(
path_glob: Iterable | str | Path | Callable[..., Iterable[Path]],
paths: Iterable | str | Path | Callable[..., Iterable[Path]],
*,
separate_times: bool = False,
keep_particles: bool = False,
Expand Down Expand Up @@ -301,7 +301,7 @@ def open_mfdataset(

Parameters
----------
path_glob
paths
List of filenames or string glob pattern
separate_times
If ``True``, create separate time dimensions for variables defined at
Expand All @@ -326,22 +326,22 @@ def open_mfdataset(
from a relative or absolute file path. See :ref:`loading-input-deck` for details.
"""

path_glob = _resolve_glob(path_glob)
paths = _resolve_glob(paths)

if not separate_times:
return combine_datasets(
path_glob,
paths,
data_vars=data_vars,
keep_particles=keep_particles,
probe_names=probe_names,
chunks=chunks,
deck_path=deck_path,
)

_, var_times_map = make_time_dims(path_glob)
_, var_times_map = make_time_dims(paths)

all_dfs = []
for f in path_glob:
for f in paths:
ds = xr.open_dataset(
f,
keep_particles=keep_particles,
Expand Down Expand Up @@ -451,7 +451,7 @@ def open_datatree(


def open_mfdatatree(
path_glob: Iterable | str | Path | Callable[..., Iterable[Path]],
paths: Iterable | str | Path | Callable[..., Iterable[Path]],
*,
separate_times: bool = False,
keep_particles: bool = False,
Expand Down Expand Up @@ -512,7 +512,7 @@ def open_mfdatatree(

Parameters
----------
path_glob
paths
List of filenames or string glob pattern
separate_times
If ``True``, create separate time dimensions for variables defined at
Expand All @@ -536,7 +536,7 @@ def open_mfdatatree(
"""
# First, combine the datasets as usual
combined_ds = open_mfdataset(
path_glob,
paths,
separate_times=separate_times,
keep_particles=keep_particles,
probe_names=probe_names,
Expand Down
Loading
Loading