-
Notifications
You must be signed in to change notification settings - Fork 14
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
Separate physics package and detector filters #1773
Conversation
Rather than using the update_physics_package function to also remove the package (set it to None), set it to None explicitly. The update function should only be used for actually updating the package. Signed-off-by: Brianna Major <brianna.major@taloid.khq.kitware.com>
If the physics package is needed but missing, warn users and allow them to make the decision. Signed-off-by: Brianna Major <brianna.major@taloid.khq.kitware.com>
Users can have one without the other - remove any interdependencies that previously prevented this. Signed-off-by: Brianna Major <brianna.major@taloid.khq.kitware.com>
Signed-off-by: Brianna Major <brianna.major@taloid.khq.kitware.com>
Hello @bnmajor! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2025-01-10 01:16:50 UTC |
Signed-off-by: Brianna Major <brianna.major@taloid.khq.kitware.com>
Signed-off-by: Brianna Major <brianna.major@taloid.khq.kitware.com>
The physics package option in the "edit" menu is no longer hidden based on instrument type. There are now two options: apply physics package, and edit physics package. Signed-off-by: Brianna Major <brianna.major@taloid.khq.kitware.com>
- Whether or not the Physics Package is used is now indicated by a separate flag: "use_physics_package". - Users can only edit the physics package if "use_physics_package" is true - If "apply physics package" is selected the package manager dialog will automatically be displayed - While the physics package is no longer limited to PXRDIP and TARDIS it is still automatically applied after using the LLNL Import tool. Signed-off-by: Brianna Major <brianna.major@taloid.khq.kitware.com>
0098a81
to
9b6226e
Compare
59a4f21
to
d8b11a4
Compare
If "apply physics package" is selected make sure that we have a default physics package set if it was None. If we're setting the physics package to default we can infer we want to apply it as well. Keep the two states in sync. Signed-off-by: Brianna Major <brianna.major@taloid.khq.kitware.com>
This is for backwards compatability. Previously, when detector coatings were set after using the LLNL import tool the "default" detector (used to represent the current detector during import) was not removed after import was complete. This means that some old state files will have this value and try to fetch this detector's information, even though it no longer exists. Signed-off-by: Brianna Major <brianna.major@taloid.khq.kitware.com>
Signed-off-by: Brianna Major <brianna.major@taloid.khq.kitware.com>
Signed-off-by: Brianna Major <brianna.major@taloid.khq.kitware.com>
Signed-off-by: Brianna Major <brianna.major@taloid.khq.kitware.com>
d8b11a4
to
4a7a949
Compare
db29ee3
to
1629fbb
Compare
hexrdgui/main_window.py
Outdated
dialog.show() | ||
# Always assume Physics Package is needed for LLNL import | ||
dialog.ui.complete.clicked.connect( | ||
lambda: self.on_action_include_physics_package_toggled(True) |
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 would create a new connection every time the LLNL import tool is shown. I'll move this to setup_connections()
instead. Otherwise, this could get triggered multiple times.
hexrdgui/overlays/powder_overlay.py
Outdated
# This will require a physics package | ||
HexrdConfig().create_default_physics_package() | ||
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.
We need to continue creating a default physics package for backward compatibility with old state files, that had tth_distortion
set but the physics package did not exist yet. I'll fix this.
I removed the `use_physics_package` variable from `HexrdConfig()` because it could have been simplified by simply checking if the physics package existed. I also fixed a few issues and cleaned up a few things. Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
1629fbb
to
d363b6d
Compare
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.
LGTM in the things I've tested so far.
All instruments should have the option to apply the physics package, the absorption correction, or both. This PR:
Relies on HEXRD/hexrd#741