zarr-python icon indicating copy to clipboard operation
zarr-python copied to clipboard

Resolve Mypy erorrs in `v3` branch

Open DahnJ opened this issue 1 year ago • 4 comments

Attempts to address https://github.com/zarr-developers/zarr-python/issues/1593

There are still two unsolved issues around the nonexistant Store.from_path in core.py.

TODO:

  • [ ] Add unit tests and/or doctests in docstrings
  • [ ] Add docstrings and API docs for any new/modified user-facing classes and functions
  • [ ] New/modified features documented in docs/tutorial.rst
  • [ ] Changes documented in docs/release.rst
  • [ ] GitHub Actions have all passed
  • [ ] Test coverage is 100% (Codecov passes)

DahnJ avatar Mar 04 '24 18:03 DahnJ

Thanks, @DahnJ. I've launched the workflows.

joshmoore avatar Mar 05 '24 09:03 joshmoore

Thanks @joshmoore I tried to fix a failing test (which I think happened because Any was used in a Pydantic model), can you launch them again please?

DahnJ avatar Mar 05 '24 10:03 DahnJ

On their way! 🏇🏽

joshmoore avatar Mar 05 '24 10:03 joshmoore

@jhamman I have addressed the comments in https://github.com/zarr-developers/zarr-python/pull/1692/commits/a30af88060b2db34717679e00c29cf2a03ddd265

I was not sure how to handle the second Store.from_path() reference. What should happen if the store_like argument is of type str? I tried to make a potential suggestion based on a commented-out code in https://github.com/zarr-developers/zarr-python/pull/1692/commits/f57527a2f142941ebce09b924bae0933f1885a5e. Let me please know if this is the correct way of handling that case.

As for getting mypy to pass, it does pass for me locally and I didn't add any type: ignore lines. However, there already are a few in zarr/v3 – I removed some more in https://github.com/zarr-developers/zarr-python/pull/1692/commits/e1fdd1ee231f134724f42b9072ea8e684407ec4b and then turned on mypy in pre-commit in https://github.com/zarr-developers/zarr-python/pull/1692/commits/db6da340ccafc0267d054a8002c3ee892483b724.

DahnJ avatar Mar 19 '24 22:03 DahnJ

@DahnJ - I think this is a great step forward. I want @d-v-b to review this but from my perspective, it could go in now, even with the outstanding store issue.

jhamman avatar Apr 06 '24 04:04 jhamman

This looks good! There's some overlap with stuff I did over in #1743, but that's not a problem. I will merge and rebase #1743 on this.

d-v-b avatar Apr 06 '24 08:04 d-v-b

thanks @DahnJ !

d-v-b avatar Apr 06 '24 08:04 d-v-b