Skip to content
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 .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
opacity/version.py

.DS_Store

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
1 change: 1 addition & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ python:
path: .
extra_requirements:
- docs
- all
10 changes: 8 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -11,5 +19,3 @@ MAESTRO
* `About MAESTRO <https://github.com/opacities/.github/blob/main/profile/README.md>`_
* `Submit your opacity grid to MAESTRO <https://github.com/opacities/submit-data>`_



Binary file added docs/_static/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 13 additions & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
21 changes: 20 additions & 1 deletion opacity/tests/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ test = [
docs = [
"sphinx",
"sphinx-automodapi",
"sphinx-book-theme>=0.3.3",
"sphinx-book-theme",
"numpydoc",
"matplotlib",
]
Expand Down
Loading