-
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
Fix ignored acoustical_simulation_3d #251
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 would prefer it to have just one boolean variable to switch between 2D and 3D. Now we have acoustic_simulation_3d
and simulate_2d
. While this should technically work, it makes it very complicated to understand, especially with negated conditional statements.
I would do a one liner where you check for the tag and directly access it:
if Tags.ACOUSTIC_SIMULATION_3D in settings and not settings[Tags.ACOUSTIC_SIMULATION_3D]:
# 2D case
else:
#3D case
And here also merge into |
@@ -99,16 +99,15 @@ def forward_model(self, detection_geometry: DetectionGeometryBase) -> np.ndarray | |||
|
|||
detectors_are_aligned_along_x_axis = field_of_view_extent[2] == 0 and field_of_view_extent[3] == 0 | |||
detectors_are_aligned_along_y_axis = field_of_view_extent[0] == 0 and field_of_view_extent[1] == 0 | |||
if detectors_are_aligned_along_x_axis or detectors_are_aligned_along_y_axis: | |||
axes = (0, 1) | |||
if not self.component_settings[Tags.ACOUSTIC_SIMULATION_3D] and \ |
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'd change this to the same pattern as lines 158-159 to avoid a key error.
We added the changes you requested :)
Please check the following before creating the pull request (PR):
Provide issue / feature request fixed by this PR
Fixes #223
For now added a standard check if the Tag is in the settings, if not use False as default. In the future it would be nice to support .get() in Settings.