Skip to content
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

[DOCS] add logo and authors to docs + docstrings for fetchers #45

Merged
merged 2 commits into from
Oct 29, 2024
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
Binary file removed docs/source/_static/glider.jpg
Binary file not shown.
Binary file added docs/source/_static/glider.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

# General information about the project.
project = 'glidertest'
author = 'Callum Rollo'
author = 'Eleanor Frajka-Williams, Chiara Monforte, Callum Rollo'
copyright = f"{year}, {author}"
release = 'v0.0.1'

Expand Down Expand Up @@ -39,3 +39,5 @@
html_static_path = ['_static']

source_suffix = [".rst", ".md"]

html_logo = "_static/glider.png"
5 changes: 4 additions & 1 deletion docs/source/glidertest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@
.. automodule:: glidertest.tools
:members:
:undoc-members:
:show-inheritance:

.. automodule:: glidertest.fetchers
:members:
:undoc-members:
13 changes: 12 additions & 1 deletion glidertest/fetchers.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,20 @@


def load_sample_dataset(dataset_name="sea076_20230906T0852_delayed.nc"):
"""Download sample datasets for use with glidertest

Args:
dataset_name (str, optional): _description_. Defaults to "sea076_20230906T0852_delayed.nc".

Raises:
ValueError: If the requests dataset is not known, raises a value error

Returns:
xarray.Dataset: Requested sample dataset
"""
if dataset_name in data_source_og.registry.keys():
file_path = data_source_og.fetch(dataset_name)
return xr.open_dataset(file_path)
else:
msg = f"Requested sample dataset {dataset_name} not known"
msg = f"Requested sample dataset {dataset_name} not known. Specify one of the following available datasets: {list(data_source_og.registry.keys())}"
raise ValueError(msg)