Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Emit warnings for empty Ag and user grid in DensityAnalysis #3091
Emit warnings for empty Ag and user grid in DensityAnalysis #3091
Changes from 11 commits
fb491fd
7fec795
c965b77
d2d54fc
2b1c50d
c00e3f3
65e0c45
14acdfb
d0f5263
4257b45
e4fc9aa
8232192
52fd1f3
eff2854
ec9c1f3
f4319ee
0423a48
c7caaef
b861b34
d6d23d6
33c94fa
dab9ad9
7c22dc1
dc834c8
4e8008e
a83c27b
6675097
d22916c
f3af280
245a859
9c127f5
e652669
e3990ee
5a2b371
10db351
9341947
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if three duplications of the same code block is enough to justify abstraction to a single i.e., function. Maybe borderline if the
return
has to remain outside of the abstraction I suppose.On a more basic level, just asking--the code will still produce the original failure/exception (is that what it was doing?) and this will simply add a warning to clarify?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might sound very primitive but my logic was to return out of the function and warn the user of no atoms until atomgroup gets updated with atleast one atom. In the Issue, the user wanted to avoid the program crashing and would provide a dummy atom to keep the density frames generating. I tried to fix this by preventing a crash at the initializing, frame generation and conclusion. Perhaps a more efficient way is to make a function to check for no atoms and return.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, my understanding of the DensityAnalysis function process may not be very accurate so I apologize for any incorrect arguments I make :P