Skip to content

Issue243 less verbose warning for missing sub package#244

Merged
Didou09 merged 6 commits intodevelfrom
Issue243_LessVerboseWarningForMissingSubPackage
Nov 21, 2019
Merged

Issue243 less verbose warning for missing sub package#244
Didou09 merged 6 commits intodevelfrom
Issue243_LessVerboseWarningForMissingSubPackage

Conversation

@Didou09
Copy link
Copy Markdown
Member

@Didou09 Didou09 commented Nov 5, 2019

Improvements

  • The warning message is much more concise (1 header, 1 line per subpackage, 1 bottom line)
    => users have the minimum info without pollution
  • The error messages are still stored internally in tofu.dsub and accessible to developers, but just not displayed
    => when an optional subpackage import failed, a developer can still why

Example on ITER:

In  [1]: import tofu as tf
/home/ITER/vezined/ToFu_All/tofu/tofu/__init__.py:99: UserWarning:
The following subpackages are not available:
    - tofu.mag
  => see tofu.dsub[<subpackage>] for details on error messages
  warnings.warn(msg)

In  [2]: tf.dsub['mag']
Out [2]: 'pywed not available => no tofu.mag'

Issues

Fixes, in devel, issue #243

@Didou09 Didou09 self-assigned this Nov 5, 2019
@pep8speaks
Copy link
Copy Markdown

pep8speaks commented Nov 5, 2019

Hello @Didou09! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2019-11-21 08:35:48 UTC

@codecov-io
Copy link
Copy Markdown

codecov-io commented Nov 5, 2019

Codecov Report

Merging #244 into devel will increase coverage by 2.44%.
The diff coverage is 56.41%.

Impacted file tree graph

@@            Coverage Diff             @@
##            devel     #244      +/-   ##
==========================================
+ Coverage   41.47%   43.92%   +2.44%     
==========================================
  Files          79       70       -9     
  Lines       23217    21299    -1918     
==========================================
- Hits         9629     9355     -274     
+ Misses      13588    11944    -1644
Impacted Files Coverage Δ
tofu/imas2tofu/__init__.py 80.95% <100%> (-5.42%) ⬇️
tofu/version.py 100% <100%> (ø) ⬆️
tofu/mag/__init__.py 33.33% <11.76%> (-18.85%) ⬇️
tofu/__init__.py 91.66% <89.47%> (+11.02%) ⬆️
tofu/tests/tests01_geom/tests01_GG.py 94.43% <0%> (-2.42%) ⬇️
tofu/geom/_comp.py 60.08% <0%> (-0.44%) ⬇️
tofu/tests/tests01_geom/tests03_core.py 90.02% <0%> (-0.06%) ⬇️
tofu/data/_core.py 41.04% <0%> (-0.06%) ⬇️
tofu/mag/equimap.py 0% <0%> (ø) ⬆️
... and 18 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 92523ae...20f9cec. Read the comment docs.

@Didou09 Didou09 requested a review from lasofivec November 5, 2019 14:09
@lasofivec lasofivec closed this Nov 5, 2019
@lasofivec lasofivec deleted the Issue243_LessVerboseWarningForMissingSubPackage branch November 5, 2019 16:53
@Didou09 Didou09 restored the Issue243_LessVerboseWarningForMissingSubPackage branch November 21, 2019 08:35
@Didou09 Didou09 reopened this Nov 21, 2019
@Didou09
Copy link
Copy Markdown
Member Author

Didou09 commented Nov 21, 2019

Had been closed without being merged the first time...

@Didou09 Didou09 merged commit bdb853d into devel Nov 21, 2019
@Didou09 Didou09 deleted the Issue243_LessVerboseWarningForMissingSubPackage branch November 21, 2019 08:56
@lasofivec
Copy link
Copy Markdown
Collaborator

done, sorry for that 🙈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants