Skip to content

Commit 838db44

Browse files
committed
updated docker and readme example
1 parent 7116081 commit 838db44

File tree

2 files changed

+11
-31
lines changed

2 files changed

+11
-31
lines changed

Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
# works on a system that does not have hdf5 lib installed.
33
# the original binary is compiled with a static hdf5 lib so this should be contained within the executable
44

5+
# first run "cargo build" from within the example_use directory
6+
57
# docker build -t hdf5_rust .
68
# docker run -it hdf5_rust
79

810
FROM ubuntu:latest
911

10-
COPY target/debug/website_example .
12+
COPY example_use/target/debug/example_use .
1113
COPY Li6.h5 .
1214

13-
CMD ./website_example
15+
CMD ./example_use

README.md

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
# Work in progress - not ready for use
1+
[![CI Rust testing](https://github.com/openmc-data-storage/hdf5_nuclear_data_reader/actions/workflows/ci.yml/badge.svg)](https://github.com/openmc-data-storage/hdf5_nuclear_data_reader/actions/workflows/ci.yml)
22

3-
I plan to make a portable hdf5 file reader that reads OpenMC cross section files.
3+
A portable hdf5 file reader that reads OpenMC cross section files.
4+
5+
This package incorporates the parts of hdf5 library needed for h5 file reading and therefore it is not necessary to install hdf5 on the computer before hand. See the Dockerfile for a demonstration of this
46

57
Ideally there will be several deployment options
68

7-
- Cargo crate
8-
- PyPi package
9+
- Cargo crate (in progress)
910
- WASM executable
1011

1112
For now the repo is no where near finished and very much experimental
@@ -18,31 +19,8 @@ The clone the repo
1819
git clone https://github.com/shimwell/openmc_rust_hdf5_reader.git
1920
```
2021

21-
build the Rust binary
22-
```
23-
cargo build
24-
```
25-
26-
Run the binary
27-
```
28-
./target/debug/website_example
29-
```
30-
31-
Run the binary using cargo (does not need building first)
22+
Run the example using cargo
3223
```
24+
cd openmc_rust_hdf5_reader/examples_use
3325
cargo run
3426
```
35-
36-
37-
Python h5py can also access the cross section format and I've been using this to compare outputs
38-
39-
```python
40-
import h5py
41-
42-
h5file = h5py.File('Li6.h5', 'r')
43-
44-
print(list(h5file['Li6']['energy']['294K']))
45-
print(list(h5file['Li6']['reactions']))
46-
print(list(h5file['Li6']['reactions']['reaction_444']['294K']['xs']))
47-
print(list(h5file['Li6'].keys()))
48-
```

0 commit comments

Comments
 (0)