- Removed broken links from docs.
- Updated to
ndarray
0.16. - Updated to
zip
2. - Updated minimum Rust version to 1.64.
- Removed
unsafe
fromWritableElement
trait declaration. - Altered the behavior regarding
.npy
extensions of the file names within.npz
archives to match NumPy's behavior, by @jturner314. See #76. Specifically,NpzWriter::add_array()
now appends.npy
to the name.NpzReader::names()
now strips a single.npy
(if present) from the end of each name.NpzReader::by_name()
now tries{name}.npy
if{name}
is not present in the archive.
- Added
NpzWriter::new_with_options()
, which allows for different compression options, etc., when writing.npz
files. By @DCNick3. See #66 for the motivation.
- Added support for complex floating point element types with the new
num-complex-0_4
feature.
- Updated to
ndarray
0.15. - Updated to
py_literal
0.4. - Updated to Rust 1.49.
- Added a
.finish()
method toNpzWriter
. All users ofNpzWriter
should call this method, after the write of the last array, in order to properly handle errors. (Without calling.finish()
, dropping will automatically attempt to finish the file, but errors will be silently ignored.) - Changed the
write_npy
convenience function and theNpzWriter::add_array
method to buffer writes usingBufWriter
. This significantly improves write performance for arrays which are not in standard or Fortran layout. The docs ofWriteNpyExt::write_npy
have also been updated to recommend that users wrap the writer in aBufWriter
. Thanks to @bluss for reporting the unbuffered writes issue and reviewing the PR. - Changed
WriteNpyExt::write_npy
to always call.flush()
before returning. This is convenient when the writer passed toWriteNpyExt::write_npy
is wrapped in aBufWriter
.
- Added support for viewing byte slices as
.npy
files, primarily for use with memory-mapped files. See theViewNpyExt
andViewMutNpyExt
extension traits. By @n3vu0r and @jturner314. - Added support for creating files larger than available memory with
write_zeroed_npy
. - Improved handling of overflow in the number of bytes to read as specified by
the shape and element type in the
.npy
file header. Before, if the number of bytes of data was more thanisize::MAX
, the implementation would attempt to create the array anyway and panic. Now, it detects this case before attempting to create the array and returnsErr(ReadNpyError::LengthOverflow)
instead.
- Updated to
ndarray
0.14. - Updated to Rust 1.42.
- Changed
write_npy
to take the array by reference instead of by value, by @KarelPeeters.
- Updated to
ndarray
0.13. - Updated to Rust 1.38.
- Added
read_npy
andwrite_npy
convenience functions. - Added support for
npy
format version 3.0. - Renamed
ReadableElement::read_vec
to::read_to_end_exact_vec
. - Refactored the error types and variants, including removing the associated
Error
type fromReadable/WritableElement
and updating to the new style ofstd::error::Error
implementation. - Updated the padding calculation to make the total header length be divisible by 64 instead of just 16 when writing files. (See numpy/numpy#9025.)
- Fixed determination of file format version when the addition of padding changes the required version when writing the file.
- Fixed miscellaneous bugs related to overflow and error handling.
- Added support for reading/writing arrays of
bool
, by @tobni and @jturner314. - Updated to
zip
0.5. - Updated to Rust 1.32.
- Renamed the
compressed_npz_default
feature tocompressed_npz
because thezip
crate no longer allows the user to select the compression backend.
- Updated to
ndarray
0.12. - Updated to
num-traits
0.2 (replacing dependency onnum
). - Updated to
py_literal
0.2.
- Updated to
zip
0.4. - Made the compression backend for compressed
.npz
files user-selectable. - Reworked how feature selection works. This should only affect you if you use
default-features = false, features = ["compressed_npz"]
.
- Improved crate documentation (no functional changes).
- Initial release.