Skip to content

Commit

Permalink
fix bug in h5py example scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
woutdenolf committed Jun 15, 2022
1 parent d74583a commit cb6c98d
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# ---------------------------

# get some data
filename = str(Path(__file__).parent.parent / "simple_example.dat")
filename = str(Path(__file__).absolute().parent.parent / "simple_example.dat")
buffer = numpy.loadtxt(filename).T
tthData = buffer[0] # float[]
countsData = numpy.asarray(buffer[1], "int32") # int[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import h5py

filename = str(
Path(__file__).parent.parent
Path(__file__).absolute().parent.parent
/ "simple_example_basic"
/ "simple_example_basic.nexus.hdf5"
)
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
HDF5 "/users/denolf/dev/nexus/definitions/manual/source/examples/h5py/simple_example_basic/simple_example_basic.nexus.hdf5" {
HDF5 "simple_example_basic.nexus.hdf5" {
GROUP "/" {
ATTRIBUTE "HDF5_Version" {
DATATYPE H5T_STRING {
Expand Down Expand Up @@ -69,7 +69,7 @@ GROUP "/" {
}
DATASPACE SCALAR
DATA {
(0): "2022-06-13T18:12:42.247385+02:00"
(0): "2022-06-15T14:31:39.410075+02:00"
}
}
ATTRIBUTE "h5py_version" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@creator = "simple_example_basic_write.py"
@default = "entry"
@file_name = "simple_example_basic.nexus.hdf5"
@file_time = "2022-06-13T18:12:42.247385+02:00"
@file_time = "2022-06-15T14:31:39.410075+02:00"
@h5py_version = "3.6.0"
@instrument = "APS USAXS at 32ID-B"
entry:NXentry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
timestamp = datetime.datetime.now().astimezone().isoformat()

# load data from two column format
data_filename = str(Path(__file__).parent.parent / "simple_example.dat")
data_filename = str(Path(__file__).absolute().parent.parent / "simple_example.dat")
data = numpy.loadtxt(data_filename).T
mr_arr = data[0]
i00_arr = numpy.asarray(data[1], "int32")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import h5py
import numpy

filename = str(Path(__file__).parent.parent / "simple_example.dat")
filename = str(Path(__file__).absolute().parent.parent / "simple_example.dat")
buffer = numpy.loadtxt(filename).T
tthData = buffer[0] # float[]
countsData = numpy.asarray(buffer[1], "int32") # int[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import h5py
import numpy

filename = str(Path(__file__).parent.parent / "simple_example.dat")
filename = str(Path(__file__).absolute().parent.parent / "simple_example.dat")
buffer = numpy.loadtxt(filename).T
tthData = buffer[0] # float[]
countsData = numpy.asarray(buffer[1], "int32") # int[]
Expand Down

0 comments on commit cb6c98d

Please sign in to comment.