Skip to content

Localizes AutoSAS #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Mar 12, 2025
1,069 changes: 982 additions & 87 deletions AFL/double_agent/AutoSAS.py

Large diffs are not rendered by default.

641 changes: 66 additions & 575 deletions AFL/double_agent/AutoSAS_Driver.py

Large diffs are not rendered by default.

22 changes: 18 additions & 4 deletions AFL/double_agent/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def list_datasets():

return [f.stem for f in data_dir.glob("*.nc")]

def load_dataset(name):
def load_dataset(name,lazy=False):
"""
Load a dataset by name.

Expand Down Expand Up @@ -74,8 +74,10 @@ def load_dataset(name):
f"Data directory: {data_dir}. "
f"Available datasets: {list_datasets()}"
)

return xr.open_dataset(file_path)
if lazy:
return xr.open_dataset(file_path)
else:
return xr.load_dataset(file_path)

# Define specific dataset loaders
def example_dataset1():
Expand All @@ -89,5 +91,17 @@ def example_dataset1():
"""
return load_dataset("example_dataset")

# Define specific dataset loaders
def example_dataset2():
"""
Load the example dataset.

Returns
-------
xarray.Dataset
The example dataset.
"""
return load_dataset("synthetic_sans")

# Add all datasets as module-level variables
__all__ = ["load_dataset", "list_datasets", "example_dataset1"]
__all__ = ["load_dataset", "list_datasets", "example_dataset1", "example_dataset2"]
Binary file added AFL/double_agent/data/synthetic_sans.nc
Binary file not shown.
3 changes: 2 additions & 1 deletion docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -253,4 +253,5 @@ dependencies:
- zipp==3.21.0
- zstandard==0.23.0
- nbsphinx==0.9.6
- mpltern==1.0.4
- bumps==0.9.3
- mpltern==1.0.4
4 changes: 2 additions & 2 deletions docs/source/how-to/appending.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"id": "c68003ae",
"metadata": {},
"source": [
"Appending Data to xarray.Datasets\n",
"================================"
"Append Data to xarray.Datasets\n",
"=============================="
]
},
{
Expand Down
Loading
Loading