Skip to content

Commit

Permalink
Merge branch 'main' into hdf5_reader
Browse files Browse the repository at this point in the history
  • Loading branch information
TomNicholas authored Nov 18, 2024
2 parents 5b085a6 + c7970e2 commit 13f82f9
Show file tree
Hide file tree
Showing 23 changed files with 681 additions and 446 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repos:

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: "v0.6.9"
rev: "v0.7.2"
hooks:
# Run the linter.
- id: ruff
Expand Down
1 change: 1 addition & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ build:
# Build documentation in the doc/ directory with Sphinx
sphinx:
configuration: docs/conf.py
fail_on_warning: true

# Optionally declare the Python requirements required to build your docs
conda:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

**VirtualiZarr creates virtual Zarr stores for cloud-friendly access to archival data, using familiar xarray syntax.**

VirtualiZarr (pronounced like "virtualize" but more piratey) grew out of [discussions](https://github.com/fsspec/kerchunk/issues/377) on the [kerchunk repository](https://github.com/fsspec/kerchunk), and is an attempt to provide the game-changing power of kerchunk in a zarr-native way, and with a familiar array-like API.
VirtualiZarr (pronounced like "virtualizer" but more piratey) grew out of [discussions](https://github.com/fsspec/kerchunk/issues/377) on the [kerchunk repository](https://github.com/fsspec/kerchunk), and is an attempt to provide the game-changing power of kerchunk in a zarr-native way, and with a familiar array-like API.

You now have a choice between using VirtualiZarr and Kerchunk: VirtualiZarr provides [almost all the same features](https://virtualizarr.readthedocs.io/en/latest/faq.html#how-do-virtualizarr-and-kerchunk-compare) as Kerchunk.

Expand Down
2 changes: 1 addition & 1 deletion ci/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies:
- h5py
- hdf5
- netcdf4
- xarray>=2024.6.0
- xarray>=2024.10.0
- kerchunk>=0.2.5
- numpy>=2.0.0
- ujson
Expand Down
2 changes: 1 addition & 1 deletion ci/min-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dependencies:
- h5py
- hdf5
- netcdf4
- xarray>=2024.6.0
- xarray>=2024.10.0
- numpy>=2.0.0
- numcodecs
- packaging
Expand Down
3 changes: 1 addition & 2 deletions ci/upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ channels:
- conda-forge
- nodefaults
dependencies:
- xarray>=2024.10.0
- h5netcdf
- h5py
- hdf5
Expand All @@ -28,7 +29,5 @@ dependencies:
- pip
- pip:
- icechunk # Installs zarr v3 as dependency
- git+https://github.com/pydata/xarray@zarr-v3 # zarr-v3 compatibility branch
- git+https://github.com/zarr-developers/numcodecs@zarr3-codecs # zarr-v3 compatibility branch
# - git+https://github.com/fsspec/kerchunk@main # kerchunk is currently incompatible with zarr-python v3 (https://github.com/fsspec/kerchunk/pull/516)
- imagecodecs-numcodecs==2024.6.1
9 changes: 9 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ def netcdf4_file(tmpdir):
return filepath


@pytest.fixture
def netcdf4_file_with_2d_coords(tmpdir):
ds = xr.tutorial.open_dataset("ROMS_example")
filepath = f"{tmpdir}/ROMS_example.nc"
ds.to_netcdf(filepath, format="NETCDF4")
ds.close()
return filepath


@pytest.fixture
def netcdf4_virtual_dataset(netcdf4_file):
from virtualizarr import open_virtual_dataset
Expand Down
11 changes: 10 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,18 @@
"myst_nb",
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.extlinks",
"sphinx_copybutton",
"sphinx_togglebutton",
"sphinx_design",
"sphinx.ext.napoleon",
]

extlinks = {
"issue": ("https://github.com/zarr-developers/virtualizarr/issues/%s", "GH%s"),
"pull": ("https://github.com/zarr-developers/virtualizarr/pull/%s", "PR%s"),
"discussion": ("https://github.com/zarr-developers/virtualizarr/discussions/%s", "D%s"),
}

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
Expand All @@ -49,6 +55,9 @@
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False

# -- Myst Options -------------------------------------------------

myst_heading_anchors = 3

# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
Expand Down Expand Up @@ -78,7 +87,7 @@
'custom.css',
]

html_logo = "_static/_future_logo.png"
# html_logo = "_static/_future_logo.png"

html_static_path = ["_static"]

Expand Down
22 changes: 17 additions & 5 deletions docs/contributing.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Contributing

Contributions are welcome and encouraged! We ask only that all contributors follow the [Zarr Developers Code of Conduct](https://github.com/zarr-developers/.github/blob/main/CODE_OF_CONDUCT.md).

## Contributing code

Before opening a PR to contribute code you should check that your changes work by running the test suite locally.

```bash
mamba env create -f ci/environment.yml
mamba activate virtualizarr-tests
Expand All @@ -11,13 +15,18 @@ python -m pip install -e . --no-deps
python -m pytest ./virtualizarr --run-network-tests --cov=./ --cov-report=xml --verbose
```

The `--run-network-tests` argument is optional - it will run additional tests that require downloading files over the network. Skip this if you want the tests to run faster or you have no internet access.

## Contributing documentation

Whilst the CI will build the updated documentation for each PR, it can also be useful to check that the documentation has rendered as expected by building it locally.

### Build the documentation locally

```bash
mamba env create -f ci/doc.yml
mamba activate docs
mamba activate virtualizarr-docs
python -m pip install -e . # From project's root - needed to generate API docs
cd docs # From project's root
rm -rf generated
make clean
Expand All @@ -26,14 +35,17 @@ make html

### Access the documentation locally

Open `docs/_build/html/index.html` in a web browser
Open `docs/_build/html/index.html` in a web browser (on MacOS you can do this from the terminal using `open docs/_build/html/index.html`).

## Making a release

1. Navigate to the [https://github.com/zarr-developers/virtualizarr/releases](https://github.com/zarr-developers/virtualizarr/releases) release page.
Anyone with commit privileges to the repository can issue a release.

1. Navigate to the [https://github.com/zarr-developers/virtualizarr/releases](https://github.com/zarr-developers/virtualizarr/releases) releases page.
2. Select draft a new release.
3. Select 'Choose a tag', then 'create a new tag'
4. Enter the name for the new tag following the [EffVer](https://jacobtomlinson.dev/effver/) versioning scheme (e.g., releasing v0.2.0 as the next release denotes that “some small effort may be required to make sure this version works for you”).
4. Enter the name for the new tag following the [EffVer](https://jacobtomlinson.dev/effver/) versioning scheme (e.g., releasing v0.2.0 as the next release after v0.1.0 denotes that “some small effort may be required to make sure this version works for you”).
4. Click 'Generate Release Notes' to draft notes based on merged pull requests.
5. Edit the draft release notes for consistency.
6. Publish the release.
6. Select 'Publish' to publish the release. This should automatically upload the new release to PyPI and Conda-Forge.
7. Create and merge a PR to add a new empty section to the `docs/releases.rst` for the next release in the future.
Loading

0 comments on commit 13f82f9

Please sign in to comment.