diff --git a/.gitignore b/.gitignore index c305f2a..36b34a9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ opacity/version.py - +.DS_Store # Byte-compiled / optimized / DLL files __pycache__/ diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 9944d58..437f6c0 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -20,3 +20,4 @@ python: path: . extra_requirements: - docs + - all diff --git a/README.rst b/README.rst index 4ff6202..dd26332 100644 --- a/README.rst +++ b/README.rst @@ -1,6 +1,14 @@ opacity ======= +.. image:: https://github.com/opacities/opacity/actions/workflows/ci.yml/badge.svg + :target: https://github.com/opacities/opacity/actions/workflows/ci.yml + +.. image:: https://codecov.io/gh/opacities/opacity/branch/main/graph/badge.svg?token=DKM812Q0FU + :target: https://codecov.io/gh/opacities/opacity + + + Browse, retrieve, and cache opacity grids from MAESTRO stored on AWS S3. This package is currently under construction. You shouldn't rely on backwards compatibility until further notice. @@ -11,5 +19,3 @@ MAESTRO * `About MAESTRO `_ * `Submit your opacity grid to MAESTRO `_ - - diff --git a/docs/_static/logo.png b/docs/_static/logo.png new file mode 100644 index 0000000..9ddef99 Binary files /dev/null and b/docs/_static/logo.png differ diff --git a/docs/conf.py b/docs/conf.py index 20a8a90..413d199 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -75,14 +75,21 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -# html_logo = "assets/logo.png" -# html_favicon = "assets/logo.ico" +html_logo = "_static/logo.png" html_theme_options = { - "use_download_button": True, - "repository_url": "https://github.com/opacities/opacity", - "repository_branch": "main", - "path_to_docs": "docs", + "logo": { + "text": "opacity", + "image": "_static/logo.png", + }, + "icon_links": [ + { + "name": "GitHub", + "url": "https://github.com/opacities/opacity", + "icon": "fa-brands fa-square-github", + "type": "fontawesome", + } + ] } numpydoc_show_class_members = False diff --git a/docs/index.rst b/docs/index.rst index e92f48c..cad6757 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -9,6 +9,7 @@ This package is currently under construction. You shouldn't rely on backwards co :maxdepth: 1 :caption: Contents: + getting_started.rst api.rst diff --git a/opacity/tests/test_dataset.py b/opacity/tests/test_dataset.py index de7d154..1f0dfe1 100644 --- a/opacity/tests/test_dataset.py +++ b/opacity/tests/test_dataset.py @@ -35,12 +35,31 @@ ('VO', 'pressure', grid1460_pressure), ] ) -def test_open_dataset_coordinates(tmpdir, species, coord, expected): +def test_open_dataset_cache_coordinates(tmpdir, species, coord, expected): tmp_path = os.path.join(tmpdir, species + '.zarr') local_cache_store = zarr.storage.LocalStore(tmp_path) ds = open_dataset( species=species, + cache_path=tmp_path, local_cache_store=local_cache_store, max_cache_size_gb=1e-3 ) assert all(ds[coord] == expected) + + +@pytest.mark.remote_data +@pytest.mark.parametrize( + "species, coord, expected", [ + ('H2O', 'temperature', grid1460_temperature), + ('H2O', 'pressure', grid1460_pressure), + ('VO', 'temperature', grid1460_temperature), + ('VO', 'pressure', grid1460_pressure), + ] +) +def test_open_dataset_nocache_coordinates(tmpdir, species, coord, expected): + ds = open_dataset( + species=species, + cache=False, + max_cache_size_gb=1e-3 + ) + assert all(ds[coord] == expected) diff --git a/pyproject.toml b/pyproject.toml index f9d21b4..98577c5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,7 @@ test = [ docs = [ "sphinx", "sphinx-automodapi", - "sphinx-book-theme>=0.3.3", + "sphinx-book-theme", "numpydoc", "matplotlib", ]