-
Notifications
You must be signed in to change notification settings - Fork 18
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
Implemented #144, partial volume via settings #145
Conversation
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 agree that this is a good idea.
But I am not sure that implementing it this way is the best idea, as it will lead to a crash if the CONSIDER_PARTIAL_VOLUME tag is not set.
I'd suggest first checking if the field is in the settings dictionary. If it is not, either throw a meaningful error or (preferably?) assume a default value (I think we assume this to be False
in the volume creator if not set)?
If I am mistaken: Should we include a default behaviour?
I would suggest the following:
Then, the default for everything is no PV, but the user can set it for each structure themselves and for all structures in a device as a whole. |
- Implement new default (PV=False) - Add PV-Tag for device
I added a new commit that should implement the behaviour suggested by @kdreher . |
@kdreher the automatic tests do not seem to be triggered when pushing into |
self.partial_volume = single_structure_settings[Tags.CONSIDER_PARTIAL_VOLUME] | ||
if Tags.CONSIDER_PARTIAL_VOLUME in single_structure_settings: | ||
self.partial_volume = single_structure_settings[Tags.CONSIDER_PARTIAL_VOLUME] | ||
else: self.partial_volume = False |
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 think our coding convention is to have if else block statements on a new line unless it is an inline if-else. Apart from that the changes look reasonable.
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.
Alright, I changed this.
I implemented #144. The partial volume effect within the device can now be adapted in the settings. The tag CONSIDER_PARTIAL_VOULME is now always necessary in the volume_creation_settings.