Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getting the value of a scalar dataset #172

Open
prjemian opened this issue Dec 14, 2021 · 0 comments
Open

getting the value of a scalar dataset #172

prjemian opened this issue Dec 14, 2021 · 0 comments
Labels

Comments

@prjemian
Copy link
Owner

prjemian commented Dec 14, 2021

As noted by the APS USAXS, consider this algorithm to access scalar values in HDF5 files:

if dataset.shape == (1, ):  # historical representation of scalar value
    value = dataset[0]
elif  dataset.shape == ():  # scalar representation
    value = dataset.value
else:  # array of some sort
    value = numpy.array(dataset)
@prjemian prjemian added the task label Dec 14, 2021
@prjemian prjemian added this to the v1.0.0-release milestone Dec 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant