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: Fix missing download testdata section in documentation #1281

Merged
merged 5 commits into from
Jul 26, 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
2 changes: 1 addition & 1 deletion docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ Molar masses and related helpers
Access to minimal test dataset
------------------------------

.. automodule:: pyaerocom.access_testdata
.. automodule:: pyaerocom.sample_data_access.minimal_dataset
:members:
:undoc-members:

Expand Down
16 changes: 11 additions & 5 deletions pyaerocom/sample_data_access/minimal_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@

logger = logging.getLogger(__name__)

__all__ = ["download_minimal_dataset"]

#: tarfile to download
TESTDATA_FILE = "testdata-minimal.tar.gz.20240722"
DEFAULT_TESTDATA_FILE = "testdata-minimal.tar.gz.20240722"

minimal_dataset = pooch.create(
path=const.OUTPUTDIR, # ~/MyPyaerocom/
Expand All @@ -27,13 +29,17 @@


def download_minimal_dataset(
file_name: str = TESTDATA_FILE, /, extract_dir_override: str | None = None
file_name: str = DEFAULT_TESTDATA_FILE, /, extract_dir_override: str | None = None
):
"""Download test_data_file and extracts it.

:param file_name : The file name to be downloaded.
:param extract_dir : An optional folder override to where to extract the file. By
default files are extracted into ~/MyPyaerocom
Parameters
----------
file_name :
The file name to be downloaded.
extract_dir :
An optional folder override to where to extract the file. By
default files are extracted into `~/MyPyaerocom`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong formatting, use rest or numpy: https://gist.github.com/nipunsadvilkar/fec9d2a40f9c83ea7fd97be59261c400 (in vscode, I like to use https://marketplace.visualstudio.com/items?itemName=njpwerner.autodocstring )

"""
    Download test_data_file and extracts it.

    :param file_name: The file name to be downloaded.
    :param extract_dir: An optional folder override to where to extract the file. By
    default files are extracted into ~/MyPyaerocom
"""

should work.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still wrong formatting of parameters at https://pyaerocom--1281.org.readthedocs.build/en/1281/api.html#module-pyaerocom.sample_data_access.minimal_dataset after recents fix:formatting:
image

should look like:
image

"""
logger.debug(f"fetch {file_name} to {minimal_dataset.path}")

Expand Down