Skip to content

Commit 4f1c74a

Browse files
committed
Rename “hdf5-rs” crate to “hdf5”
1 parent ddbcdb8 commit 4f1c74a

File tree

7 files changed

+69
-72
lines changed

7 files changed

+69
-72
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
`hdf5-sys` (contains bindings, requires `libhdf5-lib` at build time in order to conditionally
8686
enable or disable certain HDF5 functionality), and `hdf5-rs` (the user-facing crate, requires
8787
both lower-level crates at build time).
88-
- Added `h5::hdf5_version` function.
88+
- Added `hdf5::hdf5_version` function.
8989
- The minimum required version of the HDF5 library is now 1.8.4.
9090
- Both `hdf5-sys` and `hdf5-rs` crates can now use version attributes at compile time to
9191
enable/disable/change functionality. All functions and definitions that appeared in HDF5 versions

Cargo.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "hdf5-rs"
2+
name = "hdf5"
33
version = "0.2.0"
44
authors = ["Ivan Smirnov <[email protected]>"]
55
keywords = ["hdf5"]
@@ -11,9 +11,6 @@ homepage = "https://github.com/aldanor/hdf5-rs"
1111
build = "build.rs"
1212
edition = "2018"
1313

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

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,28 @@ Requires HDF5 library of version 1.8.4 or later.
1212
## Example
1313

