Uh oh!
There was an error while loading. Please reload this page.
Add hypothesis property tests - #1746
Conversation
Hello @dcherian! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2024-04-05 17:47:12 UTC |
| elif path == "/": | ||
| assert name is not None | ||
| array_path = name | ||
| array_name = "/" + name | ||
| else: | ||
| assert name is not None | ||
| array_path = f"{path}/{name}" | ||
| array_name = "/" + array_path |
Uh oh!
There was an error while loading. Please reload this page.
1. Roundtrip a numpy array 2. Basic Indexing
This is important for zarr-developers#1931
This reverts commit 2ad1b35.
dcherian
commented
Jun 5, 2024
Some input needed:
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| # TODO: clean this up | ||
| if path is None and name is None: |
There was a problem hiding this comment.
Can this mess be cleaned up?
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
* v3: (22 commits) [v3] `Buffer` ensure correct subclass based on the `BufferPrototype` argument (zarr-developers#1974) Fix doc build (zarr-developers#1987) Fix doc build warnings (zarr-developers#1985) Automatically generate API reference docs (zarr-developers#1918) Update `RemoteStore.__str__` and add UPath tests (zarr-developers#1964) [v3] Elevate codec pipeline (zarr-developers#1932) 0 dim arrays: indexing (zarr-developers#1980) `parse_shapelike` allows 0 (zarr-developers#1979) Clean up typing and docs for indexing (zarr-developers#1961) add json indentation to config (zarr-developers#1952) chore: update pre-commit hooks (zarr-developers#1973) Bump pypa/gh-action-pypi-publish in the actions group (zarr-developers#1969) chore: update pre-commit hooks (zarr-developers#1957) Update release.rst (zarr-developers#1960) doc: update release notes for 3.0.0.alpha (zarr-developers#1959) Basic working FsspecStore (zarr-developers#1785) Feature: Top level V3 API (zarr-developers#1884) Buffer Prototype Argument (zarr-developers#1910) Create issue-metrics.yml fixes bug in transpose (zarr-developers#1949) ...
* v3: Allow 'chunks' as an alias for 'chunk_shape' in array creation. (zarr-developers#1991)
* v3: (22 commits) chore: update pre-commit hooks (zarr-developers#2051) Apply ruff/flake8-bandit rule B006 (zarr-developers#2049) Move fixtures to `tests` (zarr-developers#1813) Multiple imports for an import name (zarr-developers#2047) Redundant list comprehension (zarr-developers#2048) chore: update pre-commit hooks (zarr-developers#2039) Cast fill value to array's dtype (zarr-developers#2020) chore: update pre-commit hooks (zarr-developers#2017) make shardingcodec pickleable (zarr-developers#2011) doc: copy 3.0.0.alpha changelog into release.rst (zarr-developers#2007) build(ci): enable python 3.12 in github actions (zarr-developers#2005) Bump NumPy to 2.0 (zarr-developers#1983) chore: update pre-commit hooks (zarr-developers#1989) Fix indexing with bools (zarr-developers#1968) Fix string interpolation (zarr-developers#1998) Unnecessary comprehension (zarr-developers#1997) Stop ignoring these ruff rules (zarr-developers#2001) Merge collapsible if statements (zarr-developers#1999) Unnecessary comprehension (zarr-developers#1996) Handle Path in `make_store_path` (zarr-developers#1992) ...
Uh oh!
There was an error while loading. Please reload this page.
dcherian
commented
Aug 5, 2024
This looks like a real failure: Apparently it is not roundtripping |
d-v-b
commented
Aug 5, 2024
definitely! Given that I know nothing about hypothesis, how can I replicate this failure locally? |
dcherian
commented
Aug 5, 2024
This may be user error. It's sensitive to the importzarrfromzarr.arrayimportArrayfromzarr.groupimportGroupfromzarr.storeimportMemoryStoreimportnumpyasnpstore=MemoryStore(mode="w")
root=Group.create(store)
nparray=np.array([1], dtype=np.int8)
a=root.create_array(
"/0/0",
shape=nparray.shape,
chunks=(1,),
dtype=nparray.dtype.str,
attributes={},
# compressor=compressor, # TODO: FIXMEfill_value=nparray.dtype.type(0),
)
a[:] =nparrayprint(a[:]) # [1]store.close()
print(a[:]) # [0] |
d-v-b
commented
Aug 5, 2024
I can replicate this locally. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
dcherian
commented
Aug 8, 2024
pre-commit.ci autofix |
After
mamba install hypothesisUse
to see all the things it tries.
This was a quick attempt at a property test.
The other thing you can do is a "Stateful" test (e.g. https://github.com/pydata/xarray/blob/main/properties/test_index_manipulation.py)
which runs an arbitrary sequence of manipulations (e.g. add array, rename, move, delete, modify array, copy), and checks for consistency at each point.
cc @Zac-HD
TODO: