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

refactor: improve importability #44

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

FynnFreyer
Copy link

This relates to #42, and includes two commits:

  • 993f52d exposes scripts as entry points instead
  • 51fb37d encapsulates the argument parsing, and allows argument injection in hivnetworkcsv
    For this one there are a few open questions

If only parts of this would be wanted, I can split these changes up into multiple commits, and you can cherry pick/whatever.

This doesn't include the commits in #41, but should be compatible without merge conflicts.

- moved the scripts package under the hivtrace namespace
- appended `.py` to the script names where necessary
- added a __main__.py file, defining the entrypoint functions
- removed the scripts in setup.py and make them available as entrypoints
- wrapped the code in hivnetworkannotate.py in functions
- changed to relative imports, because the ad-hoc layout otherwise confuses pycharm
- also did some very slight reformatting (add some indentation) in setup.py
TODO: some open questions

- why the random.seed(), and where does it need to happen? it's happening twice now
  - once before parsing arguments
  - and once before doing the annotations
- run_settings is global, and mutated by functions via side effects
  - this change does not immediately seem to break things
  - but there are no tests, so someone knowledgeable might want to check
@FynnFreyer FynnFreyer marked this pull request as draft August 23, 2023 15:35
@FynnFreyer FynnFreyer changed the title Feat/improve importability feat: improve importability Aug 23, 2023
@FynnFreyer FynnFreyer changed the title feat: improve importability refactor: improve importability Aug 23, 2023
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.

None yet

1 participant