Skip to content

Commit 72aac59

Browse files
authored
Merge pull request #35 from aldanor/feature/0.3.0
0.5.0 release
2 parents 9d8fe6e + aac7461 commit 72aac59

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+183
-168
lines changed

CHANGELOG.md

+23-13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Changelog
22

3-
## 0.3.0-alpha.1 (unreleased)
3+
## 0.5.0
44

55
### Added
66

@@ -20,7 +20,7 @@
2020
- Added support for MPIO driver (HDF5 has to be built with H5_HAVE_PARALLEL and
2121
the crate has to be built with "mpio" feature enabled).
2222
- Added support for direct VFD driver (HDF5 has to be built with H5_HAVE_DIRECT).
23-
- Added some missing bindings to `libhdf5-sys`: driver-related FAPL bindings
23+
- Added some missing bindings to `hdf5-sys`: driver-related FAPL bindings
2424
in h5p/h5fd (including MPIO and direct VFD drivers), MPIO bindings in h5p/h5f/h5fd.
2525
- Added core reading/writing API in `Container`, with support for reading/writing scalars,
2626
1-d, 2-d, and dynamic-dimensional arrays, and raw slices. As a side effect, the main crate
@@ -32,10 +32,13 @@
3232

3333
### Changed
3434

35+
- Renamed `hdf5-rs` crate (importable as `h5`) to `hdf5` (importable simply as `hdf5`).
36+
- Renamed `libhdf5-sys` crate to `hdf5-sys` (importable as `hdf5_sys`).
37+
- Renamed GitHub repository to `aldanor/hdf5-rust`.
3538
- Updated the bindings and tests to the latest HDF5 versions (1.10.4 and 1.8.21).
3639
- The build system has been reworked from the ground up:
37-
- `libhdf5-lib` crate has been removed; all of the build-time logic now resides
38-
in the build script of `libhdf5-sys`.
40+
- `hdf5-lib` crate has been removed; all of the build-time logic now resides
41+
in the build script of `hdf5-sys`.
3942
- The environment variables the build script reacts to are now `HDF5_DIR` and `HDF5_VERSION`.
4043
- `pkg-config` is now only launched on Linux.
4144
- On macOS, the build scripts detects Homebrew installations, for both 1.8 and 1.10 versions.
@@ -44,7 +47,7 @@
4447
- A few definitions from `H5pubconf.h` are now exposed as cfg definitions, like
4548
`h5_have_parallel`, `h5_have_threadsafe` and `h5_have_direct` (this requires us to
4649
locate the include folder and parse the header at build time).
47-
- Various clean ups in `libhdf5-sys`: implemented `Default` and `Clone` where
50+
- Various clean ups in `hdf5-sys`: implemented `Default` and `Clone` where
4851
applicable, moved a few types and methods to matching parent modules.
4952
- Major refactor: trait-based type hierarchy has been replaced with a `Deref`-based
5053
hierarchy instead (53eff4f). `ID` and `FromID` traits have been removed. Traits like `Location`,
@@ -66,10 +69,17 @@
6669

6770
### Removed
6871

69-
- Removed `libhdf5-lib` crate (merged it into `libhdf5-sys`, see above).
72+
- Removed `hdf5-lib` crate (merged it into `hdf5-sys`, see above).
7073
- Removed `remutex` crate, using locking primitives from `parking_lot` crate instead.
7174
- `Container` trait has been removed, all of its functionality merged into `Group` type.
7275

76+
### Notes
77+
78+
- The version number jump is due to renaming crates `hdf5-rs` and `libhdf5-sys` to `hdf5` and
79+
`hdf5-sys`, respectively. Since there were already published crates with those names and
80+
the crates registry is meant to be immutable even if the crates are yanked, we had to
81+
bump the version so that it shadows all of the older versions.
82+
7383
## 0.2.0 (Apr 17, 2016)
7484

