Improve code readability and speed#41
Merged
carloalbertobarbano merged 2 commits intoEIDOSLAB:mainfrom Jan 8, 2025
Merged
Conversation
Contributor
ajinkya-kulkarni
commented
Apr 2, 2023
- Used np.apply_along_axis to calculate stack_ instead of using a list comprehension.
- Used elif statements instead of multiple if statements to improve code readability.
1. Used np.apply_along_axis to calculate stack_ instead of using a list comprehension. 2. Used elif statements instead of multiple if statements to improve code readability.
andreped
requested changes
Apr 4, 2023
|
|
||
| # get summary statistics | ||
| stack_ = np.array([get_mean_std(x) for x in lab_split(lab)]) | ||
| stack_ = np.apply_along_axis(get_mean_std, 1, lab_split(lab)) |
Collaborator
There was a problem hiding this comment.
I would write np.apply_along_axis(get_mean_std, axis=1, arr=lab_split(lab))
|
|
||
| # get summary statistics from LAB | ||
| stack_ = np.array([get_mean_std(x) for x in labs]) | ||
| stack_ = np.apply_along_axis(get_mean_std, 1, labs) |
Contributor
Author
|
Done |
Collaborator
|
In order to merge, we need to run some unit tests. This is not possible, until you have replaced See here for where to change. Alternatively, you can pull latest from the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.