diff --git a/tofu/imas2tofu/_core.py b/tofu/imas2tofu/_core.py index 59cae079f..6ec5f4939 100644 --- a/tofu/imas2tofu/_core.py +++ b/tofu/imas2tofu/_core.py @@ -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'}}, diff --git a/tofu/scripts/tofucalc.py b/tofu/scripts/tofucalc.py index 2c70cba46..e2394bb7d 100755 --- a/tofu/scripts/tofucalc.py +++ b/tofu/scripts/tofucalc.py @@ -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)) istofugit = False -if '.git' in _HERE and 'tofu' in _HERE: +if '.git' in os.listdir(_HERE) and 'tofu' in _HERE: istofugit = True if istofugit: @@ -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" @@ -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() diff --git a/tofu/scripts/tofuplot.py b/tofu/scripts/tofuplot.py index ed5f580f0..0878cfd3e 100755 --- a/tofu/scripts/tofuplot.py +++ b/tofu/scripts/tofuplot.py @@ -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)) istofugit = False -if '.git' in _HERE and 'tofu' in _HERE: +if '.git' in os.listdir(_HERE) and 'tofu' in _HERE: istofugit = True if istofugit: @@ -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" @@ -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() diff --git a/tofu/version.py b/tofu/version.py index 6c45f826f..f3fbe0706 100644 --- a/tofu/version.py +++ b/tofu/version.py @@ -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'