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

Compute mon norm #2093

Merged
merged 4 commits into from
Jun 11, 2024
Merged

Compute mon norm #2093

merged 4 commits into from
Jun 11, 2024

Conversation

ashmeigh
Copy link
Collaborator

@ashmeigh ashmeigh commented Mar 4, 2024

Description
This pull request addresses the ongoing effort to standardize the execution of operations by transitioning from the partial function style to a structured compute_function approach. In this update, several operations have been refactored to adhere to the new standard. The modifications ensure a clearer separation between the setup and execution phases of each operation, improving the maintainability and readability of the codebase.

Changes made
Refactored multiple operations to implement the new compute_function approach.
Introduced static methods compute_function in each affected operation module to encapsulate the core logic for executing the operation on a per-slice basis.
Updated the calling code to use the compute_function method instead of the previous partial function style

@coveralls
Copy link

coveralls commented Mar 4, 2024

Coverage Status

coverage: 72.719% (+0.01%) from 72.706%
when pulling 1c74d73 on compute_mon_norm
into f482056 on main.

@samtygier-stfc
Copy link
Collaborator

Currently no test case, because needs additional metadata.

@samtygier-stfc samtygier-stfc marked this pull request as draft March 8, 2024 10:31
@ashmeigh ashmeigh marked this pull request as ready for review June 10, 2024 13:13
Comment on lines 19 to 22
def _divide_by_counts(data=None, counts=None):
if counts.ndim == 1:
counts = counts.reshape(1, 1, -1)
data[:] = np.true_divide(data, counts)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be removed as its not called any more.

Comment on lines 42 to 43
# we can't really compute the preview as the image stack copy
# passed in doesn't have the logfile in it
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets keep this comment

Copy link
Collaborator

@samtygier-stfc samtygier-stfc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, passes tests

@samtygier-stfc samtygier-stfc added this pull request to the merge queue Jun 11, 2024
Merged via the queue into main with commit 06f179e Jun 11, 2024
8 checks passed
@samtygier-stfc samtygier-stfc deleted the compute_mon_norm branch June 11, 2024 15:32
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.

3 participants