Skip to content

Feature/667 zarr 3 support #668

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

Merged
merged 7 commits into from
Apr 9, 2025
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: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@
- renaming `PreConditioner` -> `Preconditioner`
- fit to `TensorOperator`
[PR #601](https://github.com/aai-institute/pyDVL/pull/601)
- Bumped `zarr` dependency to v3
[PR #668](https://github.com/aai-institute/pyDVL/pull/668)


## 0.9.2 - 🏗 Bug fixes, logging improvement
Expand Down
3 changes: 0 additions & 3 deletions requirements-constraints.txt

This file was deleted.

4 changes: 3 additions & 1 deletion requirements-extras.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ dask>=2023.5.0
distributed>=2023.5.0
ray>=0.8
torch>=2.0.0
zarr>=2.16.1,<3
zarr>=2,<3; python_version<'3.11'
numcodecs<0.16.0; python_version<'3.11'
zarr>=3,<4; python_version>='3.11'
pymemcache>=3
5 changes: 3 additions & 2 deletions requirements-notebooks.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ pillow==10.4.0
torch==2.2.0
torchvision==0.17.0
transformers==4.44.2
zarr==2.16.1
-c requirements-constraints.txt
zarr>=2,<3; python_version<'3.11'
numcodecs<0.16.0; python_version<'3.11'
zarr>=3,<4; python_version>='3.11'
2 changes: 1 addition & 1 deletion requirements-type-checking.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
mypy==1.15.0
types-tqdm==4.67.0.20241221
pandas-stubs
-c requirements-constraints.txt
numpy<2
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
"torch>=2.0.0",
"dask>=2023.5.0",
"distributed>=2023.5.0",
"zarr>=2.16.1,<3",
"zarr>=2,<3; python_version<'3.11'",
"numcodecs<0.16.0; python_version<'3.11'",
"zarr>=3,<4; python_version>='3.11'",
],
"ray": ["ray>=0.8"],
},
Expand Down
8 changes: 4 additions & 4 deletions tests/influence/test_influence_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
import numpy as np
import pytest
import torch
import zarr
from distributed import Client
from torch import nn
from torch.utils.data import DataLoader, TensorDataset
from zarr.storage import MemoryStore

from pydvl.influence import DaskInfluenceCalculator, InfluenceMode
from pydvl.influence.base_influence_function_model import (
Expand Down Expand Up @@ -306,7 +306,7 @@ def test_sequential_calculator(model_and_data, test_case, mocker):

torch_factors = inf_model.influence_factors(x_test, y_test)

zarr_factors_store = zarr.MemoryStore()
zarr_factors_store = MemoryStore()
seq_factors_from_zarr = seq_factors_lazy_array.to_zarr(
zarr_factors_store, TorchNumpyConverter(), return_stored=True
)
Expand All @@ -331,7 +331,7 @@ def test_sequential_calculator(model_and_data, test_case, mocker):
seq_values_from_factors = seq_values_from_factors_lazy_array.compute(
aggregator=NestedTorchCatAggregator()
)
zarr_values_from_factors_store = zarr.MemoryStore()
zarr_values_from_factors_store = MemoryStore()
seq_values_from_factors_from_zarr = seq_values_from_factors_lazy_array.to_zarr(
zarr_values_from_factors_store, TorchNumpyConverter(), return_stored=True
)
Expand All @@ -347,7 +347,7 @@ def test_sequential_calculator(model_and_data, test_case, mocker):
)
seq_values = seq_values_lazy_array.compute(aggregator=NestedTorchCatAggregator())

zarr_values_store = zarr.MemoryStore()
zarr_values_store = MemoryStore()
seq_values_from_zarr = seq_values_lazy_array.to_zarr(
zarr_values_store, TorchNumpyConverter(), return_stored=True
)
Expand Down
Loading