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

Logging fix #184

Merged
merged 5 commits into from
Jan 5, 2022
Merged

Logging fix #184

merged 5 commits into from
Jan 5, 2022

Conversation

mbkumar
Copy link
Collaborator

@mbkumar mbkumar commented Dec 23, 2021

This PR fixes bugs encountered in importing initialize_logging from simsopt.util.logging reported in #178.

functools.wraps works only for functions, so using SimsoptRequires, which uses functools.wraps internally, on classes won't work as expected. Hence, SimsoptRequires is removed in MHD modules.

@codecov
Copy link

codecov bot commented Dec 23, 2021

Codecov Report

Merging #184 (7e2906d) into master (a25ac26) will increase coverage by 0.00%.
The diff coverage is 66.66%.

❗ Current head 7e2906d differs from pull request most recent head f611e74. Consider uploading reports for the commit f611e74 to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##           master     #184   +/-   ##
=======================================
  Coverage   90.51%   90.52%           
=======================================
  Files          57       57           
  Lines        7455     7449    -6     
=======================================
- Hits         6748     6743    -5     
+ Misses        707      706    -1     
Flag Coverage Δ
unittests 90.52% <66.66%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
src/simsopt/_core/graph_optimizable.py 89.64% <ø> (-0.03%) ⬇️
src/simsopt/mhd/boozer.py 80.85% <ø> (-0.11%) ⬇️
src/simsopt/mhd/spec.py 88.01% <ø> (-0.10%) ⬇️
src/simsopt/mhd/vmec.py 89.20% <ø> (-0.05%) ⬇️
src/simsopt/util/log.py 0.00% <ø> (ø)
src/simsopt/util/mpi_logger.py 0.00% <0.00%> (ø)
src/simsopt/util/mpi.py 91.59% <100.00%> (ø)

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 a25ac26...f611e74. Read the comment docs.

@landreman
Copy link
Contributor

If you are removing SimsoptRequires from classes, does it make sense to also remove monty.dev.requires (which also uses functools.wraps, see http://guide.materialsvirtuallab.org/monty/_modules/monty/dev.html#requires) from simsopt.util.mpi.MpiPartition? This is causing issue #159.

@mbkumar
Copy link
Collaborator Author

mbkumar commented Dec 23, 2021 via email

@mbkumar mbkumar linked an issue Jan 4, 2022 that may be closed by this pull request
@mbkumar mbkumar merged commit f611e74 into master Jan 5, 2022
@mbkumar mbkumar deleted the logging_fix branch January 29, 2022 15:19
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.

Error with MPI logging
2 participants