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

(#119) Wildcard imports removed #238

Merged
merged 10 commits into from
Apr 6, 2023
Merged

(#119) Wildcard imports removed #238

merged 10 commits into from
Apr 6, 2023

Conversation

AsadNizami
Copy link
Contributor

Fix for #193. I have tested all the examples. Sorry for working on the issues before it's assigned to me.

@bhosale2 bhosale2 changed the title Wildcard imports removed (#119) Wildcard imports removed Mar 27, 2023
@bhosale2 bhosale2 changed the base branch from master to update-0.3.1 March 27, 2023 20:36
@bhosale2 bhosale2 added enhancement New feature or request prio:medium Priority level: medium labels Mar 27, 2023
@bhosale2 bhosale2 added this to the Version 0.3.1 milestone Mar 27, 2023
@codecov-commenter
Copy link

codecov-commenter commented Mar 27, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.09 ⚠️

Comparison is base (bb0d16f) 87.53% compared to head (530387b) 87.45%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@               Coverage Diff                @@
##           update-0.3.1     #238      +/-   ##
================================================
- Coverage         87.53%   87.45%   -0.09%     
================================================
  Files                44       41       -3     
  Lines              2817     2798      -19     
  Branches            320      320              
================================================
- Hits               2466     2447      -19     
  Misses              330      330              
  Partials             21       21              
Impacted Files Coverage Δ
elastica/boundary_conditions.py 94.97% <ø> (-0.03%) ⬇️
elastica/callback_functions.py 97.53% <ø> (-0.04%) ⬇️
elastica/dissipation.py 95.45% <ø> (-0.11%) ⬇️
elastica/external_forces.py 96.36% <ø> (-0.04%) ⬇️
elastica/interaction.py 89.06% <ø> (-0.06%) ⬇️
elastica/joint.py 24.91% <ø> (-0.25%) ⬇️
elastica/modules/__init__.py 100.00% <ø> (ø)
elastica/restart.py 80.00% <ø> (-0.65%) ⬇️
elastica/rigidbody/cylinder.py 100.00% <ø> (ø)
elastica/rigidbody/sphere.py 100.00% <ø> (ø)
... and 9 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Collaborator

@bhosale2 bhosale2 left a comment

Choose a reason for hiding this comment

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

LGTM.

@bhosale2
Copy link
Collaborator

@AsadNizami so @armantekinalp and I noticed that there are a lot of wildcard imports scattered throughout the library in files under elastica folder. There the wildcard imports only import the parts defined in the __all__ keywords of individual files. Can you please remove the __all__ keywords, replace wildcard with absolute imports, and test in the end, as a part of this PR? Thanks!

@bhosale2 bhosale2 self-requested a review March 29, 2023 18:19
@AsadNizami AsadNizami marked this pull request as draft March 29, 2023 18:51
@AsadNizami
Copy link
Contributor Author

Sure, I'll get it done!

@AsadNizami AsadNizami marked this pull request as ready for review April 4, 2023 07:12
@AsadNizami AsadNizami requested a review from skim0119 as a code owner April 4, 2023 07:12
@AsadNizami
Copy link
Contributor Author

AsadNizami commented Apr 4, 2023

Please review.
Ran the tests, looks fine

@bhosale2
Copy link
Collaborator

bhosale2 commented Apr 4, 2023

Hi @AsadNizami I had 2 comments:

  1. Please check the formatting failing tests and fix them.
  2. I saw that you got rid of the __all__ keywords from submodules. However, if you see the __init__.py in elastica, the wildcard imports now import everything from individual submodules, which is not required and is also a bit inefficient. Can you please remove those wildcards, and specifically import the functionalities we need there from the submodules? If you have any questions about this let me know.

@AsadNizami
Copy link
Contributor Author

2. specifically import the functionalities we need there from the submodules?

This includes all the classes mentioned in the __init__ of all submodules and those of other files present in the same directory as elastica/__init__.py, right?

@AsadNizami AsadNizami marked this pull request as draft April 4, 2023 19:11
@bhosale2
Copy link
Collaborator

bhosale2 commented Apr 4, 2023

@AsadNizami Yes, the idea is wherever possible wildcard imports should be replaced while making sure existing example scripts and paths don't break.

@AsadNizami AsadNizami marked this pull request as ready for review April 5, 2023 19:18
@AsadNizami
Copy link
Contributor Author

Pls review!

elastica/wrappers.py Outdated Show resolved Hide resolved
@AsadNizami
Copy link
Contributor Author

Pls review.

@bhosale2 bhosale2 self-requested a review April 6, 2023 21:42
Copy link
Collaborator

@bhosale2 bhosale2 left a comment

Choose a reason for hiding this comment

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

LGTM. @armantekinalp this one is all yours.

Copy link
Contributor

@armantekinalp armantekinalp left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request prio:medium Priority level: medium
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clarify namespace for elastica modules to avoid namespace confusion and clutter
4 participants