aldanor / hdf5-rust

HDF5 for Rust
https://docs.rs/hdf5
Apache License 2.0
310 stars 85 forks source link

Use TryFrom over From #147

Closed mulimoen closed 3 years ago

mulimoen commented 3 years ago

This changes the From implementations of SliceOrIndex/Hyperslab/Selection to TryFrom.

SliceOrIndex is now reworked to only accept parameters resulting in valid selections. The old code for working with negative strides in selections to allow python like negative indexing has been removed, which removed a lot of the special casing to allow for this.

A future addition could be to introduce a hyperslab macro which mirrors ndarray::s, but allows the size of the block to be selected.

Fixes #142

aldanor commented 3 years ago

@mulimoen Any changes/updates to this, do we want to rebase/merge it? (should changelog be updated then?)

mulimoen commented 3 years ago

This change is orthogonal to all other PRs. There is need for changes in the CHANGELOG, this overwrites the unreleased Extents and friends

aldanor commented 3 years ago

Yea, make sense, I've misread it. Could you rebase (just in case)? We'll wait till it's green and then merge

mulimoen commented 3 years ago

@aldanor Rebased and green

aldanor commented 3 years ago

👍