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

Fix sliceFieldReader #2718

Merged
merged 2 commits into from
Oct 9, 2018
Merged

Conversation

steindev
Copy link
Member

@steindev steindev commented Oct 8, 2018

Use of map() changed from Python 2 to 3 which results in an error when using the function now. This PR avoids the map function but uses a (more pythonic) list comprehension which is also version independent.

A grammar error in a comment is corrected as well.

replace `map()` by list comprehension, correct spelling error in comment
@ax3l ax3l added component: plugin in PIConGPU plugin component: tools scripts, python libs and CMake labels Oct 8, 2018
@@ -77,7 +77,7 @@ def readFieldSlices(File):
# go through all valid field vectors
for x in range(N_x):
fieldValue = line[x]
data[y, x, :] = map(float, fieldValue[1:-1].split(','))
data[y, x, :] = [ float(x) for x in fieldValue[1:-1].split(',') ]
Copy link
Member

Choose a reason for hiding this comment

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

looks good!
Please just fix the style by removing the whitespaces after [ and before ] to make the CI happy :)

@ax3l ax3l mentioned this pull request Oct 8, 2018
21 tasks
@ax3l ax3l self-assigned this Oct 8, 2018
@ax3l ax3l merged commit 2d12ff4 into ComputationalRadiationPhysics:dev Oct 9, 2018
@steindev steindev deleted the patch-1 branch October 15, 2018 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: plugin in PIConGPU plugin component: tools scripts, python libs and CMake
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants