-
-
Notifications
You must be signed in to change notification settings - Fork 197
ENH: New Package Structure #415
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
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Forgot to mention, but the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really loved the implementation, thanks so much @MateusStano !!
- I ran all the tests, including runslow option and the examples in documentation. It's all good (a code coverage of 84% was achieved)
- All te imports are working correctly, as you can see by the testing's results
- The docs are being build correctly
The only thing I'd say is that the README can be improved before v1.
Maybe the fluxogram could be improved, for instance...
I'm asking @giovaniceotto to help us.
from ..mathutils.function import Function | ||
from ..plots.environment_analysis_plots import _EnvironmentAnalysisPlots | ||
from ..prints.environment_analysis_prints import _EnvironmentAnalysisPrints |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am just commenting on these lines, however this happens in most import statements regarding the new structure.
Here there was a change from absolute imports to relative imports. Of course, there are use cases for both of them and I would like to point out the main advantages/disadvantages of each option:
- See the discussion "Absolute vs relative imports"
- Despite being very old (but still active), the import section of PEP8 (interesting read) used to strongly recommend absolute imports for packages. This comes from earlier Python versions in which relative imports were more troublesome than today. Nowadays I believe there is not a clear recommendation, and both ways are acceptable;
- Relative imports have the advantage of being shorter and requiring less refactoring if the submodules are rearranged.
Personally, I believe we should keep this relative import implementation since it does not appear to be frowned upon anymore and having some interesting benefits. I just wanted to make sure that the existence of an alternative is acknowledged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good comment,
This is the first time I see this kind of discussion.
I am aware of this now. In the future we can modify the imports if we find it confusing for any reasons.
I agree moving forward with the current relative import.
By mistake I skipped the final review comment, so I will make a standalone comment. The package structure and imports seems much better now, I believe it makes sense and is quite intuitive. Small suggestions that may or may not be resolved for merging this PR:
|
All problems solved. |
Pull request type
Pull request checklist
black rocketpy
) has passed locally and any fixes were madepytest --runslow
) have passed locallyWhat is the new behavior?
The package structure has been reorganized into the following:
Other information
Please test manually importing classes/functions to check if everything is working correctly. The hardest part of this was guarantying that all
__init__.py
files gave the correct behavior.Also, some parts of the documentation had to be changed. Please review the docs to guarantee nothing is missing.
I could not build the documentation locally and I could not figure out why. It is building in readthedocs though. Im getting some weird importation error which is strange. It would be nice if someone would check if this happening in other machines too.