1414
```rust
15-
#[derive(h5::H5Type, Clone, PartialEq, Debug)]
15+
#[derive(hdf5::H5Type, Clone, PartialEq, Debug)]
1616
#[repr(u8)]
1717
pub enum Color {
1818
RED = 1,
1919
GREEN = 2,
2020
BLUE = 3,
2121
}
2222

23-
#[derive(h5::H5Type, Clone, PartialEq, Debug)]
23+
#[derive(hdf5::H5Type, Clone, PartialEq, Debug)]
2424
#[repr(C)]
2525
pub struct Pixel {
2626
xy: (i64, i64),
2727
color: Color,
2828
}
2929

30-
fn main() -> h5::Result<()> {
30+
fn main() -> hdf5::Result<()> {
3131
use self::Color::*;
3232
use ndarray::{arr1, arr2};
3333

3434
{
3535
// write
36-
let file = h5::File::open("pixels.h5", "w")?;
36+
let file = hdf5::File::open("pixels.h5", "w")?;
3737
let colors = file.new_dataset::<Color>().create("colors", 2)?;
3838
colors.write(&[RED, BLUE])?;
3939
let group = file.create_group("dir")?;
@@ -45,7 +45,7 @@ fn main() -> h5::Result<()> {
4545
}
4646
{
4747
// read
48-
let file = h5::File::open("pixels.h5", "r")?;
48+
let file = hdf5::File::open("pixels.h5", "r")?;
4949
let colors = file.dataset("colors")?;
5050
assert_eq!(colors.read_1d::<Color>()?, arr1(&[RED, BLUE]));
5151
let pixels = file.dataset("dir/pixels")?;

tests/common/gen.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use std::fmt;
22
use std::iter;
33

4-
use h5::types::{FixedAscii, FixedUnicode, VarLenArray, VarLenAscii, VarLenUnicode};
5-
use h5::H5Type;
4+
use hdf5::types::{FixedAscii, FixedUnicode, VarLenArray, VarLenAscii, VarLenUnicode};
5+
use hdf5::H5Type;
66
use hdf5_types::Array;
77

88
use ndarray::{ArrayD, SliceInfo, SliceOrIndex};

tests/common/util.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pub fn random_filename() -> String {
44
gen_ascii(&mut rand::thread_rng(), 8)
55
}
66

7-
pub fn new_in_memory_file() -> h5::Result<h5::File> {
7+
pub fn new_in_memory_file() -> hdf5::Result<hdf5::File> {
88
let filename = random_filename();
9-
h5::File::with_options().mode("w").driver("core").filebacked(false).open(&filename)
9+
hdf5::File::with_options().mode("w").driver("core").filebacked(false).open(&filename)
1010
}

tests/test_dataset.rs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ use self::common::gen::{gen_arr, gen_slice, Enum, FixedStruct, Gen, TupleStruct,
1111
use self::common::util::new_in_memory_file;
1212

1313
fn test_write_slice<T, R>(
14-
rng: &mut R, ds: &h5::Dataset, arr: &ArrayD<T>, default_value: &T, _ndim: usize,
15-
) -> h5::Result<()>
14+
rng: &mut R, ds: &hdf5::Dataset, arr: &ArrayD<T>, default_value: &T, _ndim: usize,
15+
) -> hdf5::Result<()>
1616
where
17-
T: h5::H5Type + fmt::Debug + PartialEq + Gen + Clone,
17+
T: hdf5::H5Type + fmt::Debug + PartialEq + Gen + Clone,
1818
R: Rng + ?Sized,
1919
{
2020
let shape = arr.shape();
@@ -40,10 +40,10 @@ where
4040
}
4141

4242
fn test_read_slice<T, R>(
43-
rng: &mut R, ds: &h5::Dataset, arr: &ArrayD<T>, ndim: usize,
44-
) -> h5::Result<()>
43+
rng: &mut R, ds: &hdf5::Dataset, arr: &ArrayD<T>, ndim: usize,
44+
) -> hdf5::Result<()>
4545
where
46-
T: h5::H5Type + fmt::Debug + PartialEq + Gen,
46+
T: hdf5::H5Type + fmt::Debug + PartialEq + Gen,
4747
R: Rng + ?Sized,
4848
{
4949
ds.write(arr)?;
@@ -78,7 +78,7 @@ where
7878
let bad_slice = gen_slice(rng, &bad_shape);
7979
let bad_slice: SliceInfo<_, IxDyn> = ndarray::SliceInfo::new(bad_slice.as_slice()).unwrap();
8080

81-
let bad_sliced_read: h5::Result<ArrayD<T>> = dsr.read_slice(&bad_slice);
81+
let bad_sliced_read: hdf5::Result<ArrayD<T>> = dsr.read_slice(&bad_slice);
8282
assert!(bad_sliced_read.is_err());
8383

8484
// Tests for dimension-dropping slices with static dimensionality.
@@ -102,9 +102,9 @@ where
102102
Ok(())
103103
}
104104

105-
fn test_read<T>(ds: &h5::Dataset, arr: &ArrayD<T>, ndim: usize) -> h5::Result<()>
105+
fn test_read<T>(ds: &hdf5::Dataset, arr: &ArrayD<T>, ndim: usize) -> hdf5::Result<()>
106106
where
107-
T: h5::H5Type + fmt::Debug + PartialEq + Gen,
107+
T: hdf5::H5Type + fmt::Debug + PartialEq + Gen,
108108
{
109109
ds.write(arr)?;
110110

@@ -143,9 +143,9 @@ where
143143
Ok(())
144144
}
145145

146-
fn test_write<T>(ds: &h5::Dataset, arr: &ArrayD<T>, ndim: usize) -> h5::Result<()>
146+
fn test_write<T>(ds: &hdf5::Dataset, arr: &ArrayD<T>, ndim: usize) -> hdf5::Result<()>
147147
where
148-
T: h5::H5Type + fmt::Debug + PartialEq + Gen,
148+
T: hdf5::H5Type + fmt::Debug + PartialEq + Gen,
149149
{
150150
// .write()
151151
ds.write(arr)?;
@@ -166,9 +166,9 @@ where
166166
Ok(())
167167
}
168168

169-
fn test_read_write<T>() -> h5::Result<()>
169+
fn test_read_write<T>() -> hdf5::Result<()>
170170
where
171-
T: h5::H5Type + fmt::Debug + PartialEq + Gen + Clone,
171+
T: hdf5::H5Type + fmt::Debug + PartialEq + Gen + Clone,
172172
{
173173
let td = T::type_descriptor();
174174
let mut packed = vec![false];
@@ -185,7 +185,7 @@ where
185185
for mode in 0..4 {
186186
let arr: ArrayD<T> = gen_arr(&mut rng, ndim);
187187

188-
let ds: h5::Dataset = file
188+
let ds: hdf5::Dataset = file
189189
.new_dataset::<T>()
190190
.packed(*packed)
191191
.create("x", arr.shape().to_vec())?;
@@ -213,7 +213,7 @@ where
213213
}
214214

215215
#[test]
216-
fn test_read_write_primitive() -> h5::Result<()> {
216+
fn test_read_write_primitive() -> hdf5::Result<()> {
217217
test_read_write::<i8>()?;
218218
test_read_write::<i16>()?;
219219
test_read_write::<i32>()?;
@@ -231,27 +231,27 @@ fn test_read_write_primitive() -> h5::Result<()> {
231231
}
232232

233233
#[test]
234-
fn test_read_write_enum() -> h5::Result<()> {
234+
fn test_read_write_enum() -> hdf5::Result<()> {
235235
test_read_write::<Enum>()
236236
}
237237

238238
#[test]
239-
fn test_read_write_tuple_struct() -> h5::Result<()> {
239+
fn test_read_write_tuple_struct() -> hdf5::Result<()> {
240240
test_read_write::<TupleStruct>()
241241
}
242242

243243
#[test]
244-
fn test_read_write_fixed_struct() -> h5::Result<()> {
244+
fn test_read_write_fixed_struct() -> hdf5::Result<()> {
245245
test_read_write::<FixedStruct>()
246246
}
247247

248248
#[test]
249-
fn test_read_write_varlen_struct() -> h5::Result<()> {
249+
fn test_read_write_varlen_struct() -> hdf5::Result<()> {
250250
test_read_write::<VarLenStruct>()
251251
}
252252

253253
#[test]
254-
fn test_read_write_tuples() -> h5::Result<()> {
254+
fn test_read_write_tuples() -> hdf5::Result<()> {
255255
test_read_write::<(u8,)>()?;
256256
test_read_write::<(u64, f32)>()?;
257257
test_read_write::<(i8, u64, f32)>()?;

0 commit comments

Comments
 (0)