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

Minor performance and readability changes. #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ajinkya-kulkarni
Copy link

Thanks for this repo! I came across this in the bioRxiv preprint. I made a few changes in the code:

  1. Added a docstring to describe the function's purpose, arguments, and return value.
  2. Added comments to explain the code logic and any complex computations.
  3. Used more descriptive variable names, for example, num_bins instead of bins.
  4. Added error checking for invalid input arguments or unexpected data shapes.
  5. Used consistent naming conventions throughout the code, such as using underscores to separate words in variable names.
  6. Separated the code into smaller functions with specific responsibilities to improve modularity and readability.
  7. Used NumPy functions to simplify some of the computations, for example, np.linalg.norm() instead of np.sqrt(x2 + y2).

Thanks for this repo! I came across this in the bioRxiv preprint.
I made a few changes in the code:
1. Added a docstring to describe the function's purpose, arguments, and return value.
2. Added comments to explain the code logic and any complex computations.
3. Used more descriptive variable names, for example, num_bins instead of bins.
4. Added error checking for invalid input arguments or unexpected data shapes.
5. Used consistent naming conventions throughout the code, such as using underscores to separate words in variable names.
6. Separated the code into smaller functions with specific responsibilities to improve modularity and readability.
7. Used NumPy functions to simplify some of the computations, for example, np.linalg.norm() instead of np.sqrt(x**2 + y**2).
@ChiaraStringari
Copy link
Collaborator

Hi Ajinkya,
Thanks for your proposition and pull request.
We will get back soon to the code optimization and we will look also at this.
Best,
Chiara

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.

2 participants