Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions tofu/imas2tofu/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,15 +302,15 @@ class MultiIDSLoader(object):
'dim':'temperature', 'quant':'Te', 'units':'eV'}},

'reflectometer_profile':
{'t':{'str':'time'},
'ne':{'str':'channel[chan].n_e.data',
'dim':'density', 'quant':'ne', 'units':'/m^3'},
'R':{'str':'channel[chan].position.r.data',
'dim':'distance', 'quant':'R', 'units':'m'},
'Z':{'str':'channel[chan].position.z.data',
'dim':'distance', 'quant':'Z', 'units':'m'},
'phi':{'str':'channel[chan].position.phi.data',
'dim':'angle', 'quant':'phi', 'units':'rad'},
{'t': {'str': 'time'},
'ne': {'str': 'channel[chan].n_e.data',
'dim': 'density', 'quant': 'ne', 'units': '/m^3'},
'R': {'str': 'channel[chan].position.r',
'dim': 'distance', 'quant': 'R', 'units': 'm'},
'Z': {'str': 'channel[chan].position.z',
'dim': 'distance', 'quant': 'Z', 'units': 'm'},
'phi': {'str': 'channel[chan].position.phi',
'dim': 'angle', 'quant': 'phi', 'units': 'rad'},
'names': {'str': 'channel[chan].name'},
'mode': {'str': 'mode'},
'sweep': {'str': 'sweep_time'}},
Expand Down
13 changes: 8 additions & 5 deletions tofu/scripts/tofucalc.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
# tofu
# test if in a tofu git repo
_HERE = os.path.abspath(os.path.dirname(__file__))
_HERE = os.path.dirname(os.path.dirname(_HERE))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

where is _HERE first defined ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

one line above

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Here we are taking _HERE as the directory of the module:
_HERE = os.path.abspath(os.path.dirname(__file__))

and then we go 2 parents directories up:
_HERE = os.path.dirname(os.path.dirname(_HERE))

That's because tofuplot and tofucalc were moved from the root directory down to tofu/scripts

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

yes sorry, somehow i didn't see the line above (twice)

istofugit = False
if '.git' in _HERE and 'tofu' in _HERE:
if '.git' in os.listdir(_HERE) and 'tofu' in _HERE:
istofugit = True

if istofugit:
Expand All @@ -28,10 +29,7 @@
from tofu.imas2tofu import MultiIDSLoader
tforigin = tf.__file__
tfversion = tf.__version__

# if tf.__version__ < '1.4.1':
# msg = "tofuplot only works with tofu >= 1.4.1"
# raise Exception(msg)
print(tforigin, tfversion)

if 'imas2tofu' not in dir(tf):
msg = "imas does not seem to be available\n"
Expand Down Expand Up @@ -169,3 +167,8 @@ def main():

# Call wrapper function
call_tfcalcimas(**dict(args._get_kwargs()))


# Add this to make sure it remains executable even without install
if __name__ == '__main__':
main()
10 changes: 8 additions & 2 deletions tofu/scripts/tofuplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
# tofu
# test if in a tofu git repo
_HERE = os.path.abspath(os.path.dirname(__file__))
_HERE = os.path.dirname(os.path.dirname(_HERE))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

same question...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

same answer ;-)

istofugit = False
if '.git' in _HERE and 'tofu' in _HERE:
if '.git' in os.listdir(_HERE) and 'tofu' in _HERE:
istofugit = True

if istofugit:
Expand All @@ -28,7 +29,7 @@
from tofu.imas2tofu import MultiIDSLoader
tforigin = tf.__file__
tfversion = tf.__version__

print(tforigin, tfversion)

if 'imas2tofu' not in dir(tf):
msg = "imas does not seem to be available\n"
Expand Down Expand Up @@ -175,3 +176,8 @@ def main():

# Call wrapper function
call_tfloadimas(**dict(args._get_kwargs()))


# Add this to make sure it remains executable even without install
if __name__ == '__main__':
main()
2 changes: 1 addition & 1 deletion tofu/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Do not edit, pipeline versioning governed by git tags!
__version__ = '1.4.2b3-13-gd916732c'
__version__ = '1.4.2b4-39-g2b1aa022'