Skip to content

Reorganize to prep for applying scientific-python cookie#16

Merged
ebrahimebrahim merged 6 commits into
OpenwaterHealth:mainfrom
ebrahimebrahim:reorganize_to_prep_for_issue_5
Jun 20, 2024
Merged

Reorganize to prep for applying scientific-python cookie#16
ebrahimebrahim merged 6 commits into
OpenwaterHealth:mainfrom
ebrahimebrahim:reorganize_to_prep_for_issue_5

Conversation

@ebrahimebrahim
Copy link
Copy Markdown
Collaborator

@ebrahimebrahim ebrahimebrahim commented Jun 18, 2024

Re-organize the repo in order to prepare for the PR #17 that will resolve #5 by applying the scientific-python cookiecutter to add CI.

  • Move project files into a src/ subdirectory
    • Remove the top level init from the repo, which was wrongly making the top level appear to be a python package.
    • Move pyfus to src/pyfus. This way when you are working in the repo directory python will not try import things from the current directory. The should be no confusion about where imports are coming from.
    • Remove [tool.setuptools.packages.find] from the pyproject.toml. It is not needed -- I believe setuptools already finds pacakages by looking for the__init__.pys
  • Rename import package pyfus --> openlifu
  • Apply automatic formatting fixes: Files updated using end-of-file-fixer, mixed-line-ending, trailing-whitespace,
    blacken-docs, and prettier pre-commit hooks. These are the easy non-sweeping style fixes that will make the linting pass once we introduce it. For the other style fixes, they are going to be configured to be ignored by the linter and we can add those rules back in over time in separate PRs.
  • Add empty file docs/_static/.gitkeep: Sphinx is configured to look for this directory, this change helps suppress a sphinx warning
  • Rename test_notebooks->notebooks. Unit tests will be brought in soon and we don't want the test_notebooks
    to look like they are part of that.

Issue OpenwaterHealth#5

* Remove the top level __init__ from the repo, which was wrongly making
  the top level appear to be a python package.
* Move pyfus to src/pyfus. This way when you are working in the repo
  directory python will not try import things from the current directory.
  The should be no confusion about where imports are coming from.
  See https://packaging.python.org/en/latest/discussions/src-layout-vs-flat-layout/
* Remove [tool.setuptools.packages.find] from the pyproject.toml. It is
  not needed -- I believe setuptools already finds pacakages by looking for
  the __init__.py 's
Issue OpenwaterHealth#5

Files updated using `end-of-file-fixer`, `mixed-line-ending`, `trailing-whitespace`,
`blacken-docs` and `mirrors-prettier` pre-commit hooks
Issue OpenwaterHealth#5

Sphinx is configured to look for this directory, this change helps supress
a sphinx warning
Issue OpenwaterHealth#5

This helps to avoid confusion with unit tests

Unit tests will be brought in soon and we don't want the test_notebooks
to look like they are part of that
@ebrahimebrahim ebrahimebrahim force-pushed the reorganize_to_prep_for_issue_5 branch from c301599 to 8a2b299 Compare June 18, 2024 19:14
Copy link
Copy Markdown
Contributor

@peterhollender peterhollender left a comment

Choose a reason for hiding this comment

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

Looks good. I see that it's just moving/renaming/adjusting line endings.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@ebrahimebrahim do you know why this change and water.py are showing up as whole new files instead of renames+ modification like the others?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Hmm I'm not certain but it might be due to the length of the file. The file is short, so because 9f23b5b had to both rename (move) the file and edit it (changing pyfus to openlifu) it was treated by git as a large proportion of the file changing. When git sees a rename and a large proportion of changes I think it treats that as a delete-and-add rather than as a move

@ebrahimebrahim
Copy link
Copy Markdown
Collaborator Author

(Disabling status checks to merge this before bringing in #17 which actually introduces status checks. Will re-enable status checks after merging.)

@ebrahimebrahim ebrahimebrahim merged commit 685c603 into OpenwaterHealth:main Jun 20, 2024
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.

add CI/CD workflows for publishing, linting, testing, and documentation generation

2 participants