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 ignored acoustical_simulation_3d #251

Merged
merged 6 commits into from
Aug 13, 2024
Merged

Conversation

faberno
Copy link
Collaborator

@faberno faberno commented Oct 1, 2023

Please check the following before creating the pull request (PR):

  • Did you run automatic tests?
  • Did you run manual tests?
  • Is the code provided in the PR still backwards compatible to previous SIMPA versions?

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.

Copy link
Collaborator

@TomTomRixRix TomTomRixRix left a 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

@TomTomRixRix
Copy link
Collaborator

And here also merge into develop first, before merging into main

@faberno faberno changed the base branch from main to develop October 6, 2023 13:35
@@ -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 \
Copy link
Collaborator

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.

@kdreher kdreher dismissed TomTomRixRix’s stale review August 13, 2024 08:26

We added the changes you requested :)

@kdreher kdreher merged commit fbb61bf into develop Aug 13, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: ACOUSTIC_SIMULATION_3D is ignored
4 participants