Skip to content

Improve code readability and speed#41

Merged
carloalbertobarbano merged 2 commits intoEIDOSLAB:mainfrom
ajinkya-kulkarni:patch-3
Jan 8, 2025
Merged

Improve code readability and speed#41
carloalbertobarbano merged 2 commits intoEIDOSLAB:mainfrom
ajinkya-kulkarni:patch-3

Conversation

@ajinkya-kulkarni
Copy link
Contributor

  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.

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.

# 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))
Copy link
Collaborator

Choose a reason for hiding this comment

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

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)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same as above.

@ajinkya-kulkarni
Copy link
Contributor Author

Done

@andreped
Copy link
Collaborator

andreped commented Apr 6, 2023

In order to merge, we need to run some unit tests. This is not possible, until you have replaced ubuntu-18.04 with ubuntu-20.04, as mentioned here (necessary as ubuntu-18.04 docker image is deprecated in GitHub Actions).

See here for where to change. Alternatively, you can pull latest from the main branch to your own fork's branches.

@carloalbertobarbano carloalbertobarbano merged commit 401514e into EIDOSLAB:main Jan 8, 2025
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