Skip to content

Commit

Permalink
[DOCS] add logo and authors to docs + docstrings for fetchers (#45)
Browse files Browse the repository at this point in the history
* add fetchers docstrings to docs

* add logo and authors to docs
  • Loading branch information
callumrollo authored Oct 29, 2024
1 parent 6bd6f7b commit 65d5f91
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 3 deletions.
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)

0 comments on commit 65d5f91

Please sign in to comment.