7585
### Added
@@ -81,19 +91,19 @@
8191
the `bin` folder of HDF5 installation, the library directory will be inferred automatically.
8292
The official HDF5 installers add the `bin` folder to user path, so the official MSVC releases
8393
should just work out of the box without having to set any environment variables.
84-
- The library is now split into three crates: `libhdf5-lib` (requests linkage to HDF5),
85-
`libhdf5-sys` (contains bindings, requires `libhdf5-lib` at build time in order to conditionally
86-
enable or disable certain HDF5 functionality), and `hdf5-rs` (the user-facing crate, requires
94+
- The library is now split into three crates: `hdf5-lib` (requests linkage to HDF5),
95+
`hdf5-sys` (contains bindings, requires `hdf5-lib` at build time in order to conditionally
96+
enable or disable certain HDF5 functionality), and `hdf5` (the user-facing crate, requires
8797
both lower-level crates at build time).
88-
- Added `h5::hdf5_version` function.
98+
- Added `hdf5::hdf5_version` function.
8999
- The minimum required version of the HDF5 library is now 1.8.4.
90-
- Both `libhdf5-sys` and `hdf5-rs` crates can now use version attributes at compile time to
100+
- Both `hdf5-sys` and `hdf5` crates can now use version attributes at compile time to
91101
enable/disable/change functionality. All functions and definitions that appeared in HDF5 versions
92-
past 1.8.4 are now conditionally enabled in `libhdf5-sys`.
102+
past 1.8.4 are now conditionally enabled in `hdf5-sys`.
93103
- Added bindings for HDF5 functions that were added in releases 1.8.15 and 1.8.16.
94104
- Static global variables in HDF5 (H5E, H5P, H5T) are now linked based on HDF5 version and not
95105
the target platform (`_ID_g` variables were introduced in 1.8.14). When `msvc` target is used,
96-
the dllimport stub prefixes are also accounted for. The constants exposed by `libhdf5-sys` are
106+
the dllimport stub prefixes are also accounted for. The constants exposed by `hdf5-sys` are
97107
now of reference type and need to be dereferenced upon use (for `msvc`, they have to be
98108
dereferenced twice).
99109

Cargo.toml

+11-14
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,36 @@
11
[package]
2-
name = "hdf5-rs"
3-
version = "0.2.0"
2+
name = "hdf5"
3+
version = "0.5.0"
44
authors = ["Ivan Smirnov <[email protected]>"]
55
keywords = ["hdf5"]
66
license = "MIT/Apache-2.0"
77
readme = "README.md"
88
description = "Thread-safe Rust bindings for the HDF5 library."
9-
repository = "https://github.com/aldanor/hdf5-rs"
10-
homepage = "https://github.com/aldanor/hdf5-rs"
9+
repository = "https://github.com/aldanor/hdf5-rust"
10+
homepage = "https://github.com/aldanor/hdf5-rust"
1111
build = "build.rs"
1212
edition = "2018"
1313

14-
[lib]
15-
name = "h5"
16-
1714
[features]
1815
default = []
19-
mpio = ["mpi-sys", "libhdf5-sys/mpio"]
16+
mpio = ["mpi-sys", "hdf5-sys/mpio"]
2017

2118
[workspace]
22-
members = ["hdf5-types", "hdf5-derive", "libhdf5-sys"]
19+
members = ["hdf5-types", "hdf5-derive", "hdf5-sys"]
2320
exclude = ["*.yml", "ci/*"]
2421

2522
[dependencies]
2623
bitflags = "1.0"
27-
lazy_static = "1.2"
24+
lazy_static = "1.3"
2825
libc = "0.2"
2926
parking_lot = "0.7"
3027
ndarray = "0.12"
3128
num-integer = "0.1"
3229
num-traits = "0.2"
3330
mpi-sys = { version = "0.1", optional = true }
34-
libhdf5-sys = { path = "libhdf5-sys", version = "0.2.0" }
35-
hdf5-types = { path = "hdf5-types", version = "0.2.0" }
36-
hdf5-derive = { path = "hdf5-derive", version = "0.2.0" }
31+
hdf5-sys = { path = "hdf5-sys", version = "0.5.0" }
32+
hdf5-types = { path = "hdf5-types", version = "0.5.0" }
33+
hdf5-derive = { path = "hdf5-derive", version = "0.5.0" }
3734

3835
[dev-dependencies]
3936
mashup = "0.1"
@@ -43,4 +40,4 @@ scopeguard = "1.0"
4340
tempdir = "0.3"
4441

4542
[build-dependencies]
46-
libhdf5-sys = { path = "libhdf5-sys", version = "0.2.0" }
43+
hdf5-sys = { path = "hdf5-sys", version = "0.5.0" }

README.md

+24-16
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,47 @@
1-
# hdf5-rs
1+
# `hdf5`
22

3-
[![Build Status](https://img.shields.io/travis/aldanor/hdf5-rs.svg)](https://travis-ci.org/aldanor/hdf5-rs) [![Appveyor Build Status](https://img.shields.io/appveyor/ci/aldanor/hdf5-rs.svg)](https://ci.appveyor.com/project/aldanor/hdf5-rs)
3+
[![Build Status](https://img.shields.io/travis/aldanor/hdf5-rust.svg)](https://travis-ci.org/aldanor/hdf5-rust) [![Appveyor Build Status](https://img.shields.io/appveyor/ci/aldanor/hdf5-rust.svg)](https://ci.appveyor.com/project/aldanor/hdf5-rust)
44

5-
[Documentation](https://docs.rs/crate/hdf5-rs)
6-
[Changelog](https://github.com/aldanor/hdf5-rs/blob/master/CHANGELOG.md)
5+
[Documentation](https://docs.rs/crate/hdf5)
6+
[Changelog](https://github.com/aldanor/hdf5-rust/blob/master/CHANGELOG.md)
77

8-
Thread-safe Rust bindings and high-level wrappers for the HDF5 library API.
8+
The `hdf5` crate (previously known as `hdf5-rs`) provides thread-safe Rust bindings and
9+
high-level wrappers for the HDF5 library API. Some of the features include:
10+
11+
- Thread-safety with non-threadsafe libhdf5 builds guaranteed via reentrant mutexes.
12+
- Native representation of most HDF5 types, including variable-length strings and arrays.
13+
- Derive-macro for automatic mapping of user structs and enums to HDF5 types.
14+
- Multi-dimensional array reading/writing interface via `ndarray`.
15+
16+
Direct low-level bindings are also available and are provided in the `hdf5-sys` crate.
917

1018
Requires HDF5 library of version 1.8.4 or later.
1119

1220
## Example
1321

1422
```rust
15-
#[derive(h5::H5Type, Clone, PartialEq, Debug)]
23+
#[derive(hdf5::H5Type, Clone, PartialEq, Debug)]
1624
#[repr(u8)]
1725
pub enum Color {
1826
RED = 1,
1927
GREEN = 2,
2028
BLUE = 3,
2129
}
2230

23-
#[derive(h5::H5Type, Clone, PartialEq, Debug)]
31+
#[derive(hdf5::H5Type, Clone, PartialEq, Debug)]
2432
#[repr(C)]
2533
pub struct Pixel {
2634
xy: (i64, i64),
2735
color: Color,
2836
}
2937

30-
fn main() -> h5::Result<()> {
38+
fn main() -> hdf5::Result<()> {
3139
use self::Color::*;
3240
use ndarray::{arr1, arr2};
3341

3442
{
3543
// write
36-
let file = h5::File::open("pixels.h5", "w")?;
44+
let file = hdf5::File::open("pixels.h5", "w")?;
3745
let colors = file.new_dataset::<Color>().create("colors", 2)?;
3846
colors.write(&[RED, BLUE])?;
3947
let group = file.create_group("dir")?;
@@ -45,7 +53,7 @@ fn main() -> h5::Result<()> {
4553
}
4654
{
4755
// read
48-
let file = h5::File::open("pixels.h5", "r")?;
56+
let file = hdf5::File::open("pixels.h5", "r")?;
4957
let colors = file.dataset("colors")?;
5058
assert_eq!(colors.read_1d::<Color>()?, arr1(&[RED, BLUE]));
5159
let pixels = file.dataset("dir/pixels")?;
@@ -67,12 +75,12 @@ fn main() -> h5::Result<()> {
6775

6876
### Platforms
6977

70-
`hdf5-rs` is known to run on these platforms: Linux, macOS, Windows (tested on Travis CI and
71-
AppVeyor, HDF5 1.8 and 1.10, system installations and conda environments).
78+
`hdf5` crate is known to run on these platforms: Linux, macOS, Windows (tested on Travis
79+
CI and AppVeyor, HDF5 1.8 and 1.10, system installations and conda environments).
7280

7381
### Rust
7482

75-
`hdf5-rs` is tested continuously for all three official release channels, and requires
83+
`hdf5` crate is tested continuously for all three official release channels, and requires
7684
a modern Rust compiler (e.g. of version 1.31 or later).
7785

7886
### HDF5
@@ -84,7 +92,7 @@ threadsafe option enabled.
8492

8593
### HDF5 version
8694

87-
Build scripts for both `libhdf5-sys` and `hdf5-rs` crates check the actual version of the
95+
Build scripts for both `hdf5-sys` and `hdf5` crates check the actual version of the
8896
HDF5 library that they are being linked against, and some functionality may be conditionally
8997
enabled or disabled at compile time. While this allows supporting multiple versions of HDF5
9098
in a single codebase, this is something the library user should be aware of in case they
@@ -127,7 +135,7 @@ unless `HDF5_VERSION` is set.
127135

128136
### Windows
129137

130-
`hdf5-rs` fully supports MSVC toolchain, which allows using the
138+
`hdf5` crate fully supports MSVC toolchain, which allows using the
131139
[official releases](https://www.hdfgroup.org/downloads/index.html) of
132140
HDF5 and is generally the recommended way to go. That being said, previous experiments have
133141
shown that all tests pass on the `gnu` target as well, one just needs to be careful with
@@ -149,6 +157,6 @@ Few things to note when building on Windows:
149157

150158
## License
151159

152-
`hdf5-rs` is primarily distributed under the terms of both the MIT license and the
160+
`hdf5` crate is primarily distributed under the terms of both the MIT license and the
153161
Apache License (Version 2.0). See [LICENSE-APACHE](LICENSE-APACHE) and
154162
[LICENSE-MIT](LICENSE-MIT) for details.

build.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
fn main() {
2-
libhdf5_sys::emit_cfg_flags();
2+
hdf5_sys::emit_cfg_flags();
33
}

hdf5-derive/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "hdf5-derive"
3-
version = "0.2.0"
3+
version = "0.5.0"
44
authors = ["Ivan Smirnov <[email protected]>"]
55
edition = "2018"
66

@@ -11,7 +11,7 @@ proc-macro = true
1111
proc-macro2 = "0.4"
1212
quote = "0.6"
1313
syn = { version = "0.15", features = ["derive", "extra-traits"]}
14-
hdf5-types = { path = "../hdf5-types", version = "0.2.0" }
14+
hdf5-types = { path = "../hdf5-types", version = "0.5.0" }
1515

1616
[dev-dependencies]
1717
compiletest_rs = { version = "0.3.18", features = ["stable"] }

libhdf5-sys/Cargo.toml renamed to hdf5-sys/Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[package]
2-
name = "libhdf5-sys"
3-
version = "0.2.0"
2+
name = "hdf5-sys"
3+
version = "0.5.0"
44
authors = ["Ivan Smirnov <[email protected]>"]
55
keywords = ["hdf5"]
66
license = "MIT/Apache-2.0"
77
build = "build.rs"
8-
repository = "https://github.com/aldanor/hdf5-rs"
9-
homepage = "https://github.com/aldanor/hdf5-rs"
8+
repository = "https://github.com/aldanor/hdf5-rust"
9+
homepage = "https://github.com/aldanor/hdf5-rust"
1010
description = "Native bindings to the HDF5 library."
1111
edition = "2018"
1212

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

hdf5-types/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "hdf5-types"
3-
version = "0.2.0"
3+
version = "0.5.0"
44
authors = ["Ivan Smirnov <[email protected]>"]
55
edition = "2018"
66

src/error.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use num_integer::Integer;
88
use num_traits::{Bounded, Zero};
99
use parking_lot::Mutex;
1010

11-
use libhdf5_sys::h5e::{
11+
use hdf5_sys::h5e::{
1212
H5E_error2_t, H5Eclose_stack, H5Eget_current_stack, H5Eget_msg, H5Eprint2, H5Eset_auto2,
1313
H5Ewalk2, H5E_DEFAULT, H5E_WALK_DOWNWARD,
1414
};
@@ -304,7 +304,7 @@ where
304304

305305
#[cfg(test)]
306306
pub mod tests {
307-
use libhdf5_sys::h5p::{H5Pclose, H5Pcreate};
307+
use hdf5_sys::h5p::{H5Pclose, H5Pcreate};
308308

309309
use crate::globals::H5P_ROOT;
310310
use crate::internal_prelude::*;

src/filters.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::globals::H5P_DATASET_CREATE;
22
use crate::internal_prelude::*;
33

4-
use libhdf5_sys::{
4+
use hdf5_sys::{
55
h5p::{
66
H5Pcreate, H5Pget_filter2, H5Pget_nfilters, H5Pset_deflate, H5Pset_fletcher32,
77
H5Pset_scaleoffset, H5Pset_shuffle, H5Pset_szip,

src/globals.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ use std::mem;
55
use lazy_static::lazy_static;
66

77
#[cfg(h5_have_direct)]
8-
use libhdf5_sys::h5fd::H5FD_direct_init;
8+
use hdf5_sys::h5fd::H5FD_direct_init;
99
#[cfg(h5_have_parallel)]
10-
use libhdf5_sys::h5fd::H5FD_mpio_init;
11-
use libhdf5_sys::h5fd::{
10+
use hdf5_sys::h5fd::H5FD_mpio_init;
11+
use hdf5_sys::h5fd::{
1212
H5FD_core_init, H5FD_family_init, H5FD_log_init, H5FD_multi_init, H5FD_sec2_init,
1313
H5FD_stdio_init,
1414
};
@@ -19,9 +19,9 @@ use crate::internal_prelude::*;
1919
macro_rules! link_hid {
2020
($rust_name:ident, $mod_name:ident::$c_name:ident) => {
2121
lazy_static! {
22-
pub static ref $rust_name: ::libhdf5_sys::h5i::hid_t = {
23-
h5lock!(::libhdf5_sys::h5::H5open());
24-
*::libhdf5_sys::$mod_name::$c_name
22+
pub static ref $rust_name: ::hdf5_sys::h5i::hid_t = {
23+
h5lock!(::hdf5_sys::h5::H5open());
24+
*::hdf5_sys::$mod_name::$c_name
2525
};
2626
}
2727
};
@@ -32,9 +32,9 @@ macro_rules! link_hid {
3232
macro_rules! link_hid {
3333
($rust_name:ident, $mod_name:ident::$c_name:ident) => {
3434
lazy_static! {
35-
pub static ref $rust_name: ::libhdf5_sys::h5i::hid_t = {
36-
h5lock!(::libhdf5_sys::h5::H5open());
37-
unsafe { *(*::libhdf5_sys::$mod_name::$c_name as *const _) }
35+
pub static ref $rust_name: ::hdf5_sys::h5i::hid_t = {
36+
h5lock!(::hdf5_sys::h5::H5open());
37+
unsafe { *(*::hdf5_sys::$mod_name::$c_name as *const _) }
3838
};
3939
}
4040
};
@@ -359,7 +359,7 @@ lazy_static! {
359359
mod tests {
360360
use std::mem;
361361

362-
use libhdf5_sys::{h5::haddr_t, h5i::H5I_INVALID_HID};
362+
use hdf5_sys::{h5::haddr_t, h5i::H5I_INVALID_HID};
363363

364364
use super::{
365365
H5E_DATASET, H5E_ERR_CLS, H5P_LST_LINK_ACCESS_ID, H5P_ROOT, H5R_DSET_REG_REF_BUF_SIZE,

src/handle.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::sync::Arc;
44
use lazy_static::lazy_static;
55
use parking_lot::{Mutex, RwLock};
66

7-
use libhdf5_sys::h5i::{H5I_type_t, H5Idec_ref, H5Iget_type, H5Iinc_ref, H5Iis_valid};
7+
use hdf5_sys::h5i::{H5I_type_t, H5Idec_ref, H5Iget_type, H5Iinc_ref, H5Iis_valid};
88

99
use crate::internal_prelude::*;
1010

src/hl/container.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ use std::ops::Deref;
55
use ndarray::{Array, Array1, Array2, ArrayD, ArrayView, ArrayView1};
66
use ndarray::{SliceInfo, SliceOrIndex};
77

8-
use libhdf5_sys::h5a::{H5Aget_space, H5Aget_storage_size, H5Aget_type, H5Aread, H5Awrite};
9-
use libhdf5_sys::h5d::{H5Dget_space, H5Dget_storage_size, H5Dget_type, H5Dread, H5Dwrite};
8+
use hdf5_sys::h5a::{H5Aget_space, H5Aget_storage_size, H5Aget_type, H5Aread, H5Awrite};
9+
use hdf5_sys::h5d::{H5Dget_space, H5Dget_storage_size, H5Dget_type, H5Dread, H5Dwrite};
1010

1111
use crate::internal_prelude::*;
1212

0 commit comments

Comments
 (0)