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

Multiply by unitSI only if different than 1 #81

Merged
merged 1 commit into from
Apr 23, 2016

Conversation

RemiLehe
Copy link
Member

This makes reading data more efficient.

@RemiLehe RemiLehe added this to the 0.1.0: First PyPI Release milestone Apr 22, 2016
@ax3l
Copy link
Member

ax3l commented Apr 23, 2016

hehe, like it 🚀

@ax3l ax3l merged commit 4dacf5c into openPMD:dev Apr 23, 2016
@@ -89,7 +89,8 @@ def get_data(dset, i_slice=None, pos_slice=None):
data = dset[:, :, i_slice]

# Scale by the conversion factor
data = data * dset.attrs['unitSI']
if dset.attrs['unitSI'] != 1:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.0 would be a tiny bit better to avoid he cast from int to float

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will update it.

ax3l added a commit to ax3l/openPMD-viewer that referenced this pull request Apr 23, 2016
Follow-up to openPMD#81: avoid cast from int to floating
point.
@ax3l ax3l mentioned this pull request Apr 23, 2016
@RemiLehe RemiLehe deleted the more_efficient_get_data branch April 24, 2016 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants