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

Move common code to a separate script #413

Open
4 tasks
VladimirShitov opened this issue Jun 5, 2023 · 1 comment
Open
4 tasks

Move common code to a separate script #413

VladimirShitov opened this issue Jun 5, 2023 · 1 comment

Comments

@VladimirShitov
Copy link
Collaborator

VladimirShitov commented Jun 5, 2023

Currently, there is a code, which is repeated across different components. The examples that I faced are:

  • Setting up a logger
  • Subsetting HVG
  • Extracting a particular layer from AnnData object (e.g. X or specified layer)
  • Validation of the data in the layer. E.g. check that a matrix contains not-normalized counts

Code copy-pasting is not a good practice. If we decide to change a logging format or a bug is found (see recent PR #385), we must change the code in each component. To prevent this, we should move common code to a separate script or component.

I created such a script in src/ directory in this PR: #385. After merging it, I can move other reused code to this script. Other suggestions about common code location or examples of copy-pasting are welcome :)

@VladimirShitov
Copy link
Collaborator Author

Upd: the folder for the utils scripts is now src/utils

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

No branches or pull requests

1 participant