Skip to content

Commit 24b89e6

Browse files
committed
Adapt custom hierarchy example to API changes
1 parent 51372b8 commit 24b89e6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/14_custom_hierarchy.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,23 @@ def main():
1717
temp[()] = np.zeros((5, 5))
1818

1919
# write NeXus part
20-
nxentry = it["Scan:NXentry"]
20+
nxentry = it["Scan"]
2121
nxentry.set_attribute("NX_class", "NXentry")
2222
nxentry.set_attribute("default", "data")
2323

24-
data = nxentry["data:Nxdata"]
24+
data = nxentry["data"]
2525
data.set_attribute("NX_class", "NXdata")
2626
data.set_attribute("signal", "counts")
2727
data.set_attribute("axes", ["two_theta"])
2828
data.set_attribute("two_theta_indices", [0])
2929

30-
counts = data.datasets()["counts"]
30+
counts = data.as_container_of_datasets()["counts"]
3131
counts.set_attribute("units", "counts")
3232
counts.set_attribute("long_name", "photodiode counts")
3333
counts.reset_dataset(io.Dataset(np.dtype("int"), [15]))
3434
counts[()] = np.zeros(15, dtype=np.dtype("int"))
3535

36-
two_theta = data.datasets()["two_theta"]
36+
two_theta = data.as_container_of_datasets()["two_theta"]
3737
two_theta.set_attribute("units", "degrees")
3838
two_theta.set_attribute("long_name", "two_theta (degrees)")
3939
two_theta.reset_dataset(io.Dataset(np.dtype("double"), [15]))

0 commit comments

Comments
 (0)