Skip to content

[Issue287] IMAS version check operational in imas2tofu.__init__, made…#289

Merged
lasofivec merged 3 commits into
develfrom
Issue287_CheckIMASversion
Nov 27, 2019
Merged

[Issue287] IMAS version check operational in imas2tofu.__init__, made…#289
lasofivec merged 3 commits into
develfrom
Issue287_CheckIMASversion

Conversation

@Didou09
Copy link
Copy Markdown
Member

@Didou09 Didou09 commented Nov 27, 2019

Main changes:

  • At import time, tofu will execute 'module list' and 'module avail IMAS' (in imas2tofu.init.py)
  • This will allow to check whether the IMAS version currently imported is the latest version
  • If not, it will issue a warning to inform the user
  • This test is non-critical, if it fails for some reason, no Exception is thrown and it does not affect tofu import

Successfully tested on IRFM clusters and on ITER clusters

Motivation:

  • IMAS versions changes rapidly on ITER, with new easyconfig installs of IMAS issues regularly
  • Many ids produced (by JINTRAC for example, see JIRA issue 2465) are only readable with the latest IMAS version and the user may not be able to read data properly if he did not load the proper IMAS version

Issues:

Fixes, in devel, Issue #287

Example on ITER:

In [1]: import tofu as tf
/home/ITER/vezined/ToFu_All/tofu/tofu/imas2tofu/__init__.py:81: UserWarning: 
You do not seem to be using the latest IMAS version:
'module list' vs 'module av IMAS' suggests:
	- Current version: 3.24.0-4.2.0
	- Latest version : 3.25.0-4.3.1
  warnings.warn(msg)
/home/ITER/vezined/ToFu_All/tofu/tofu/__init__.py:95: UserWarning: 
The following subpackages are not available:
    - tofu.mag
  => see tofu.dsub[<subpackage>] for details.
  warnings.warn(msg)

@pep8speaks
Copy link
Copy Markdown

pep8speaks commented Nov 27, 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-27 12:23:26 UTC

@codecov-io
Copy link
Copy Markdown

codecov-io commented Nov 27, 2019

Codecov Report

Merging #289 into devel will decrease coverage by 0.05%.
The diff coverage is 5.26%.

Impacted file tree graph

@@            Coverage Diff             @@
##            devel     #289      +/-   ##
==========================================
- Coverage   41.11%   41.05%   -0.06%     
==========================================
  Files          79       79              
  Lines       23432    23468      +36     
==========================================
+ Hits         9633     9634       +1     
- Misses      13799    13834      +35
Impacted Files Coverage Δ
tofu/version.py 100% <100%> (ø) ⬆️
tofu/imas2tofu/__init__.py 31.57% <2.7%> (-49.38%) ⬇️

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 88f9524...7a705e8. Read the comment docs.

@lasofivec lasofivec merged commit 6988b9f into devel Nov 27, 2019
@Didou09 Didou09 deleted the Issue287_CheckIMASversion branch November 27, 2019 12:46
@Didou09 Didou09 mentioned this pull request Nov 27, 2019
@Didou09 Didou09 mentioned this pull request Jan 30, 2020
@Didou09 Didou09 mentioned this pull request Mar 10, 2020
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