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

Absolute imports #483

Merged

Conversation

CasperWA
Copy link
Member

@CasperWA CasperWA commented Sep 1, 2020

Use absolute imports everywhere, except for __init__.py files as well as in test_*.py files.

Fixes #298

@CasperWA CasperWA requested a review from ml-evs September 1, 2020 10:54
Use absolute imports everywhere, except for `__init__.py` files as well
as in `test_*.py` files.
@codecov
Copy link

codecov bot commented Sep 1, 2020

Codecov Report

Merging #483 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #483   +/-   ##
=======================================
  Coverage   91.64%   91.64%           
=======================================
  Files          60       60           
  Lines        2848     2848           
=======================================
  Hits         2610     2610           
  Misses        238      238           
Flag Coverage Δ
#unittests 91.64% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
optimade/models/baseinfo.py 95.23% <100.00%> (ø)
optimade/models/entries.py 97.43% <100.00%> (ø)
optimade/models/index_metadb.py 100.00% <100.00%> (ø)
optimade/models/links.py 100.00% <100.00%> (ø)
optimade/models/optimade_json.py 95.74% <100.00%> (ø)
optimade/models/references.py 97.67% <100.00%> (ø)
optimade/models/responses.py 97.56% <100.00%> (ø)
optimade/models/structures.py 95.08% <100.00%> (ø)
optimade/server/mappers/links.py 100.00% <100.00%> (ø)
optimade/server/mappers/references.py 100.00% <100.00%> (ø)
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 742b9f3...bab0685. Read the comment docs.

Copy link
Member

@ml-evs ml-evs left a comment

Choose a reason for hiding this comment

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

I think I only cared about absolute imports in the app code before, but fair enough 👍

I guess this makes sense if you're pulling out some of the guts and modifying them too.

Cheers @CasperWA!

@CasperWA
Copy link
Member Author

CasperWA commented Sep 1, 2020

I think I only cared about absolute imports in the app code before, but fair enough +1

I guess this makes sense if you're pulling out some of the guts and modifying them too.

Yeah, I think it's just good practice all in all.

@CasperWA CasperWA merged commit f14c67f into Materials-Consortia:master Sep 1, 2020
@CasperWA CasperWA deleted the fix_298_absolute-imports branch September 1, 2020 11:23
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.

Suggestion: use absolute imports in app code to allow re-use
2 participants