From e6803899eda7eca53264989a11d6dfdbd891566c Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Wed, 27 Nov 2019 11:40:11 +0100 Subject: [PATCH 001/168] [travis] changing travis to test in mac --- .travis.yml | 96 +++++++++++++++++++++++++++++++++-------------------- 1 file changed, 60 insertions(+), 36 deletions(-) diff --git a/.travis.yml b/.travis.yml index d5bd833db..ff8b64e6a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,54 +1,67 @@ language: python + +os: + - linux + - osx + python: -- '3.6' -- '3.7-dev' + - '3.6' + - '3.7-dev' git: depth: 200 + sudo: required + dist: trusty + before_install: - sudo apt-get update - ldd --version - gcc --version - export START=$(pwd) + install: -- if [[ "$TRAVIS_PYTHON_VERSION" == "3.7-dev" ]]; then export VADD="py37"; else export VADD="py36"; fi -- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh - -O miniconda.sh -- bash miniconda.sh -b -p $HOME/miniconda -- export PATH="$HOME/miniconda/bin:$PATH" -- hash -r -- conda config --set always_yes yes --set changeps1 no -- conda install conda-build -- conda update -q conda -- conda update -n root conda-build -- conda config --set anaconda_upload no -- conda config --append channels conda-forge -- conda config --append channels tofuproject -- conda info -a -- if [[ "$TRAVIS_PYTHON_VERSION" == "3.7-dev" ]]; then export THIS_PY_VERSION="3.7"; - else THIS_PY_VERSION=$TRAVIS_PYTHON_VERSION; - fi -- conda install -q python=$THIS_PY_VERSION conda-build anaconda-client nose - nose-timer coverage codecov -- export REV=$(python -c "import _updateversion as up; out=up.updateversion(); print(out)") -- export VERSION=$(echo $REV | tr - .) -- echo $REV -- conda build conda_recipe -- export PKG_DIR=$HOME/miniconda/conda-bld/linux-64/ -- conda install tofu --use-local + - if [[ "$TRAVIS_PYTHON_VERSION" == "3.7-dev" ]]; then export VADD="py37"; else export VADD="py36"; fi + - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh + -O miniconda.sh + - bash miniconda.sh -b -p $HOME/miniconda + - export PATH="$HOME/miniconda/bin:$PATH" + - hash -r + - conda config --set always_yes yes --set changeps1 no + - conda install conda-build + - conda update-q conda + - conda update -n root conda-build + - conda config --set anaconda_upload no + - conda config --append channels conda-forge + - conda config --append channels tofuproject + - conda info -a + - if [[ "$TRAVIS_PYTHON_VERSION" == "3.7-dev" ]]; then export THIS_PY_VERSION="3.7"; + else THIS_PY_VERSION=$TRAVIS_PYTHON_VERSION; + fi + - conda install -q python=$THIS_PY_VERSION conda-build anaconda-client nose + nose-timer coverage codecov + - export REV=$(python -c "import _updateversion as up; out=up.updateversion(); print(out)") + - export VERSION=$(echo $REV | tr - .) + - echo $REV + - conda build conda_recipe + - export PKG_DIR=$HOME/miniconda/conda-bld/linux-64/ + - conda install tofu --use-local + script: -- cd $HOME -- nosetests tofu.tests --nocapture -v --with-id --with-timer --with-coverage - --cover-package=tofu + - cd $HOME + - nosetests tofu.tests --nocapture -v --with-id --with-timer --with-coverage + --cover-package=tofu + after_success: -- codecov -- chmod +x $START/anaconda_upload.sh -- echo $TRAVIS_TAG + - codecov + - chmod +x $START/anaconda_upload.sh + - echo $TRAVIS_TAG + before_deploy: -- ls $START -- cd $START + - ls $START + - cd $START + deploy: - provider: script user: "ToFuProject" @@ -59,10 +72,21 @@ deploy: skip_cleanup: true - provider: pypi user: "Didou09" - distributions: "sdist bdist_wheel" + distributions: "sdist" + skip_existing: true skip_cleanup: true on: tags: true all_branches: true password: secure: JNEDTDJVx/2fXNfHntNQ99iDRNuQ4uB3y+DBWVIBycCT95+UCb36YPtKzmruEk/UUS29Xgq4IYCGdfCSWE9smKqG8tV1PcHiw705m+AzcpKy77YtzbVECFBxqY4W36O2pHrkwEUzP/7acjFwNsnUFzArqEzsBJ+KdLaa4OPHJXCh30GA0GyqlrXYbBKG+DA9hX5vtsGo4C6w9noALYF3fS7pKPiI6ipKFnAlzGgHQ7Ke0uQME8N3IAFhmh+Z5xMtIIDWxlnqv+KszdG4DIaGV/W6NIJNAbRhzkqUd+Chu6LoPAd/XkHDTeirR/MBkNUc5UcRJxRnP9rUTRo1gCO/buTYuNRgFkMvqhV5a033+x9edWgtUiKNJIMPLXOxe0RJvc5GWji+Co77HtHxRmGRM2rnYqWMtZeYZlFbUdvHu/8jf0d6I8jyUgAoJYdlMA2u/ipENP3S6by4epE9qycUPXiIVh6r3DZbf3vPTMFvTZYAjBrA0NOzihv1xgcXwemmNUFOQSpe0io4UcFxtS9lLMo+30UMQjCHSnbEVM3zSlZmbMOKpkVOlKlt8Lz5NxwVgWtu9FuW2pGukLtE8AWbqvY9urXAPZCQqZlOIklIjJQIqOITnuw9LEV09cgvPHXfdvNni3ldbMlIQ89zryM6dYvhYryTiEZGK4JDR3wAKJA= + - provider: pypi + user: "Didou09" + distributions: "sdist bdist_wheel" + skip_existing: true + skip_cleanup: true + on: + tags: true + branch: master + password: + secure: JNEDTDJVx/2fXNfHntNQ99iDRNuQ4uB3y+DBWVIBycCT95+UCb36YPtKzmruEk/UUS29Xgq4IYCGdfCSWE9smKqG8tV1PcHiw705m+AzcpKy77YtzbVECFBxqY4W36O2pHrkwEUzP/7acjFwNsnUFzArqEzsBJ+KdLaa4OPHJXCh30GA0GyqlrXYbBKG+DA9hX5vtsGo4C6w9noALYF3fS7pKPiI6ipKFnAlzGgHQ7Ke0uQME8N3IAFhmh+Z5xMtIIDWxlnqv+KszdG4DIaGV/W6NIJNAbRhzkqUd+Chu6LoPAd/XkHDTeirR/MBkNUc5UcRJxRnP9rUTRo1gCO/buTYuNRgFkMvqhV5a033+x9edWgtUiKNJIMPLXOxe0RJvc5GWji+Co77HtHxRmGRM2rnYqWMtZeYZlFbUdvHu/8jf0d6I8jyUgAoJYdlMA2u/ipENP3S6by4epE9qycUPXiIVh6r3DZbf3vPTMFvTZYAjBrA0NOzihv1xgcXwemmNUFOQSpe0io4UcFxtS9lLMo+30UMQjCHSnbEVM3zSlZmbMOKpkVOlKlt8Lz5NxwVgWtu9FuW2pGukLtE8AWbqvY9urXAPZCQqZlOIklIjJQIqOITnuw9LEV09cgvPHXfdvNni3ldbMlIQ89zryM6dYvhYryTiEZGK4JDR3wAKJA= From 709684e314a57fc3308efe1fdf979f0699aabc3b Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Thu, 28 Nov 2019 18:14:04 +0100 Subject: [PATCH 002/168] [Issue304] get_summary() added to Struct and CamLOS2D --- tofu/geom/_core.py | 98 +++++++++++++++++++++++++++++++++++++++++++++- tofu/version.py | 2 +- 2 files changed, 97 insertions(+), 3 deletions(-) diff --git a/tofu/geom/_core.py b/tofu/geom/_core.py index 123c9fd49..4e4021a11 100644 --- a/tofu/geom/_core.py +++ b/tofu/geom/_core.py @@ -885,6 +885,51 @@ def dmisc(self): # public methods ########### + def get_summary( + self, + sep=" ", + line="-", + just="l", + table_sep=None, + verb=True, + return_=False, + ): + """ Summary description of the object content """ + + # ----------------------- + # Build detailed view + col0 = [ + "class", + "Name", + "SaveName", + "nP", + "noccur", + "mobile", + "color", + ] + ar0 = [ + self._Id.Cls, + self._Id.Name, + self._Id.SaveName, + str(self._dgeom["nP"]), + str(self._dgeom["noccur"]), + str(self._dgeom["mobile"]), + str(self._dmisc["color"])] + + return self._get_summary( + [ar0], + [col0], + sep=sep, + line=line, + table_sep=table_sep, + verb=verb, + return_=return_, + ) + + ########### + # public methods + ########### + def set_color(self, col): self._set_color(col) @@ -6728,21 +6773,29 @@ def get_summary( kout = self._dgeom["kOut"] indout = self._dgeom["indout"] lS = self._dconfig["Config"].lStruct + angles = np.arccos(-np.sum(self.u*self.dgeom['vperp'], axis=0)) # ar0 - col0 = ["nb. los", "av. length", "nb. touch"] + col0 = ["nb. los", "av. length", "min length", "max length", + "nb. touch", "av. angle", "min angle", "max angle"] ar0 = [ self.nRays, "{:.3f}".format(np.nanmean(kout)), + "{:.3f}".format(np.nanmin(kout)), + "{:.3f}".format(np.nanmax(kout)), np.unique(indout[0, :]).size, + "{:.2f}".format(np.nanmean(angles)), + "{:.2f}".format(np.nanmin(angles)), + "{:.2f}".format(np.nanmax(angles)), ] # ar1 - col1 = ["los index", "length", "touch"] + col1 = ["los index", "length", "touch", "angle (rad)"] ar1 = [ np.arange(0, self.nRays), np.around(kout, decimals=3).astype("U"), ["%s_%s" % (lS[ii].Id.Cls, lS[ii].Id.Name) for ii in indout[0, :]], + np.around(angles, decimals=2).astype('U') ] for k, v in self._dchans.items(): @@ -6838,6 +6891,47 @@ def save_to_imas( class CamLOS2D(Rays): + def get_summary( + self, + sep=" ", + line="-", + just="l", + table_sep=None, + verb=True, + return_=False, + ): + + # Prepare + kout = self._dgeom["kOut"] + indout = self._dgeom["indout"] + lS = self._dconfig["Config"].lStruct + angles = np.arccos(-np.sum(self.u*self.dgeom['vperp'], axis=0)) + + # ar0 + col0 = ["nb. los", "av. length", "min length", "max length", + "nb. touch", "av. angle", "min angle", "max angle"] + ar0 = [ + self.nRays, + "{:.3f}".format(np.nanmean(kout)), + "{:.3f}".format(np.nanmin(kout)), + "{:.3f}".format(np.nanmax(kout)), + np.unique(indout[0, :]).size, + "{:.2f}".format(np.nanmean(angles)), + "{:.2f}".format(np.nanmin(angles)), + "{:.2f}".format(np.nanmax(angles)), + ] + + # call base method + return self._get_summary( + [ar0], + [col0], + sep=sep, + line=line, + table_sep=table_sep, + verb=verb, + return_=return_, + ) + def _isImage(self): return self._dgeom["isImage"] diff --git a/tofu/version.py b/tofu/version.py index 0ffec04af..ab0e46b95 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.2-a4-11-g4a3c745' +__version__ = '1.4.2-a5' From 416be9f68597292e3fc7d04619a83e2c4e9ebc47 Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Thu, 28 Nov 2019 19:49:02 +0100 Subject: [PATCH 003/168] update in travis done --- .travis.yml | 74 +++++++++++++++++++++++------------- conda_recipe/conda_upload.sh | 1 - conda_recipe/meta.yaml | 6 +-- tofu/version.py | 2 +- 4 files changed, 51 insertions(+), 32 deletions(-) diff --git a/.travis.yml b/.travis.yml index ff8b64e6a..891e8f3a0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,19 +1,43 @@ language: python -os: - - linux - - osx - -python: - - '3.6' - - '3.7-dev' - -git: - depth: 200 - -sudo: required - -dist: trusty +matrix: + include: + - os: linux + dist: trusty + python: 3.7 + env: + - REPO=https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh + - OS=linux-64 + - os: linux + dist: trusty + python: 3.6 + env: + - REPO=https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh + - OS=linux-64 + - os: linux + dist: xenial + python: 3.7 + env: + - REPO=https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh + - OS=linux-64 + - os: linux + dist: xenial + python: 3.6 + env: + - REPO=https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh + - OS=linux-64 + - os: osx + language: generic + env: + - REPO=https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh + - TRAVIS_PYTHON_VERSION=3.7 + - OS=osx-64 + - os: osx + language: generic + env: + - REPO=https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh + - TRAVIS_PYTHON_VERSION=3.6 + - OS=osx-64 before_install: - sudo apt-get update @@ -22,30 +46,27 @@ before_install: - export START=$(pwd) install: - - if [[ "$TRAVIS_PYTHON_VERSION" == "3.7-dev" ]]; then export VADD="py37"; else export VADD="py36"; fi - - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh - -O miniconda.sh + - if [[ "$TRAVIS_PYTHON_VERSION" == "3.7" ]]; then export VADD="py37"; + else export VADD="py36"; fi + - wget "$REPO" -O miniconda.sh - bash miniconda.sh -b -p $HOME/miniconda - export PATH="$HOME/miniconda/bin:$PATH" - hash -r - conda config --set always_yes yes --set changeps1 no - conda install conda-build - - conda update-q conda + - conda update -q conda - conda update -n root conda-build - conda config --set anaconda_upload no - conda config --append channels conda-forge - conda config --append channels tofuproject - conda info -a - - if [[ "$TRAVIS_PYTHON_VERSION" == "3.7-dev" ]]; then export THIS_PY_VERSION="3.7"; - else THIS_PY_VERSION=$TRAVIS_PYTHON_VERSION; - fi - - conda install -q python=$THIS_PY_VERSION conda-build anaconda-client nose + - conda install -q python="$TRAVIS_PYTHON_VERSION" conda-build anaconda-client nose nose-timer coverage codecov - export REV=$(python -c "import _updateversion as up; out=up.updateversion(); print(out)") - export VERSION=$(echo $REV | tr - .) - echo $REV - conda build conda_recipe - - export PKG_DIR=$HOME/miniconda/conda-bld/linux-64/ + - export PKG_DIR=$HOME/miniconda/conda-bld/$OS - conda install tofu --use-local script: @@ -68,7 +89,7 @@ deploy: script: $START/anaconda_upload.sh on: tags: true - all_branches: true + branch: master skip_cleanup: true - provider: pypi user: "Didou09" @@ -77,16 +98,17 @@ deploy: skip_cleanup: true on: tags: true - all_branches: true + branch: master password: secure: JNEDTDJVx/2fXNfHntNQ99iDRNuQ4uB3y+DBWVIBycCT95+UCb36YPtKzmruEk/UUS29Xgq4IYCGdfCSWE9smKqG8tV1PcHiw705m+AzcpKy77YtzbVECFBxqY4W36O2pHrkwEUzP/7acjFwNsnUFzArqEzsBJ+KdLaa4OPHJXCh30GA0GyqlrXYbBKG+DA9hX5vtsGo4C6w9noALYF3fS7pKPiI6ipKFnAlzGgHQ7Ke0uQME8N3IAFhmh+Z5xMtIIDWxlnqv+KszdG4DIaGV/W6NIJNAbRhzkqUd+Chu6LoPAd/XkHDTeirR/MBkNUc5UcRJxRnP9rUTRo1gCO/buTYuNRgFkMvqhV5a033+x9edWgtUiKNJIMPLXOxe0RJvc5GWji+Co77HtHxRmGRM2rnYqWMtZeYZlFbUdvHu/8jf0d6I8jyUgAoJYdlMA2u/ipENP3S6by4epE9qycUPXiIVh6r3DZbf3vPTMFvTZYAjBrA0NOzihv1xgcXwemmNUFOQSpe0io4UcFxtS9lLMo+30UMQjCHSnbEVM3zSlZmbMOKpkVOlKlt8Lz5NxwVgWtu9FuW2pGukLtE8AWbqvY9urXAPZCQqZlOIklIjJQIqOITnuw9LEV09cgvPHXfdvNni3ldbMlIQ89zryM6dYvhYryTiEZGK4JDR3wAKJA= - provider: pypi user: "Didou09" - distributions: "sdist bdist_wheel" + distributions: "bdist_wheel" skip_existing: true skip_cleanup: true on: tags: true + condition: $OS = osx-64 branch: master password: secure: JNEDTDJVx/2fXNfHntNQ99iDRNuQ4uB3y+DBWVIBycCT95+UCb36YPtKzmruEk/UUS29Xgq4IYCGdfCSWE9smKqG8tV1PcHiw705m+AzcpKy77YtzbVECFBxqY4W36O2pHrkwEUzP/7acjFwNsnUFzArqEzsBJ+KdLaa4OPHJXCh30GA0GyqlrXYbBKG+DA9hX5vtsGo4C6w9noALYF3fS7pKPiI6ipKFnAlzGgHQ7Ke0uQME8N3IAFhmh+Z5xMtIIDWxlnqv+KszdG4DIaGV/W6NIJNAbRhzkqUd+Chu6LoPAd/XkHDTeirR/MBkNUc5UcRJxRnP9rUTRo1gCO/buTYuNRgFkMvqhV5a033+x9edWgtUiKNJIMPLXOxe0RJvc5GWji+Co77HtHxRmGRM2rnYqWMtZeYZlFbUdvHu/8jf0d6I8jyUgAoJYdlMA2u/ipENP3S6by4epE9qycUPXiIVh6r3DZbf3vPTMFvTZYAjBrA0NOzihv1xgcXwemmNUFOQSpe0io4UcFxtS9lLMo+30UMQjCHSnbEVM3zSlZmbMOKpkVOlKlt8Lz5NxwVgWtu9FuW2pGukLtE8AWbqvY9urXAPZCQqZlOIklIjJQIqOITnuw9LEV09cgvPHXfdvNni3ldbMlIQ89zryM6dYvhYryTiEZGK4JDR3wAKJA= diff --git a/conda_recipe/conda_upload.sh b/conda_recipe/conda_upload.sh index d50ad2fb0..ea1ed9a0d 100644 --- a/conda_recipe/conda_upload.sh +++ b/conda_recipe/conda_upload.sh @@ -1,7 +1,6 @@ # Only need to change these two variables PKG_NAME=tofu USER=ToFuProject -OS=linux-64 #mkdir ~/conda-bld #conda config --set anaconda_upload no diff --git a/conda_recipe/meta.yaml b/conda_recipe/meta.yaml index caf994d59..5d9a3e38a 100644 --- a/conda_recipe/meta.yaml +++ b/conda_recipe/meta.yaml @@ -4,13 +4,11 @@ package: source: git_url: https://github.com/ToFuProject/tofu.git - #git_branch: {{ environ['TRAVIS_BRANCH'] }} git_rev: {{ environ['REV'] }} - # "patches:" might be the answer for clang compilers ? build: script_env: - # - REV + - OS - VERSION - TRAVIS_BRANCH - CONDA_BLD_PATH @@ -21,7 +19,7 @@ requirements: # here same as run, as we are using cython build: - python - - setuptools + - setuptools >=40.8.0 - setuptools_scm - numpy - scipy diff --git a/tofu/version.py b/tofu/version.py index a9ed57da4..1dd47b17e 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.2a3' +__version__ = '1.4.2a3-2-ge680389' From 4b6901e50943d06612897c4e090d4531746cda27 Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Thu, 28 Nov 2019 19:52:21 +0100 Subject: [PATCH 004/168] merge version number --- tofu/version.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tofu/version.py b/tofu/version.py index 572f55ded..0ffec04af 100644 --- a/tofu/version.py +++ b/tofu/version.py @@ -1,6 +1,2 @@ # Do not edit, pipeline versioning governed by git tags! -<<<<<<< HEAD -__version__ = '1.4.2a3-2-ge680389' -======= __version__ = '1.4.2-a4-11-g4a3c745' ->>>>>>> origin/devel From 604bf03d95fd12fb587043ddddd4b1f06c503c80 Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Thu, 28 Nov 2019 19:59:32 +0100 Subject: [PATCH 005/168] added deploy on test.pypi if on devel --- .travis.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.travis.yml b/.travis.yml index 891e8f3a0..7f438a311 100644 --- a/.travis.yml +++ b/.travis.yml @@ -112,3 +112,13 @@ deploy: branch: master password: secure: JNEDTDJVx/2fXNfHntNQ99iDRNuQ4uB3y+DBWVIBycCT95+UCb36YPtKzmruEk/UUS29Xgq4IYCGdfCSWE9smKqG8tV1PcHiw705m+AzcpKy77YtzbVECFBxqY4W36O2pHrkwEUzP/7acjFwNsnUFzArqEzsBJ+KdLaa4OPHJXCh30GA0GyqlrXYbBKG+DA9hX5vtsGo4C6w9noALYF3fS7pKPiI6ipKFnAlzGgHQ7Ke0uQME8N3IAFhmh+Z5xMtIIDWxlnqv+KszdG4DIaGV/W6NIJNAbRhzkqUd+Chu6LoPAd/XkHDTeirR/MBkNUc5UcRJxRnP9rUTRo1gCO/buTYuNRgFkMvqhV5a033+x9edWgtUiKNJIMPLXOxe0RJvc5GWji+Co77HtHxRmGRM2rnYqWMtZeYZlFbUdvHu/8jf0d6I8jyUgAoJYdlMA2u/ipENP3S6by4epE9qycUPXiIVh6r3DZbf3vPTMFvTZYAjBrA0NOzihv1xgcXwemmNUFOQSpe0io4UcFxtS9lLMo+30UMQjCHSnbEVM3zSlZmbMOKpkVOlKlt8Lz5NxwVgWtu9FuW2pGukLtE8AWbqvY9urXAPZCQqZlOIklIjJQIqOITnuw9LEV09cgvPHXfdvNni3ldbMlIQ89zryM6dYvhYryTiEZGK4JDR3wAKJA= + - provider: pypi + user: "Didou09" + distributions: "sdist" + skip_existing: true + skip_cleanup: true + on: + branch: devel + server: https://test.pypi.org/legacy/ + password: + secure: JNEDTDJVx/2fXNfHntNQ99iDRNuQ4uB3y+DBWVIBycCT95+UCb36YPtKzmruEk/UUS29Xgq4IYCGdfCSWE9smKqG8tV1PcHiw705m+AzcpKy77YtzbVECFBxqY4W36O2pHrkwEUzP/7acjFwNsnUFzArqEzsBJ+KdLaa4OPHJXCh30GA0GyqlrXYbBKG+DA9hX5vtsGo4C6w9noALYF3fS7pKPiI6ipKFnAlzGgHQ7Ke0uQME8N3IAFhmh+Z5xMtIIDWxlnqv+KszdG4DIaGV/W6NIJNAbRhzkqUd+Chu6LoPAd/XkHDTeirR/MBkNUc5UcRJxRnP9rUTRo1gCO/buTYuNRgFkMvqhV5a033+x9edWgtUiKNJIMPLXOxe0RJvc5GWji+Co77HtHxRmGRM2rnYqWMtZeYZlFbUdvHu/8jf0d6I8jyUgAoJYdlMA2u/ipENP3S6by4epE9qycUPXiIVh6r3DZbf3vPTMFvTZYAjBrA0NOzihv1xgcXwemmNUFOQSpe0io4UcFxtS9lLMo+30UMQjCHSnbEVM3zSlZmbMOKpkVOlKlt8Lz5NxwVgWtu9FuW2pGukLtE8AWbqvY9urXAPZCQqZlOIklIjJQIqOITnuw9LEV09cgvPHXfdvNni3ldbMlIQ89zryM6dYvhYryTiEZGK4JDR3wAKJA= From d121e41dae5e66dfb78b37d432fa7270d013310b Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Thu, 28 Nov 2019 19:59:47 +0100 Subject: [PATCH 006/168] added deploy on test.pypi if on deploy-test --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7f438a311..b0e748c4b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -118,7 +118,7 @@ deploy: skip_existing: true skip_cleanup: true on: - branch: devel + branch: deploy-test server: https://test.pypi.org/legacy/ password: secure: JNEDTDJVx/2fXNfHntNQ99iDRNuQ4uB3y+DBWVIBycCT95+UCb36YPtKzmruEk/UUS29Xgq4IYCGdfCSWE9smKqG8tV1PcHiw705m+AzcpKy77YtzbVECFBxqY4W36O2pHrkwEUzP/7acjFwNsnUFzArqEzsBJ+KdLaa4OPHJXCh30GA0GyqlrXYbBKG+DA9hX5vtsGo4C6w9noALYF3fS7pKPiI6ipKFnAlzGgHQ7Ke0uQME8N3IAFhmh+Z5xMtIIDWxlnqv+KszdG4DIaGV/W6NIJNAbRhzkqUd+Chu6LoPAd/XkHDTeirR/MBkNUc5UcRJxRnP9rUTRo1gCO/buTYuNRgFkMvqhV5a033+x9edWgtUiKNJIMPLXOxe0RJvc5GWji+Co77HtHxRmGRM2rnYqWMtZeYZlFbUdvHu/8jf0d6I8jyUgAoJYdlMA2u/ipENP3S6by4epE9qycUPXiIVh6r3DZbf3vPTMFvTZYAjBrA0NOzihv1xgcXwemmNUFOQSpe0io4UcFxtS9lLMo+30UMQjCHSnbEVM3zSlZmbMOKpkVOlKlt8Lz5NxwVgWtu9FuW2pGukLtE8AWbqvY9urXAPZCQqZlOIklIjJQIqOITnuw9LEV09cgvPHXfdvNni3ldbMlIQ89zryM6dYvhYryTiEZGK4JDR3wAKJA= From 564625935437eb52a52b7b9212cff99956f8a97f Mon Sep 17 00:00:00 2001 From: "Laura S. Mendoza" Date: Sun, 1 Dec 2019 16:19:10 +0100 Subject: [PATCH 007/168] [pypi deploy] took out apt get, named osx jobs --- .travis.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index b0e748c4b..58ab213c7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,13 +26,15 @@ matrix: env: - REPO=https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh - OS=linux-64 - - os: osx + - name: "osx python 3.7" + os: osx language: generic env: - REPO=https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh - TRAVIS_PYTHON_VERSION=3.7 - OS=osx-64 - - os: osx + - name: "osx python 3.6" + os: osx language: generic env: - REPO=https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh @@ -40,7 +42,6 @@ matrix: - OS=osx-64 before_install: - - sudo apt-get update - ldd --version - gcc --version - export START=$(pwd) From a2b22b06115f7dca11167e17f8fdce005e72ea25 Mon Sep 17 00:00:00 2001 From: "Laura S. Mendoza" Date: Sun, 1 Dec 2019 16:38:37 +0100 Subject: [PATCH 008/168] [travis] took out ldd version --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 58ab213c7..5160efe3c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,7 +42,6 @@ matrix: - OS=osx-64 before_install: - - ldd --version - gcc --version - export START=$(pwd) From 9c42de2571cd9230bac7ff7d28aaa1c87978471d Mon Sep 17 00:00:00 2001 From: "Laura S. Mendoza" Date: Sun, 1 Dec 2019 16:50:47 +0100 Subject: [PATCH 009/168] [pypi] naming linux jobs --- .travis.yml | 12 +++-- Notebooks/Cython_speedup_notes.ipynb | 67 ++++++++++++++++++---------- 2 files changed, 51 insertions(+), 28 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5160efe3c..b618ba4e0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,25 +2,29 @@ language: python matrix: include: - - os: linux + - name: "trusty python 3.7" + os: linux dist: trusty python: 3.7 env: - REPO=https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh - OS=linux-64 - - os: linux + - name: "trusty python 3.6" + os: linux dist: trusty python: 3.6 env: - REPO=https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh - OS=linux-64 - - os: linux + - name: "xenial python 3.7" + os: linux dist: xenial python: 3.7 env: - REPO=https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh - OS=linux-64 - - os: linux + - name: "xenial python 3.6" + os: linux dist: xenial python: 3.6 env: diff --git a/Notebooks/Cython_speedup_notes.ipynb b/Notebooks/Cython_speedup_notes.ipynb index bead1fb51..9635fdd7c 100644 --- a/Notebooks/Cython_speedup_notes.ipynb +++ b/Notebooks/Cython_speedup_notes.ipynb @@ -94,20 +94,20 @@ "output_type": "stream", "text": [ "For L = 1000\n", - "0.360000 μs, using the untyped_func\n", - "0.123000 μs, using the somewhat_typed_func\n", - "0.113000 μs, using the typed_func\n", - "0.029000 μs, using the inline_typed_func\n", + "0.798000 μs, using the untyped_func\n", + "0.027000 μs, using the somewhat_typed_func\n", + "0.017000 μs, using the typed_func\n", + "0.008000 μs, using the inline_typed_func\n", "For L = 10000\n", - "5.174000 μs, using the untyped_func\n", - "0.024000 μs, using the somewhat_typed_func\n", - "0.012000 μs, using the typed_func\n", - "0.015000 μs, using the inline_typed_func\n", + "8.871000 μs, using the untyped_func\n", + "0.027000 μs, using the somewhat_typed_func\n", + "0.014000 μs, using the typed_func\n", + "0.014000 μs, using the inline_typed_func\n", "For L = 100000\n", - "43.197000 μs, using the untyped_func\n", - "0.151000 μs, using the somewhat_typed_func\n", - "0.025000 μs, using the typed_func\n", - "0.024000 μs, using the inline_typed_func\n" + "81.221000 μs, using the untyped_func\n", + "0.148000 μs, using the somewhat_typed_func\n", + "0.010000 μs, using the typed_func\n", + "0.015000 μs, using the inline_typed_func\n" ] } ], @@ -200,7 +200,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 4, "metadata": {}, "outputs": [ { @@ -210,19 +210,19 @@ "\n", "-------- TESTS -------\n", "Running numpy buffers\n", - "0.020667 0.009333 0.098333 0.882333 6.571667 58.261333 670.627333 μs\n", + "0.010667 0.027000 0.108667 0.926667 11.027667 95.586333 1118.653333 μs\n", "Running cpython.array buffer\n", - "0.327333 0.090000 0.323333 0.742333 7.339333 70.054000 1853.809000 μs\n", + "0.074667 0.091667 0.351667 3.606667 25.803333 230.891000 2605.097000 μs\n", "Running cpython.array memoryview\n", - "0.890333 0.785000 1.215667 1.305667 6.270667 44.810333 538.815667 μs\n", + "0.325333 0.398667 1.079000 1.887667 7.430000 79.003667 1005.866000 μs\n", "Running cpython.array raw C type with trick\n", - "0.044000 0.048667 0.380000 1.419333 10.037000 100.486667 2541.475333 μs\n", + "0.035000 0.041667 0.119667 0.787667 8.991000 93.519667 1401.235667 μs\n", "Running C pointers\n", - "0.006000 0.006333 0.023667 0.159000 2.129667 25.866667 363.967667 μs\n", + "0.005000 0.006667 0.057333 0.563333 5.081000 35.753000 887.650667 μs\n", "Running malloc memoryview\n", - "0.588667 0.630333 0.663667 1.224333 2.392333 23.987667 379.138667 μs\n", + "0.482333 1.043333 0.778000 1.127333 6.685000 53.277667 798.593333 μs\n", "Running argument memoryview\n", - "0.011667 0.016333 0.112000 0.722667 5.305000 45.683333 525.975333 μs\n" + "0.008000 0.019000 0.156000 1.217000 10.740000 96.713667 1305.644333 μs\n" ] } ], @@ -391,7 +391,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 5, "metadata": {}, "outputs": [], "source": [ @@ -402,9 +402,28 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 6, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "For L = 1000\n", + "10.211000 μs, using the sequential loop\n", + "58.846000 μs, using the parallel 1 loop\n", + "25.343000 μs, using the parallel 2 loop\n", + "For L = 10000\n", + "53.134000 μs, using the sequential loop\n", + "180.918000 μs, using the parallel 1 loop\n", + "49.014000 μs, using the parallel 2 loop\n", + "For L = 100000\n", + "827.005000 μs, using the sequential loop\n", + "601.007000 μs, using the parallel 1 loop\n", + "132.242000 μs, using the parallel 2 loop\n" + ] + } + ], "source": [ "%%cython --compile=-fopenmp --link-args=-fopenmp\n", "\n", @@ -650,7 +669,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.2" + "version": "3.7.5" } }, "nbformat": 4, From 800a14d82fea3508acfbcb7df0a2237918707774 Mon Sep 17 00:00:00 2001 From: "Laura S. Mendoza" Date: Sun, 1 Dec 2019 17:06:06 +0100 Subject: [PATCH 010/168] [pypi] bionic 3.7 --- .travis.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index b618ba4e0..27b33bd88 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,10 +2,12 @@ language: python matrix: include: - - name: "trusty python 3.7" + - name: "Bionic python 3.7" os: linux - dist: trusty - python: 3.7 + dist: bionic + python: + - 3.7 + - 3.8 env: - REPO=https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh - OS=linux-64 @@ -19,7 +21,8 @@ matrix: - name: "xenial python 3.7" os: linux dist: xenial - python: 3.7 + python: + - 3.7 env: - REPO=https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh - OS=linux-64 @@ -36,14 +39,15 @@ matrix: env: - REPO=https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh - TRAVIS_PYTHON_VERSION=3.7 + - TRAVIS_PYTHON_VERSION=3.6 - OS=osx-64 - name: "osx python 3.6" os: osx language: generic env: - REPO=https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh - - TRAVIS_PYTHON_VERSION=3.6 - OS=osx-64 + - TRAVIS_PYTHON_VERSION=3.6 before_install: - gcc --version From 2a8fe2eba9d8440709ea79e8ef9afdc10d4cec2a Mon Sep 17 00:00:00 2001 From: "Laura S. Mendoza" Date: Sun, 1 Dec 2019 17:19:09 +0100 Subject: [PATCH 011/168] [pypi] bionic 3.8 --- .travis.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 27b33bd88..eead07a7f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,12 +2,17 @@ language: python matrix: include: + - name: "Bionic python 3.8" + os: linux + dist: bionic + python: 3.8 + env: + - REPO=https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh + - OS=linux-64 - name: "Bionic python 3.7" os: linux dist: bionic - python: - - 3.7 - - 3.8 + python: 3.7 env: - REPO=https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh - OS=linux-64 @@ -21,8 +26,7 @@ matrix: - name: "xenial python 3.7" os: linux dist: xenial - python: - - 3.7 + python: 3.7 env: - REPO=https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh - OS=linux-64 @@ -39,15 +43,14 @@ matrix: env: - REPO=https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh - TRAVIS_PYTHON_VERSION=3.7 - - TRAVIS_PYTHON_VERSION=3.6 - OS=osx-64 - name: "osx python 3.6" os: osx language: generic env: - REPO=https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh - - OS=osx-64 - TRAVIS_PYTHON_VERSION=3.6 + - OS=osx-64 before_install: - gcc --version From f68a9beb04f37237f260a3153e6b0eae48cf5064 Mon Sep 17 00:00:00 2001 From: "Laura S. Mendoza" Date: Sun, 1 Dec 2019 17:47:10 +0100 Subject: [PATCH 012/168] [pypi] took out bionic 3.8 --- .travis.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index eead07a7f..468437a9a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,13 +2,6 @@ language: python matrix: include: - - name: "Bionic python 3.8" - os: linux - dist: bionic - python: 3.8 - env: - - REPO=https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh - - OS=linux-64 - name: "Bionic python 3.7" os: linux dist: bionic From da1cbf8e8c244b576e6e2c3e86a23ee56d7d5bef Mon Sep 17 00:00:00 2001 From: "Laura S. Mendoza" Date: Sun, 1 Dec 2019 18:33:00 +0100 Subject: [PATCH 013/168] [pypi] install conda-verify --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 468437a9a..56bc35ab3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -64,8 +64,8 @@ install: - conda config --append channels conda-forge - conda config --append channels tofuproject - conda info -a - - conda install -q python="$TRAVIS_PYTHON_VERSION" conda-build anaconda-client nose - nose-timer coverage codecov + - conda install -q python="$TRAVIS_PYTHON_VERSION" conda-build conda-verify + nose nose-timer coverage codecov - export REV=$(python -c "import _updateversion as up; out=up.updateversion(); print(out)") - export VERSION=$(echo $REV | tr - .) - echo $REV From 49c921336d3df1b137541845e9add178421c49ca Mon Sep 17 00:00:00 2001 From: "Laura S. Mendoza" Date: Sun, 1 Dec 2019 23:18:14 +0100 Subject: [PATCH 014/168] [pypi] cleaning some more --- .travis.yml | 9 +-------- conda_recipe/conda_upload.sh | 16 ++++------------ conda_recipe/meta.yaml | 3 --- tofu/version.py | 2 +- 4 files changed, 6 insertions(+), 24 deletions(-) diff --git a/.travis.yml b/.travis.yml index 56bc35ab3..223e4b91e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -50,27 +50,20 @@ before_install: - export START=$(pwd) install: - - if [[ "$TRAVIS_PYTHON_VERSION" == "3.7" ]]; then export VADD="py37"; - else export VADD="py36"; fi - wget "$REPO" -O miniconda.sh - bash miniconda.sh -b -p $HOME/miniconda - export PATH="$HOME/miniconda/bin:$PATH" - hash -r - conda config --set always_yes yes --set changeps1 no - - conda install conda-build - conda update -q conda - - conda update -n root conda-build - - conda config --set anaconda_upload no - conda config --append channels conda-forge - conda config --append channels tofuproject - conda info -a - - conda install -q python="$TRAVIS_PYTHON_VERSION" conda-build conda-verify + - conda install -q python="$TRAVIS_PYTHON_VERSION" conda-verify nose nose-timer coverage codecov - export REV=$(python -c "import _updateversion as up; out=up.updateversion(); print(out)") - export VERSION=$(echo $REV | tr - .) - echo $REV - - conda build conda_recipe - - export PKG_DIR=$HOME/miniconda/conda-bld/$OS - conda install tofu --use-local script: diff --git a/conda_recipe/conda_upload.sh b/conda_recipe/conda_upload.sh index ea1ed9a0d..d274161c9 100644 --- a/conda_recipe/conda_upload.sh +++ b/conda_recipe/conda_upload.sh @@ -2,18 +2,10 @@ PKG_NAME=tofu USER=ToFuProject -#mkdir ~/conda-bld -#conda config --set anaconda_upload no -#conda update -n root conda-build -#conda config --append channels conda-forge -#conda config --append channels tofuproject -#export CONDA_BLD_PATH=~/conda-bld -#export VERSION=`date +%Y.%m.%d` -#export VERSION=$(head -n 1 version.txt) - -#conda build conda_recipe +conda config --set anaconda_upload no +conda install anaconda-client conda-build +conda build conda_recipe +export PKG_REAL=$(conda build . --output | tail -1) echo "Available conda packages:" -echo $(find $CONDA_BLD_PATH/$OS/ -type f -name $PKG_NAME*.tar.bz2) -PKG_REAL=$(find $CONDA_BLD_PATH/$OS/ -type f -name $PKG_NAME-$VERSION-$VADD*.tar.bz2) echo $PKG_REAL anaconda -t $CONDA_UPLOAD_TOKEN upload -u $USER -l main $PKG_REAL --force diff --git a/conda_recipe/meta.yaml b/conda_recipe/meta.yaml index 5d9a3e38a..5701128da 100644 --- a/conda_recipe/meta.yaml +++ b/conda_recipe/meta.yaml @@ -8,10 +8,7 @@ source: build: script_env: - - OS - - VERSION - TRAVIS_BRANCH - - CONDA_BLD_PATH requirements: diff --git a/tofu/version.py b/tofu/version.py index 0ffec04af..cc34a4003 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.2-a4-11-g4a3c745' +__version__ = '1.4.2-a5-13-gda1cbf8e' From 7ceedca7cbdb27b173c6106c6bc8ed34042cc28f Mon Sep 17 00:00:00 2001 From: "Laura S. Mendoza" Date: Sun, 1 Dec 2019 23:30:38 +0100 Subject: [PATCH 015/168] [pypi] using pip instead of conda install --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 223e4b91e..f461d89ec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -64,7 +64,7 @@ install: - export REV=$(python -c "import _updateversion as up; out=up.updateversion(); print(out)") - export VERSION=$(echo $REV | tr - .) - echo $REV - - conda install tofu --use-local + - pip install -e ".[dev]" script: - cd $HOME From 566ccffd473d2b697acb9a3567524d124913f366 Mon Sep 17 00:00:00 2001 From: "Laura S. Mendoza" Date: Mon, 2 Dec 2019 00:56:30 +0100 Subject: [PATCH 016/168] [pypi] befor deploy --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index f461d89ec..bdbb169a2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -79,6 +79,9 @@ after_success: before_deploy: - ls $START - cd $START + - conda install anaconda-client conda-build + - conda config --set anaconda_upload no + - conda build conda_recipe deploy: - provider: script From 98b6fd81c642c204a13943d19ba480015603d3f2 Mon Sep 17 00:00:00 2001 From: "Laura S. Mendoza" Date: Mon, 2 Dec 2019 01:41:12 +0100 Subject: [PATCH 017/168] [pypi] exported path correctly --- .travis.yml | 1 + conda_recipe/conda_upload.sh | 5 ----- conda_recipe/meta.yaml | 1 + 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index bdbb169a2..b95c30fe6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -82,6 +82,7 @@ before_deploy: - conda install anaconda-client conda-build - conda config --set anaconda_upload no - conda build conda_recipe + - export PKG_REAL=$(conda build . --output | tail -1) deploy: - provider: script diff --git a/conda_recipe/conda_upload.sh b/conda_recipe/conda_upload.sh index d274161c9..4fe6fa2b5 100644 --- a/conda_recipe/conda_upload.sh +++ b/conda_recipe/conda_upload.sh @@ -1,11 +1,6 @@ # Only need to change these two variables -PKG_NAME=tofu USER=ToFuProject -conda config --set anaconda_upload no -conda install anaconda-client conda-build -conda build conda_recipe -export PKG_REAL=$(conda build . --output | tail -1) echo "Available conda packages:" echo $PKG_REAL anaconda -t $CONDA_UPLOAD_TOKEN upload -u $USER -l main $PKG_REAL --force diff --git a/conda_recipe/meta.yaml b/conda_recipe/meta.yaml index 5701128da..2f0a3752c 100644 --- a/conda_recipe/meta.yaml +++ b/conda_recipe/meta.yaml @@ -8,6 +8,7 @@ source: build: script_env: + - PKG_REAL - TRAVIS_BRANCH requirements: From 26abdf7d26a9f0158c07ffc44ae7cab077cdab27 Mon Sep 17 00:00:00 2001 From: "Laura S. Mendoza" Date: Mon, 2 Dec 2019 01:44:21 +0100 Subject: [PATCH 018/168] [pypi] no need to deploy if not tagged --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index b95c30fe6..c03e586af 100644 --- a/.travis.yml +++ b/.travis.yml @@ -119,6 +119,7 @@ deploy: skip_existing: true skip_cleanup: true on: + tags: true branch: deploy-test server: https://test.pypi.org/legacy/ password: From 1c5f658a705c18d32cfecf1b71eee6ac4cd7ce6f Mon Sep 17 00:00:00 2001 From: "Laura S. Mendoza" Date: Mon, 2 Dec 2019 01:58:26 +0100 Subject: [PATCH 019/168] echoing path --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index c03e586af..ce5e49d33 100644 --- a/.travis.yml +++ b/.travis.yml @@ -83,6 +83,7 @@ before_deploy: - conda config --set anaconda_upload no - conda build conda_recipe - export PKG_REAL=$(conda build . --output | tail -1) + - echo $PKG_REAL deploy: - provider: script From 28544ed5a26b3d83259c3431948575d96e4d193b Mon Sep 17 00:00:00 2001 From: "Laura S. Mendoza" Date: Mon, 2 Dec 2019 02:11:23 +0100 Subject: [PATCH 020/168] echoing path --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index ce5e49d33..dbaa2fad2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -90,8 +90,8 @@ deploy: user: "ToFuProject" script: $START/anaconda_upload.sh on: - tags: true branch: master + tags: true skip_cleanup: true - provider: pypi user: "Didou09" @@ -99,8 +99,8 @@ deploy: skip_existing: true skip_cleanup: true on: - tags: true branch: master + tags: true password: secure: JNEDTDJVx/2fXNfHntNQ99iDRNuQ4uB3y+DBWVIBycCT95+UCb36YPtKzmruEk/UUS29Xgq4IYCGdfCSWE9smKqG8tV1PcHiw705m+AzcpKy77YtzbVECFBxqY4W36O2pHrkwEUzP/7acjFwNsnUFzArqEzsBJ+KdLaa4OPHJXCh30GA0GyqlrXYbBKG+DA9hX5vtsGo4C6w9noALYF3fS7pKPiI6ipKFnAlzGgHQ7Ke0uQME8N3IAFhmh+Z5xMtIIDWxlnqv+KszdG4DIaGV/W6NIJNAbRhzkqUd+Chu6LoPAd/XkHDTeirR/MBkNUc5UcRJxRnP9rUTRo1gCO/buTYuNRgFkMvqhV5a033+x9edWgtUiKNJIMPLXOxe0RJvc5GWji+Co77HtHxRmGRM2rnYqWMtZeYZlFbUdvHu/8jf0d6I8jyUgAoJYdlMA2u/ipENP3S6by4epE9qycUPXiIVh6r3DZbf3vPTMFvTZYAjBrA0NOzihv1xgcXwemmNUFOQSpe0io4UcFxtS9lLMo+30UMQjCHSnbEVM3zSlZmbMOKpkVOlKlt8Lz5NxwVgWtu9FuW2pGukLtE8AWbqvY9urXAPZCQqZlOIklIjJQIqOITnuw9LEV09cgvPHXfdvNni3ldbMlIQ89zryM6dYvhYryTiEZGK4JDR3wAKJA= - provider: pypi From 2589c5792a4e1af56b14a656d1db6dc704fe37bc Mon Sep 17 00:00:00 2001 From: "Laura S. Mendoza" Date: Mon, 2 Dec 2019 02:12:47 +0100 Subject: [PATCH 021/168] shouldnt be deploying to conda --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index dbaa2fad2..b59496512 100644 --- a/.travis.yml +++ b/.travis.yml @@ -59,6 +59,7 @@ install: - conda config --append channels conda-forge - conda config --append channels tofuproject - conda info -a + - conda config --set anaconda_upload no - conda install -q python="$TRAVIS_PYTHON_VERSION" conda-verify nose nose-timer coverage codecov - export REV=$(python -c "import _updateversion as up; out=up.updateversion(); print(out)") @@ -80,7 +81,6 @@ before_deploy: - ls $START - cd $START - conda install anaconda-client conda-build - - conda config --set anaconda_upload no - conda build conda_recipe - export PKG_REAL=$(conda build . --output | tail -1) - echo $PKG_REAL From 18877982a526d1f0dd6d5da247e55c0d296eecd4 Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Mon, 2 Dec 2019 10:02:49 +0100 Subject: [PATCH 022/168] set anaconda upload to false --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c03e586af..6987b5e9e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -54,6 +54,7 @@ install: - bash miniconda.sh -b -p $HOME/miniconda - export PATH="$HOME/miniconda/bin:$PATH" - hash -r + - conda config --set anaconda_upload no - conda config --set always_yes yes --set changeps1 no - conda update -q conda - conda config --append channels conda-forge @@ -80,7 +81,6 @@ before_deploy: - ls $START - cd $START - conda install anaconda-client conda-build - - conda config --set anaconda_upload no - conda build conda_recipe - export PKG_REAL=$(conda build . --output | tail -1) From c38d0ae2de6b3dd1732fb7e685a7df09c8f16a11 Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Mon, 2 Dec 2019 10:28:39 +0100 Subject: [PATCH 023/168] going back to conda for local install --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6987b5e9e..f2f6ca3d2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -65,7 +65,7 @@ install: - export REV=$(python -c "import _updateversion as up; out=up.updateversion(); print(out)") - export VERSION=$(echo $REV | tr - .) - echo $REV - - pip install -e ".[dev]" + - conda install tofu --use-local script: - cd $HOME From f435a5d54af9e710f09a391408fc7640eac058f4 Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Mon, 2 Dec 2019 10:46:23 +0100 Subject: [PATCH 024/168] installing conda build --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f2f6ca3d2..5016f03da 100644 --- a/.travis.yml +++ b/.travis.yml @@ -56,7 +56,7 @@ install: - hash -r - conda config --set anaconda_upload no - conda config --set always_yes yes --set changeps1 no - - conda update -q conda + - conda install conda-build - conda config --append channels conda-forge - conda config --append channels tofuproject - conda info -a @@ -78,11 +78,13 @@ after_success: - echo $TRAVIS_TAG before_deploy: + - echo "BEFORE DEPLOY START........" - ls $START - cd $START - conda install anaconda-client conda-build - conda build conda_recipe - export PKG_REAL=$(conda build . --output | tail -1) + - echo "BEFORE DEPLOY END.........." deploy: - provider: script From c20ae6857c8a3e75da60d1a44e796ac682e0eb62 Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Mon, 2 Dec 2019 11:13:49 +0100 Subject: [PATCH 025/168] trying install local before --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5016f03da..b9c18500a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -65,7 +65,7 @@ install: - export REV=$(python -c "import _updateversion as up; out=up.updateversion(); print(out)") - export VERSION=$(echo $REV | tr - .) - echo $REV - - conda install tofu --use-local + - conda install --use-local tofu script: - cd $HOME From 4a7a4e6796d43c0a6e64666d985a94726542d1e1 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Mon, 2 Dec 2019 15:36:57 +0100 Subject: [PATCH 026/168] [FasterLOSCalcSumCalls] Replace loop on partial sum by ufinc np.add.reduceat and made Plasma2D.get_intu() more robust vs one-time step --- tofu/data/_comp.py | 1 + tofu/data/_core.py | 12 ++++++---- tofu/geom/_core.py | 57 ++++++++++++++++------------------------------ 3 files changed, 28 insertions(+), 42 deletions(-) diff --git a/tofu/data/_comp.py b/tofu/data/_comp.py index 77abb52cb..2bbe96d4e 100644 --- a/tofu/data/_comp.py +++ b/tofu/data/_comp.py @@ -413,6 +413,7 @@ def func(pts, vect=None, t=None, ntall=ntall, shapeval = list(pts.shape) shapeval[0] = ntall if t is None else t.size val = np.full(tuple(shapeval), fill_value) + if t is None: for ii in range(0,ntall): val[ii,...] = mplTriLinInterp(mpltri, diff --git a/tofu/data/_core.py b/tofu/data/_core.py index 8913c41cd..dae5917c3 100644 --- a/tofu/data/_core.py +++ b/tofu/data/_core.py @@ -3677,11 +3677,15 @@ def _get_indtu(t=None, tall=None, tbinall=None, # Get indt (t with respect to tbinall) indt, indtu = None, None if t is not None: - indt = np.digitize(t, tbinall) - indtu = np.unique(indt) + if len(t) == len(tall) and np.allclose(t, tall): + indt = np.arange(0, tall.size) + indtu = indt + else: + indt = np.digitize(t, tbinall) + indtu = np.unique(indt) + # Update + tall = tall[indtu] - # Update - tall = tall[indtu] if idref1d is not None: assert indtr1 is not None indtr1 = indtr1[indtu] diff --git a/tofu/geom/_core.py b/tofu/geom/_core.py index 4e4021a11..6f36050f2 100644 --- a/tofu/geom/_core.py +++ b/tofu/geom/_core.py @@ -6025,7 +6025,7 @@ def calc_signal( reflections=True, coefs=None, ind=None, - out=object, + returnas=object, plot=True, dataname=None, fs=None, @@ -6086,7 +6086,7 @@ def calc_signal( # Format input indok, Ds, us, DL, E = self._calc_signal_preformat( - ind=ind, DL=DL, out=out, Brightness=Brightness + ind=ind, DL=DL, out=returnas, Brightness=Brightness ) if Ds is None: @@ -6180,19 +6180,8 @@ def calc_signal( # and interferometer) val = func(pts, t=t, vect=vect) # Integrate - if val.ndim == 2: - sig = np.full((val.shape[0], self.nRays), np.nan) - else: - sig = np.full((1, self.nRays), np.nan) - indpts = np.r_[0, indpts, pts.shape[1]] - for ii in range(0, self.nRays): - sig[:, ii] = ( - np.nansum( - val[:, indpts[ii]:indpts[ii + 1]], - axis=-1 - ) - * reseff[ii] - ) + sig = np.add.reduceat(val, np.r_[0, indpts], axis=-1)*reseff[None, :] + # Format output return self._calc_signal_postformat( sig, @@ -6202,7 +6191,7 @@ def calc_signal( E=E, units=units, plot=plot, - out=out, + out=returnas, fs=fs, dmargin=dmargin, wintit=wintit, @@ -6236,7 +6225,7 @@ def calc_signal_from_Plasma2D( reflections=True, coefs=None, ind=None, - out=object, + returnas=object, plot=True, dataname=None, fs=None, @@ -6250,7 +6239,7 @@ def calc_signal_from_Plasma2D( # Format input indok, Ds, us, DL, E = self._calc_signal_preformat( - ind=ind, out=out, t=t, Brightness=Brightness + ind=ind, out=returnas, t=t, Brightness=Brightness ) if Ds is None: @@ -6262,12 +6251,12 @@ def calc_signal_from_Plasma2D( # Get time vector if t is None: out = plasma2d._checkformat_qr12RPZ( - quant=quant, - ref1d=ref1d, - ref2d=ref2d, - q2dR=q2dR, - q2dPhi=q2dPhi, - q2dZ=q2dZ, + quant=quant, + ref1d=ref1d, + ref2d=ref2d, + q2dR=q2dR, + q2dPhi=q2dPhi, + q2dZ=q2dZ, ) t = plasma2d._get_tcom(*out[:4])[0] else: @@ -6368,6 +6357,8 @@ def funcbis(*args, **kwdargs): indpts[0], np.diff(indpts), pts.shape[1] - indpts[-1] ] vect = np.repeat(self.u, nbrep, axis=1) + if fill_value is None: + fill_value = 0. # Get quantity values at ptsRZ # This is the slowest step (~3.8 s with res=0.02 @@ -6388,19 +6379,9 @@ def funcbis(*args, **kwdargs): fill_value=fill_value, ) - # Integrate - if val.ndim == 2: - sig = np.full((val.shape[0], self.nRays), np.nan) - else: - sig = np.full((1, self.nRays), np.nan) - - indpts = np.r_[0, indpts, pts.shape[1]] - for ii in range(0, self.nRays): - sig[:, ii] = ( - np.nansum(val[:, indpts[ii]:indpts[ii + 1]], - axis=-1) - * reseff[ii] - ) + # Integrate using ufunc reduceat for speed + # (cf. https://stackoverflow.com/questions/59079141) + sig = np.add.reduceat(val, np.r_[0, indpts], axis=-1)*reseff[None, :] # Format output # this is the secod slowest step (~0.75 s) @@ -6412,7 +6393,7 @@ def funcbis(*args, **kwdargs): E=E, units=units, plot=plot, - out=out, + out=returnas, fs=fs, dmargin=dmargin, wintit=wintit, From 3b4947b723c8a048f72fd07ec493c253d7fd2b5e Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Mon, 2 Dec 2019 15:49:05 +0100 Subject: [PATCH 027/168] debugging --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index b9c18500a..2eeb4a33a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -65,6 +65,7 @@ install: - export REV=$(python -c "import _updateversion as up; out=up.updateversion(); print(out)") - export VERSION=$(echo $REV | tr - .) - echo $REV + - ls - conda install --use-local tofu script: From e9af491fb8f046bedbc64fd0a725b8dd09c6fdb4 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Mon, 2 Dec 2019 16:05:35 +0100 Subject: [PATCH 028/168] [(FasterLOSCalcSignalSumCalls] Corrected tests --- tofu/tests/tests01_geom/tests03_core.py | 2 +- tofu/tests/tests02_data/tests03_core.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tofu/tests/tests01_geom/tests03_core.py b/tofu/tests/tests01_geom/tests03_core.py index 8fdd22356..70c1930bc 100644 --- a/tofu/tests/tests01_geom/tests03_core.py +++ b/tofu/tests/tests01_geom/tests03_core.py @@ -874,7 +874,7 @@ def ffT(Pts, t=None, vect=None): resMode=rm, method=dm, minimize=mmz, ind=ind, - plot=False, out=np.ndarray, + plot=False, returnas=np.ndarray, fs=(12, 6), connect=connect) sig, units = out assert not np.all(np.isnan(sig)), str(ii) diff --git a/tofu/tests/tests02_data/tests03_core.py b/tofu/tests/tests02_data/tests03_core.py index 1d526102f..a10d8ed89 100644 --- a/tofu/tests/tests02_data/tests03_core.py +++ b/tofu/tests/tests02_data/tests03_core.py @@ -475,7 +475,7 @@ def setup_class(cls, nch=30, nt=50, SavePath='./', verb=False): lData = [None for ii in range(0,len(lc))] for ii in range(0,len(lc)): sig = lc[ii].calc_signal(emiss, t=t, res=0.01, method=lm[ii], - plot=False, out=np.ndarray)[0] + plot=False, returnas=np.ndarray)[0] sig = sig[:,:,None]*flamb[None,None,:] cla = eval('tfd.DataCam%sDSpectral'%('2' if lc[ii]._is2D() else '1')) data = cla(data=sig, Name='All', Diag='Test', From 5d7d5f1d9fce1472d757e66d5cc3c1c901ea8fec Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Mon, 2 Dec 2019 16:20:24 +0100 Subject: [PATCH 029/168] [FasterLOSCalcSignalSumCalls] PEP8 Compliance --- tofu/geom/_core.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tofu/geom/_core.py b/tofu/geom/_core.py index 6f36050f2..627ede3de 100644 --- a/tofu/geom/_core.py +++ b/tofu/geom/_core.py @@ -6180,7 +6180,8 @@ def calc_signal( # and interferometer) val = func(pts, t=t, vect=vect) # Integrate - sig = np.add.reduceat(val, np.r_[0, indpts], axis=-1)*reseff[None, :] + sig = np.add.reduceat(val, np.r_[0, indpts], + axis=-1)*reseff[None, :] # Format output return self._calc_signal_postformat( @@ -6381,7 +6382,8 @@ def funcbis(*args, **kwdargs): # Integrate using ufunc reduceat for speed # (cf. https://stackoverflow.com/questions/59079141) - sig = np.add.reduceat(val, np.r_[0, indpts], axis=-1)*reseff[None, :] + sig = np.add.reduceat(val, np.r_[0, indpts], + axis=-1)*reseff[None, :] # Format output # this is the secod slowest step (~0.75 s) From bc29ce65322821322d9af94fb9c21ee0a3a5cd82 Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Mon, 2 Dec 2019 16:37:47 +0100 Subject: [PATCH 030/168] [deploy] for conda install local needs condabuild before --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2eeb4a33a..228d4d87e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -65,8 +65,7 @@ install: - export REV=$(python -c "import _updateversion as up; out=up.updateversion(); print(out)") - export VERSION=$(echo $REV | tr - .) - echo $REV - - ls - - conda install --use-local tofu + - pip install -e ".[dev]" script: - cd $HOME From b73badccb48d85bfd40b01b70a2e4bdbd141fc21 Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Mon, 2 Dec 2019 16:41:17 +0100 Subject: [PATCH 031/168] [deploy] commenting all other deploy --- .travis.yml | 59 ++++++++++++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/.travis.yml b/.travis.yml index 228d4d87e..1f06c3a48 100644 --- a/.travis.yml +++ b/.travis.yml @@ -54,9 +54,7 @@ install: - bash miniconda.sh -b -p $HOME/miniconda - export PATH="$HOME/miniconda/bin:$PATH" - hash -r - - conda config --set anaconda_upload no - conda config --set always_yes yes --set changeps1 no - - conda install conda-build - conda config --append channels conda-forge - conda config --append channels tofuproject - conda info -a @@ -81,40 +79,41 @@ before_deploy: - echo "BEFORE DEPLOY START........" - ls $START - cd $START + - conda config --set anaconda_upload no - conda install anaconda-client conda-build - conda build conda_recipe - export PKG_REAL=$(conda build . --output | tail -1) - echo "BEFORE DEPLOY END.........." deploy: - - provider: script - user: "ToFuProject" - script: $START/anaconda_upload.sh - on: - tags: true - branch: master - skip_cleanup: true - - provider: pypi - user: "Didou09" - distributions: "sdist" - skip_existing: true - skip_cleanup: true - on: - tags: true - branch: master - password: - secure: JNEDTDJVx/2fXNfHntNQ99iDRNuQ4uB3y+DBWVIBycCT95+UCb36YPtKzmruEk/UUS29Xgq4IYCGdfCSWE9smKqG8tV1PcHiw705m+AzcpKy77YtzbVECFBxqY4W36O2pHrkwEUzP/7acjFwNsnUFzArqEzsBJ+KdLaa4OPHJXCh30GA0GyqlrXYbBKG+DA9hX5vtsGo4C6w9noALYF3fS7pKPiI6ipKFnAlzGgHQ7Ke0uQME8N3IAFhmh+Z5xMtIIDWxlnqv+KszdG4DIaGV/W6NIJNAbRhzkqUd+Chu6LoPAd/XkHDTeirR/MBkNUc5UcRJxRnP9rUTRo1gCO/buTYuNRgFkMvqhV5a033+x9edWgtUiKNJIMPLXOxe0RJvc5GWji+Co77HtHxRmGRM2rnYqWMtZeYZlFbUdvHu/8jf0d6I8jyUgAoJYdlMA2u/ipENP3S6by4epE9qycUPXiIVh6r3DZbf3vPTMFvTZYAjBrA0NOzihv1xgcXwemmNUFOQSpe0io4UcFxtS9lLMo+30UMQjCHSnbEVM3zSlZmbMOKpkVOlKlt8Lz5NxwVgWtu9FuW2pGukLtE8AWbqvY9urXAPZCQqZlOIklIjJQIqOITnuw9LEV09cgvPHXfdvNni3ldbMlIQ89zryM6dYvhYryTiEZGK4JDR3wAKJA= - - provider: pypi - user: "Didou09" - distributions: "bdist_wheel" - skip_existing: true - skip_cleanup: true - on: - tags: true - condition: $OS = osx-64 - branch: master - password: - secure: JNEDTDJVx/2fXNfHntNQ99iDRNuQ4uB3y+DBWVIBycCT95+UCb36YPtKzmruEk/UUS29Xgq4IYCGdfCSWE9smKqG8tV1PcHiw705m+AzcpKy77YtzbVECFBxqY4W36O2pHrkwEUzP/7acjFwNsnUFzArqEzsBJ+KdLaa4OPHJXCh30GA0GyqlrXYbBKG+DA9hX5vtsGo4C6w9noALYF3fS7pKPiI6ipKFnAlzGgHQ7Ke0uQME8N3IAFhmh+Z5xMtIIDWxlnqv+KszdG4DIaGV/W6NIJNAbRhzkqUd+Chu6LoPAd/XkHDTeirR/MBkNUc5UcRJxRnP9rUTRo1gCO/buTYuNRgFkMvqhV5a033+x9edWgtUiKNJIMPLXOxe0RJvc5GWji+Co77HtHxRmGRM2rnYqWMtZeYZlFbUdvHu/8jf0d6I8jyUgAoJYdlMA2u/ipENP3S6by4epE9qycUPXiIVh6r3DZbf3vPTMFvTZYAjBrA0NOzihv1xgcXwemmNUFOQSpe0io4UcFxtS9lLMo+30UMQjCHSnbEVM3zSlZmbMOKpkVOlKlt8Lz5NxwVgWtu9FuW2pGukLtE8AWbqvY9urXAPZCQqZlOIklIjJQIqOITnuw9LEV09cgvPHXfdvNni3ldbMlIQ89zryM6dYvhYryTiEZGK4JDR3wAKJA= + # - provider: script + # user: "ToFuProject" + # script: $START/anaconda_upload.sh + # on: + # tags: true + # branch: master + # skip_cleanup: true + # - provider: pypi + # user: "Didou09" + # distributions: "sdist" + # skip_existing: true + # skip_cleanup: true + # on: + # tags: true + # branch: master + # password: + # secure: JNEDTDJVx/2fXNfHntNQ99iDRNuQ4uB3y+DBWVIBycCT95+UCb36YPtKzmruEk/UUS29Xgq4IYCGdfCSWE9smKqG8tV1PcHiw705m+AzcpKy77YtzbVECFBxqY4W36O2pHrkwEUzP/7acjFwNsnUFzArqEzsBJ+KdLaa4OPHJXCh30GA0GyqlrXYbBKG+DA9hX5vtsGo4C6w9noALYF3fS7pKPiI6ipKFnAlzGgHQ7Ke0uQME8N3IAFhmh+Z5xMtIIDWxlnqv+KszdG4DIaGV/W6NIJNAbRhzkqUd+Chu6LoPAd/XkHDTeirR/MBkNUc5UcRJxRnP9rUTRo1gCO/buTYuNRgFkMvqhV5a033+x9edWgtUiKNJIMPLXOxe0RJvc5GWji+Co77HtHxRmGRM2rnYqWMtZeYZlFbUdvHu/8jf0d6I8jyUgAoJYdlMA2u/ipENP3S6by4epE9qycUPXiIVh6r3DZbf3vPTMFvTZYAjBrA0NOzihv1xgcXwemmNUFOQSpe0io4UcFxtS9lLMo+30UMQjCHSnbEVM3zSlZmbMOKpkVOlKlt8Lz5NxwVgWtu9FuW2pGukLtE8AWbqvY9urXAPZCQqZlOIklIjJQIqOITnuw9LEV09cgvPHXfdvNni3ldbMlIQ89zryM6dYvhYryTiEZGK4JDR3wAKJA= + # - provider: pypi + # user: "Didou09" + # distributions: "bdist_wheel" + # skip_existing: true + # skip_cleanup: true + # on: + # tags: true + # condition: $OS = osx-64 + # branch: master + # password: + # secure: JNEDTDJVx/2fXNfHntNQ99iDRNuQ4uB3y+DBWVIBycCT95+UCb36YPtKzmruEk/UUS29Xgq4IYCGdfCSWE9smKqG8tV1PcHiw705m+AzcpKy77YtzbVECFBxqY4W36O2pHrkwEUzP/7acjFwNsnUFzArqEzsBJ+KdLaa4OPHJXCh30GA0GyqlrXYbBKG+DA9hX5vtsGo4C6w9noALYF3fS7pKPiI6ipKFnAlzGgHQ7Ke0uQME8N3IAFhmh+Z5xMtIIDWxlnqv+KszdG4DIaGV/W6NIJNAbRhzkqUd+Chu6LoPAd/XkHDTeirR/MBkNUc5UcRJxRnP9rUTRo1gCO/buTYuNRgFkMvqhV5a033+x9edWgtUiKNJIMPLXOxe0RJvc5GWji+Co77HtHxRmGRM2rnYqWMtZeYZlFbUdvHu/8jf0d6I8jyUgAoJYdlMA2u/ipENP3S6by4epE9qycUPXiIVh6r3DZbf3vPTMFvTZYAjBrA0NOzihv1xgcXwemmNUFOQSpe0io4UcFxtS9lLMo+30UMQjCHSnbEVM3zSlZmbMOKpkVOlKlt8Lz5NxwVgWtu9FuW2pGukLtE8AWbqvY9urXAPZCQqZlOIklIjJQIqOITnuw9LEV09cgvPHXfdvNni3ldbMlIQ89zryM6dYvhYryTiEZGK4JDR3wAKJA= - provider: pypi user: "Didou09" distributions: "sdist" From 497be636c5340913696ee0845b649259119b6b92 Mon Sep 17 00:00:00 2001 From: flothesof Date: Mon, 2 Dec 2019 17:11:01 +0100 Subject: [PATCH 032/168] adding NSTX geometry --- tofu/geom/inputs/TFG_Ves_ExpNSTX_V0.txt | 139 ++++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 tofu/geom/inputs/TFG_Ves_ExpNSTX_V0.txt diff --git a/tofu/geom/inputs/TFG_Ves_ExpNSTX_V0.txt b/tofu/geom/inputs/TFG_Ves_ExpNSTX_V0.txt new file mode 100644 index 000000000..6d0105048 --- /dev/null +++ b/tofu/geom/inputs/TFG_Ves_ExpNSTX_V0.txt @@ -0,0 +1,139 @@ +# Cls = Ves +# Exp = NSTX +# Name = V0 +1.350000000000000000e+02 0.000000000000000000e+00 +1.822552000000000061e-01 -6.049220000000000291e-02 +1.822552000000000061e-01 -1.091094999999999982e-01 +1.822552000000000061e-01 -1.577268000000000003e-01 +1.904033000000000253e-01 -2.063441999999999776e-01 +1.904033000000000253e-01 -2.549615000000000076e-01 +1.904033000000000253e-01 -3.035788000000000375e-01 +1.904033000000000253e-01 -3.521961000000000119e-01 +1.904033000000000253e-01 -4.008133999999999864e-01 +1.904033000000000253e-01 -4.494307000000000163e-01 +1.904033000000000253e-01 -4.980479999999999907e-01 +1.904033000000000253e-01 -5.466653000000000207e-01 +1.904033000000000253e-01 -5.952825999999999951e-01 +1.904033000000000253e-01 -6.438998999999999695e-01 +1.904033000000000253e-01 -6.925172000000000549e-01 +1.904033000000000253e-01 -7.411346000000000878e-01 +1.904033000000000253e-01 -7.897518999999999512e-01 +1.904033000000000253e-01 -8.383692000000000366e-01 +1.904033000000000253e-01 -8.869865000000000110e-01 +1.904033000000000253e-01 -9.356037999999999855e-01 +1.904033000000000253e-01 -9.842211000000000709e-01 +1.904033000000000253e-01 -1.028786999999999896e+00 +2.148477000000000026e-01 -1.076053799999999949e+00 +2.528721000000000441e-01 -1.135475000000000012e+00 +2.746004000000000222e-01 -1.200297999999999865e+00 +2.718844000000000261e-01 -1.259719199999999928e+00 +2.718844000000000261e-01 -1.308336500000000013e+00 +2.718844000000000261e-01 -1.356953800000000099e+00 +2.637362999999999791e-01 -1.381262500000000060e+00 +2.678103000000000011e-01 -1.444059800000000005e+00 +2.637362999999999791e-01 -1.521712499999999801e+00 +2.637362999999999791e-01 -1.575731700000000179e+00 +3.017606999999999928e-01 -1.616246099999999908e+00 +3.708256000000000330e-01 -1.625506600000000024e+00 +4.592907000000000517e-01 -1.616246099999999908e+00 +5.326235999999999748e-01 -1.616246099999999908e+00 +6.874375999999999820e-01 -1.606117500000000087e+00 +7.689186000000000076e-01 -1.574111100000000096e+00 +8.503995999999999222e-01 -1.541699600000000059e+00 +9.318805999999999479e-01 -1.507667500000000160e+00 +1.013361600000000085e+00 -1.478497100000000009e+00 +1.062250200000000033e+00 -1.462291299999999961e+00 +1.066324300000000003e+00 -1.415699700000000227e+00 +1.102990800000000160e+00 -1.348850899999999964e+00 +1.135583199999999904e+00 -1.300233600000000100e+00 +1.176323699999999972e+00 -1.243513399999999880e+00 +1.217064200000000040e+00 -1.186793200000000104e+00 +1.257804699999999887e+00 -1.135475000000000012e+00 +1.290397100000000075e+00 -1.081455700000000020e+00 +1.322989500000000040e+00 -1.049044199999999982e+00 +1.339285700000000023e+00 -9.923239999999999839e-01 +1.355581900000000006e+00 -9.464076000000000155e-01 +1.363729999999999887e+00 -9.031923000000000590e-01 +1.380026200000000092e+00 -8.545749000000001372e-01 +1.396322400000000075e+00 -8.059576000000000517e-01 +1.412618600000000058e+00 -7.573403000000000773e-01 +1.428914800000000040e+00 -7.087229999999999919e-01 +1.445211000000000023e+00 -6.601057000000000174e-01 +1.461507200000000006e+00 -6.114884000000000430e-01 +1.477803399999999989e+00 -5.628710999999999576e-01 +1.482692299999999852e+00 -4.607746999999999815e-01 +1.502247800000000133e+00 -3.738038000000000194e-01 +1.502247800000000133e+00 -3.359903000000000195e-01 +1.518544000000000116e+00 -2.792701000000000211e-01 +1.534840199999999877e+00 -1.941898000000000235e-01 +1.551136400000000082e+00 -1.145115000000000022e-01 +1.551136400000000082e+00 -7.669800000000000229e-02 +1.559284499999999962e+00 -4.428649999999999948e-02 +1.559284499999999962e+00 4.330899999999999507e-03 +1.562000500000000125e+00 6.375200000000000311e-02 +1.542988300000000201e+00 1.218227000000000060e-01 +1.542988300000000201e+00 1.663886000000000254e-01 +1.518544000000000116e+00 2.069030000000000036e-01 +1.526692099999999996e+00 2.312115999999999894e-01 +1.518544000000000116e+00 2.757775000000000087e-01 +1.510395900000000013e+00 3.122404999999999764e-01 +1.502247800000000133e+00 3.662597000000000214e-01 +1.494099699999999808e+00 4.256808999999999732e-01 +1.475087399999999827e+00 4.634942999999999702e-01 +1.477803399999999989e+00 5.593785000000000007e-01 +1.461507200000000006e+00 6.039442999999999895e-01 +1.445211000000000023e+00 6.525615999999999639e-01 +1.428914800000000040e+00 7.011790000000001077e-01 +1.409902600000000117e+00 7.497962999999999711e-01 +1.388174299999999972e+00 8.200212999999999530e-01 +1.371878100000000211e+00 8.686386000000000385e-01 +1.355581900000000006e+00 9.199567999999999079e-01 +1.339285700000000023e+00 9.766770000000000174e-01 +1.298545200000000177e+00 1.063783099999999981e+00 +1.265952799999999989e+00 1.114426099999999975e+00 +1.225212300000000143e+00 1.160342399999999996e+00 +1.192619899999999955e+00 1.219763600000000059e+00 +1.143731300000000006e+00 1.279184700000000063e+00 +1.111138900000000040e+00 1.325101099999999921e+00 +1.054102100000000153e+00 1.402078500000000005e+00 +1.054102100000000153e+00 1.450695800000000091e+00 +9.970654000000001016e-01 1.477435300000000007e+00 +9.155844000000000760e-01 1.509846900000000103e+00 +8.341034000000000503e-01 1.540637800000000057e+00 +7.526224000000000247e-01 1.574669900000000178e+00 +6.670672999999999186e-01 1.608702099999999913e+00 +5.489197999999999578e-01 1.608702099999999913e+00 +4.755868999999999791e-01 1.608702099999999913e+00 +3.941059000000000090e-01 1.608702099999999913e+00 +2.800325000000000175e-01 1.592496300000000087e+00 +2.637362999999999791e-01 1.507416000000000089e+00 +2.474400999999999962e-01 1.462850100000000042e+00 +2.637362999999999791e-01 1.381821300000000141e+00 +2.637362999999999791e-01 1.333204000000000056e+00 +2.637362999999999791e-01 1.284586700000000192e+00 +2.637362999999999791e-01 1.235969400000000107e+00 +2.637362999999999791e-01 1.187352000000000185e+00 +2.555881999999999876e-01 1.130631900000000023e+00 +2.311439000000000132e-01 1.084715499999999944e+00 +1.985513999999999890e-01 1.021242900000000065e+00 +1.904033000000000253e-01 9.523684000000000038e-01 +1.904033000000000253e-01 9.037511000000000294e-01 +1.904033000000000253e-01 8.551337999999999440e-01 +1.904033000000000253e-01 8.065165000000000806e-01 +1.904033000000000253e-01 7.578991000000000477e-01 +1.904033000000000253e-01 7.092817999999999623e-01 +1.904033000000000253e-01 6.606645000000000989e-01 +1.904033000000000253e-01 6.120472000000000135e-01 +1.904033000000000253e-01 5.634299000000000390e-01 +1.904033000000000253e-01 5.148125999999999536e-01 +1.904033000000000253e-01 4.661952999999999792e-01 +1.904033000000000253e-01 4.175780000000000602e-01 +1.904033000000000253e-01 3.689607000000000303e-01 +1.904033000000000253e-01 3.203434000000000004e-01 +1.904033000000000253e-01 2.717260999999999704e-01 +1.904033000000000253e-01 2.231087000000000209e-01 +1.904033000000000253e-01 1.744913999999999910e-01 +1.822552000000000061e-01 1.339770000000000127e-01 +1.822552000000000061e-01 8.535970000000001057e-02 +1.822552000000000061e-01 3.674240000000000145e-02 +1.822552000000000061e-01 -1.187489999999999900e-02 From 2cd29206a938006d51a7a55e6fd3e29ffbbc5633 Mon Sep 17 00:00:00 2001 From: flothesof Date: Mon, 2 Dec 2019 17:15:18 +0100 Subject: [PATCH 033/168] adding NSTX to list of configurations --- tofu/geom/utils.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tofu/geom/utils.py b/tofu/geom/utils.py index e1bea4af6..8bc170ea5 100644 --- a/tofu/geom/utils.py +++ b/tofu/geom/utils.py @@ -642,6 +642,7 @@ def _compute_CamLOS2D_pinhole(P=None, F=0.1, D12=0.1, N12=100, _ExpWest = 'WEST' _ExpJET = 'JET' _ExpITER = 'ITER' +_ExpNSTX = 'NSTX' # Dictionnary of unique config names _DCONFIG = {'WEST-V1': {'Exp': _ExpWest, @@ -674,7 +675,9 @@ def _compute_CamLOS2D_pinhole(P=None, F=0.1, D12=0.1, N12=100, 'BLK11', 'BLK12', 'BLK13', 'BLK14', 'BLK15', 'BLK16', 'BLK17', 'BLK18', 'Div1', 'Div2', 'Div3', - 'Div4', 'Div5', 'Div6']} + 'Div4', 'Div5', 'Div6']}, + 'NSTX-V0': {'Exp': _ExpNSTX, + 'Ves': ['V0']} } # Each config can be called by various names (for benchmark and @@ -689,7 +692,8 @@ def _compute_CamLOS2D_pinhole(P=None, F=0.1, D12=0.1, N12=100, 'B1': 'WEST-V2', 'B2': 'WEST-V3', 'B3': 'WEST-V4', - 'B4': 'ITER-V2'} + 'B4': 'ITER-V2', + 'NSTX': 'NSTX-V0'} # Default config _DEFCONFIG = 'ITER' From eb212b2758fcafcb2b903bca7c8cb1da1bf7c7a7 Mon Sep 17 00:00:00 2001 From: flothesof Date: Mon, 2 Dec 2019 17:18:36 +0100 Subject: [PATCH 034/168] adding NSTX to gallery --- examples/tutorials/tuto_plot_gallery_fusion_machines.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/tutorials/tuto_plot_gallery_fusion_machines.py b/examples/tutorials/tuto_plot_gallery_fusion_machines.py index 7c1359678..20fbfab7b 100644 --- a/examples/tutorials/tuto_plot_gallery_fusion_machines.py +++ b/examples/tutorials/tuto_plot_gallery_fusion_machines.py @@ -34,6 +34,6 @@ # With that being said, let's create a gallery of the "top 3" fusion machines # provided by `tofu` to accelerate diagnostic development. -for fusion_machine in ['ITER', 'WEST', 'JET']: +for fusion_machine in ['ITER', 'WEST', 'JET', 'NSTX']: config = tf.geom.utils.create_config(fusion_machine) config.plot() From 860996bb60f2233f16b1b7d0ea98fc85e212d9ea Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Mon, 2 Dec 2019 17:29:34 +0100 Subject: [PATCH 035/168] [Issue202] Improved CrystBragg docstrings for get_approx_detector_frame() and get_local_noute1e2() and fallback to self._DEFLAMB in self._checkformat_bragglamb() if nothing provided --- tofu/geom/_core_optics.py | 54 ++++++++++++++++++++++++++++++++++++++- tofu/version.py | 2 +- 2 files changed, 54 insertions(+), 2 deletions(-) diff --git a/tofu/geom/_core_optics.py b/tofu/geom/_core_optics.py index e58138373..1c33654bd 100644 --- a/tofu/geom/_core_optics.py +++ b/tofu/geom/_core_optics.py @@ -729,6 +729,9 @@ def sample_outline_Rays(self, res=None): def _checkformat_bragglamb(self, bragg=None, lamb=None, n=None): lc = [lamb is not None, bragg is not None] + if not any(lc): + lamb = self._DEFLAMB + lc[0] = True assert np.sum(lc) == 1, "Provide lamb xor bragg!" if lc[0]: bragg = self.get_bragg_from_lamb(np.atleast_1d(lamb), @@ -856,7 +859,31 @@ def get_lamb_from_bragg(self, bragg, n=None): def get_approx_detector_frame(self, bragg=None, lamb=None, rcurve=None, n=None, plot=False): - """ See notes for details on notations """ + """ Return approximate ideal detector geometry + + Assumes infinitesimal and ideal crystal + Assumes detector center tangential to Rowland circle + Assumes detector center matching lamb (m) / bragg (rad) + + Detector described by center position, and (nout, ei, ej) unit vectors + By convention, nout = np.cross(ei, ej) + Vectors (ei, ej) define an orthogonal frame in the detector's plane + + Return: + ------- + det_cent: np.ndarray + (3,) array of (x, y, z) coordinates of detector center + det_nout: np.ndarray + (3,) array of (x, y, z) coordinates of unit vector + perpendicular to detector' surface + oriented towards crystal + det_ei: np.ndarray + (3,) array of (x, y, z) coordinates of unit vector + defining first coordinate in detector's plane + det_ej: np.ndarray + (3,) array of (x, y, z) coordinates of unit vector + defining second coordinate in detector's plane + """ # Check / format inputs if rcurve is None: @@ -891,6 +918,31 @@ def get_approx_detector_frame(self, bragg=None, lamb=None, return det_cent, det_nout, det_ei, det_ej def get_local_noute1e2(self, theta, psi): + """ Return (nout, e1, e2) associated to pts on the crystal's surface + + All points on the spherical crystal's surface are identified + by (theta, psi) coordinates, where: + - theta = np.pi/2 for the center + - psi = 0 for the center + They are the spherical coordinates from a sphere centered on the + crystal's center of curvature. + + Return the pts themselves and the 3 perpendicular unti vectors + (nout, e1, e2), where nout is towards the outside of the sphere and + nout = np.cross(e1, e2) + + Return: + ------- + summit: np.ndarray + (3,) array of (x, y, z) coordinates of the points on the surface + nout: np.ndarray + (3,) array of (x, y, z) coordinates of outward unit vector + e1: np.ndarray + (3,) array of (x, y, z) coordinates of first unit vector + e2: np.ndarray + (3,) array of (x, y, z) coordinates of second unit vector + + """ if np.allclose([theta, psi], [np.pi/2., 0.]): summit = self._dgeom['summit'] nout = self._dgeom['nout'] diff --git a/tofu/version.py b/tofu/version.py index ab0e46b95..57829d158 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.2-a5' +__version__ = '1.4.2-a5-2-g6065092' From 266f02b8d188f7ee340055868cbb29bccaada33c Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Mon, 2 Dec 2019 18:08:26 +0100 Subject: [PATCH 036/168] [deploy] version with space transformed to point --- .travis.yml | 80 ++++++++++++++++++++++++++--------------------- _updateversion.py | 2 +- 2 files changed, 45 insertions(+), 37 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1f06c3a48..c2c64bf0e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -85,43 +85,51 @@ before_deploy: - export PKG_REAL=$(conda build . --output | tail -1) - echo "BEFORE DEPLOY END.........." +# deploy: +# # - provider: script +# # user: "ToFuProject" +# # script: $START/anaconda_upload.sh +# # on: +# # tags: true +# # branch: master +# # skip_cleanup: true +# # - provider: pypi +# # user: "Didou09" +# # distributions: "sdist" +# # skip_existing: true +# # skip_cleanup: true +# # on: +# # tags: true +# # branch: master +# # password: +# # secure: JNEDTDJVx/2fXNfHntNQ99iDRNuQ4uB3y+DBWVIBycCT95+UCb36YPtKzmruEk/UUS29Xgq4IYCGdfCSWE9smKqG8tV1PcHiw705m+AzcpKy77YtzbVECFBxqY4W36O2pHrkwEUzP/7acjFwNsnUFzArqEzsBJ+KdLaa4OPHJXCh30GA0GyqlrXYbBKG+DA9hX5vtsGo4C6w9noALYF3fS7pKPiI6ipKFnAlzGgHQ7Ke0uQME8N3IAFhmh+Z5xMtIIDWxlnqv+KszdG4DIaGV/W6NIJNAbRhzkqUd+Chu6LoPAd/XkHDTeirR/MBkNUc5UcRJxRnP9rUTRo1gCO/buTYuNRgFkMvqhV5a033+x9edWgtUiKNJIMPLXOxe0RJvc5GWji+Co77HtHxRmGRM2rnYqWMtZeYZlFbUdvHu/8jf0d6I8jyUgAoJYdlMA2u/ipENP3S6by4epE9qycUPXiIVh6r3DZbf3vPTMFvTZYAjBrA0NOzihv1xgcXwemmNUFOQSpe0io4UcFxtS9lLMo+30UMQjCHSnbEVM3zSlZmbMOKpkVOlKlt8Lz5NxwVgWtu9FuW2pGukLtE8AWbqvY9urXAPZCQqZlOIklIjJQIqOITnuw9LEV09cgvPHXfdvNni3ldbMlIQ89zryM6dYvhYryTiEZGK4JDR3wAKJA= +# # - provider: pypi +# # user: "Didou09" +# # distributions: "bdist_wheel" +# # skip_existing: true +# # skip_cleanup: true +# # on: +# # tags: true +# # condition: $OS = osx-64 +# # branch: master +# # password: +# # secure: JNEDTDJVx/2fXNfHntNQ99iDRNuQ4uB3y+DBWVIBycCT95+UCb36YPtKzmruEk/UUS29Xgq4IYCGdfCSWE9smKqG8tV1PcHiw705m+AzcpKy77YtzbVECFBxqY4W36O2pHrkwEUzP/7acjFwNsnUFzArqEzsBJ+KdLaa4OPHJXCh30GA0GyqlrXYbBKG+DA9hX5vtsGo4C6w9noALYF3fS7pKPiI6ipKFnAlzGgHQ7Ke0uQME8N3IAFhmh+Z5xMtIIDWxlnqv+KszdG4DIaGV/W6NIJNAbRhzkqUd+Chu6LoPAd/XkHDTeirR/MBkNUc5UcRJxRnP9rUTRo1gCO/buTYuNRgFkMvqhV5a033+x9edWgtUiKNJIMPLXOxe0RJvc5GWji+Co77HtHxRmGRM2rnYqWMtZeYZlFbUdvHu/8jf0d6I8jyUgAoJYdlMA2u/ipENP3S6by4epE9qycUPXiIVh6r3DZbf3vPTMFvTZYAjBrA0NOzihv1xgcXwemmNUFOQSpe0io4UcFxtS9lLMo+30UMQjCHSnbEVM3zSlZmbMOKpkVOlKlt8Lz5NxwVgWtu9FuW2pGukLtE8AWbqvY9urXAPZCQqZlOIklIjJQIqOITnuw9LEV09cgvPHXfdvNni3ldbMlIQ89zryM6dYvhYryTiEZGK4JDR3wAKJA= +# - provider: pypi +# user: "Didou09" +# distributions: "sdist" +# skip_existing: true +# skip_cleanup: true +# on: +# tags: true +# branch: deploy-test +# server: https://test.pypi.org/legacy/ +# password: +# secure: JNEDTDJVx/2fXNfHntNQ99iDRNuQ4uB3y+DBWVIBycCT95+UCb36YPtKzmruEk/UUS29Xgq4IYCGdfCSWE9smKqG8tV1PcHiw705m+AzcpKy77YtzbVECFBxqY4W36O2pHrkwEUzP/7acjFwNsnUFzArqEzsBJ+KdLaa4OPHJXCh30GA0GyqlrXYbBKG+DA9hX5vtsGo4C6w9noALYF3fS7pKPiI6ipKFnAlzGgHQ7Ke0uQME8N3IAFhmh+Z5xMtIIDWxlnqv+KszdG4DIaGV/W6NIJNAbRhzkqUd+Chu6LoPAd/XkHDTeirR/MBkNUc5UcRJxRnP9rUTRo1gCO/buTYuNRgFkMvqhV5a033+x9edWgtUiKNJIMPLXOxe0RJvc5GWji+Co77HtHxRmGRM2rnYqWMtZeYZlFbUdvHu/8jf0d6I8jyUgAoJYdlMA2u/ipENP3S6by4epE9qycUPXiIVh6r3DZbf3vPTMFvTZYAjBrA0NOzihv1xgcXwemmNUFOQSpe0io4UcFxtS9lLMo+30UMQjCHSnbEVM3zSlZmbMOKpkVOlKlt8Lz5NxwVgWtu9FuW2pGukLtE8AWbqvY9urXAPZCQqZlOIklIjJQIqOITnuw9LEV09cgvPHXfdvNni3ldbMlIQ89zryM6dYvhYryTiEZGK4JDR3wAKJA= + + deploy: - # - provider: script - # user: "ToFuProject" - # script: $START/anaconda_upload.sh - # on: - # tags: true - # branch: master - # skip_cleanup: true - # - provider: pypi - # user: "Didou09" - # distributions: "sdist" - # skip_existing: true - # skip_cleanup: true - # on: - # tags: true - # branch: master - # password: - # secure: JNEDTDJVx/2fXNfHntNQ99iDRNuQ4uB3y+DBWVIBycCT95+UCb36YPtKzmruEk/UUS29Xgq4IYCGdfCSWE9smKqG8tV1PcHiw705m+AzcpKy77YtzbVECFBxqY4W36O2pHrkwEUzP/7acjFwNsnUFzArqEzsBJ+KdLaa4OPHJXCh30GA0GyqlrXYbBKG+DA9hX5vtsGo4C6w9noALYF3fS7pKPiI6ipKFnAlzGgHQ7Ke0uQME8N3IAFhmh+Z5xMtIIDWxlnqv+KszdG4DIaGV/W6NIJNAbRhzkqUd+Chu6LoPAd/XkHDTeirR/MBkNUc5UcRJxRnP9rUTRo1gCO/buTYuNRgFkMvqhV5a033+x9edWgtUiKNJIMPLXOxe0RJvc5GWji+Co77HtHxRmGRM2rnYqWMtZeYZlFbUdvHu/8jf0d6I8jyUgAoJYdlMA2u/ipENP3S6by4epE9qycUPXiIVh6r3DZbf3vPTMFvTZYAjBrA0NOzihv1xgcXwemmNUFOQSpe0io4UcFxtS9lLMo+30UMQjCHSnbEVM3zSlZmbMOKpkVOlKlt8Lz5NxwVgWtu9FuW2pGukLtE8AWbqvY9urXAPZCQqZlOIklIjJQIqOITnuw9LEV09cgvPHXfdvNni3ldbMlIQ89zryM6dYvhYryTiEZGK4JDR3wAKJA= - # - provider: pypi - # user: "Didou09" - # distributions: "bdist_wheel" - # skip_existing: true - # skip_cleanup: true - # on: - # tags: true - # condition: $OS = osx-64 - # branch: master - # password: - # secure: JNEDTDJVx/2fXNfHntNQ99iDRNuQ4uB3y+DBWVIBycCT95+UCb36YPtKzmruEk/UUS29Xgq4IYCGdfCSWE9smKqG8tV1PcHiw705m+AzcpKy77YtzbVECFBxqY4W36O2pHrkwEUzP/7acjFwNsnUFzArqEzsBJ+KdLaa4OPHJXCh30GA0GyqlrXYbBKG+DA9hX5vtsGo4C6w9noALYF3fS7pKPiI6ipKFnAlzGgHQ7Ke0uQME8N3IAFhmh+Z5xMtIIDWxlnqv+KszdG4DIaGV/W6NIJNAbRhzkqUd+Chu6LoPAd/XkHDTeirR/MBkNUc5UcRJxRnP9rUTRo1gCO/buTYuNRgFkMvqhV5a033+x9edWgtUiKNJIMPLXOxe0RJvc5GWji+Co77HtHxRmGRM2rnYqWMtZeYZlFbUdvHu/8jf0d6I8jyUgAoJYdlMA2u/ipENP3S6by4epE9qycUPXiIVh6r3DZbf3vPTMFvTZYAjBrA0NOzihv1xgcXwemmNUFOQSpe0io4UcFxtS9lLMo+30UMQjCHSnbEVM3zSlZmbMOKpkVOlKlt8Lz5NxwVgWtu9FuW2pGukLtE8AWbqvY9urXAPZCQqZlOIklIjJQIqOITnuw9LEV09cgvPHXfdvNni3ldbMlIQ89zryM6dYvhYryTiEZGK4JDR3wAKJA= - - provider: pypi + provider: pypi user: "Didou09" - distributions: "sdist" - skip_existing: true - skip_cleanup: true - on: - tags: true - branch: deploy-test - server: https://test.pypi.org/legacy/ password: secure: JNEDTDJVx/2fXNfHntNQ99iDRNuQ4uB3y+DBWVIBycCT95+UCb36YPtKzmruEk/UUS29Xgq4IYCGdfCSWE9smKqG8tV1PcHiw705m+AzcpKy77YtzbVECFBxqY4W36O2pHrkwEUzP/7acjFwNsnUFzArqEzsBJ+KdLaa4OPHJXCh30GA0GyqlrXYbBKG+DA9hX5vtsGo4C6w9noALYF3fS7pKPiI6ipKFnAlzGgHQ7Ke0uQME8N3IAFhmh+Z5xMtIIDWxlnqv+KszdG4DIaGV/W6NIJNAbRhzkqUd+Chu6LoPAd/XkHDTeirR/MBkNUc5UcRJxRnP9rUTRo1gCO/buTYuNRgFkMvqhV5a033+x9edWgtUiKNJIMPLXOxe0RJvc5GWji+Co77HtHxRmGRM2rnYqWMtZeYZlFbUdvHu/8jf0d6I8jyUgAoJYdlMA2u/ipENP3S6by4epE9qycUPXiIVh6r3DZbf3vPTMFvTZYAjBrA0NOzihv1xgcXwemmNUFOQSpe0io4UcFxtS9lLMo+30UMQjCHSnbEVM3zSlZmbMOKpkVOlKlt8Lz5NxwVgWtu9FuW2pGukLtE8AWbqvY9urXAPZCQqZlOIklIjJQIqOITnuw9LEV09cgvPHXfdvNni3ldbMlIQ89zryM6dYvhYryTiEZGK4JDR3wAKJA= + server: https://test.pypi.org/legacy/ \ No newline at end of file diff --git a/_updateversion.py b/_updateversion.py index 9ae7ad0cc..1dc1453a2 100644 --- a/_updateversion.py +++ b/_updateversion.py @@ -16,7 +16,7 @@ def updateversion(path=_HERE): except: with open(version_py,'r') as fh: version_git = fh.read().strip().split("=")[-1].replace("'",'') - version_git = version_git.lower().replace('v','') + version_git = version_git.lower().replace('v','').replace(' ','') version_msg = "# Do not edit, pipeline versioning governed by git tags!" with open(version_py,"w") as fh: From 75107bc9db7e3e8fabffe49bb942eea7742bb1df Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Mon, 2 Dec 2019 18:26:18 +0100 Subject: [PATCH 037/168] [deployment] corrected travis yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c2c64bf0e..c551ce815 100644 --- a/.travis.yml +++ b/.travis.yml @@ -128,7 +128,7 @@ before_deploy: deploy: - provider: pypi + - provider: pypi user: "Didou09" password: secure: JNEDTDJVx/2fXNfHntNQ99iDRNuQ4uB3y+DBWVIBycCT95+UCb36YPtKzmruEk/UUS29Xgq4IYCGdfCSWE9smKqG8tV1PcHiw705m+AzcpKy77YtzbVECFBxqY4W36O2pHrkwEUzP/7acjFwNsnUFzArqEzsBJ+KdLaa4OPHJXCh30GA0GyqlrXYbBKG+DA9hX5vtsGo4C6w9noALYF3fS7pKPiI6ipKFnAlzGgHQ7Ke0uQME8N3IAFhmh+Z5xMtIIDWxlnqv+KszdG4DIaGV/W6NIJNAbRhzkqUd+Chu6LoPAd/XkHDTeirR/MBkNUc5UcRJxRnP9rUTRo1gCO/buTYuNRgFkMvqhV5a033+x9edWgtUiKNJIMPLXOxe0RJvc5GWji+Co77HtHxRmGRM2rnYqWMtZeYZlFbUdvHu/8jf0d6I8jyUgAoJYdlMA2u/ipENP3S6by4epE9qycUPXiIVh6r3DZbf3vPTMFvTZYAjBrA0NOzihv1xgcXwemmNUFOQSpe0io4UcFxtS9lLMo+30UMQjCHSnbEVM3zSlZmbMOKpkVOlKlt8Lz5NxwVgWtu9FuW2pGukLtE8AWbqvY9urXAPZCQqZlOIklIjJQIqOITnuw9LEV09cgvPHXfdvNni3ldbMlIQ89zryM6dYvhYryTiEZGK4JDR3wAKJA= From 87899e8f054e8c82c4fa8c40d4fd0107bd3f4aea Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Tue, 3 Dec 2019 14:09:07 +0100 Subject: [PATCH 038/168] [Issue202] Renamed CrystBragg.get_approx_detect() and started introducing ddist, dtheta, dpsi to optimize position --- tofu/geom/_core_optics.py | 68 +++++++++++++++++++++++---------------- tofu/geom/_plot_optics.py | 2 +- tofu/version.py | 2 +- 3 files changed, 42 insertions(+), 30 deletions(-) diff --git a/tofu/geom/_core_optics.py b/tofu/geom/_core_optics.py index 1c33654bd..7db519d73 100644 --- a/tofu/geom/_core_optics.py +++ b/tofu/geom/_core_optics.py @@ -857,8 +857,9 @@ def get_lamb_from_bragg(self, bragg, n=None): return _comp_optics.get_lamb_from_bragg(np.atleast_1d(bragg), self._dmat['d'], n=n) - def get_approx_detector_frame(self, bragg=None, lamb=None, - rcurve=None, n=None, plot=False): + def get_detector_frame(self, bragg=None, lamb=None, + rcurve=None, n=None, + dtheta=None, dpsi=None, ddist=None, plot=False): """ Return approximate ideal detector geometry Assumes infinitesimal and ideal crystal @@ -894,14 +895,25 @@ def get_approx_detector_frame(self, bragg=None, lamb=None, func = _comp_optics.get_approx_detector_rel det_dist, det_nout_rel, det_ei_rel = func(rcurve, bragg) + # Apply small corrections + if dtheta is None: + dtheta = 0. + if dpsi is None: + dpsi = 0. + if ddist is None: + ddist = 0. + det_dist += ddist + # Deduce absolute position in (x, y, z) - func = _comp_optics.get_det_abs_from_rel - det_cent, det_nout, det_ei, det_ej = func(det_dist, - det_nout_rel, det_ei_rel, - self._dgeom['summit'], - self._dgeom['nout'], - self._dgeom['e1'], - self._dgeom['e2']) + det_cent, det_nout, det_ei, det_ej = _comp_optics.get_det_abs_from_rel( + det_dist, det_nout_rel, det_ei_rel, + self._dgeom['summit'], + self._dgeom['nout'], self._dgeom['e1'], self._dgeom['e2']) + + if dtheta != 0. or dpsi != 0.: + det_nout = (np.cos(dpsi)*np.cos(dtheta)*det_nout + + np.cos(dpsi)*np.sin(dtheta)*det_ej + + np.sin(dpsi)*det_ei) if plot: dax = self.plot() @@ -1039,8 +1051,8 @@ def calc_phibragg_from_xixj(self, xi, xj, n=None, lc = [det_cent is None, det_ei is None, det_ej is None] assert all(lc) or not any(lc) if all(lc): - func = self.get_approx_detector_frame - det_cent, _, det_ei, det_ej = func(lamb=self._DEFLAMB) + det_cent, _, det_ei, det_ej = self.get_approx_detector_frame( + lamb=self._DEFLAMB) # Get local summit nout, e1, e2 if non-centered if theta is None: @@ -1050,17 +1062,17 @@ def calc_phibragg_from_xixj(self, xi, xj, n=None, summit, nout, e1, e2 = self.get_local_noute1e2(theta, psi) # Compute - func = _comp_optics.calc_braggphi_from_xixj - bragg, phi = func(xii, xjj, det_cent, det_ei, det_ej, - summit, -nout, e1, e2) + bragg, phi = _comp_optics.calc_braggphi_from_xixj( + xii, xjj, det_cent, det_ei, det_ej, + summit, -nout, e1, e2) if plot != False: - func = _plot_optics.CrystalBragg_plot_braggangle_from_xixj - lax = func(xi=xii, xj=xjj, - ax=ax, plot=plot, - bragg=bragg * 180./np.pi, - angle=phi * 180./np.pi, - braggunits='deg', angunits='deg', **kwdargs) + lax = _plot_optics.CrystalBragg_plot_braggangle_from_xixj( + xi=xii, xj=xjj, + ax=ax, plot=plot, + bragg=bragg * 180./np.pi, + angle=phi * 180./np.pi, + braggunits='deg', angunits='deg', **kwdargs) return bragg, phi def plot_johannerror(self, lamb=None): @@ -1078,10 +1090,10 @@ def plot_data_vs_lambphi(self, xi=None, xj=None, data=None, nxj = xj.size if xj is not None else np.unique(xjj).size # Compute lamb / phi - func = self.calc_phibragg_from_xixj - bragg, phi = func(xii, xjj, n=n, - det_cent=det_cent, det_ei=det_ei, det_ej=det_ej, - theta=theta, psi=psi, plot=False) + bragg, phi = self.calc_phibragg_from_xixj( + xii, xjj, n=n, + det_cent=det_cent, det_ei=det_ei, det_ej=det_ej, + theta=theta, psi=psi, plot=False) assert bragg.shape == phi.shape == data.shape lamb = self.get_lamb_from_bragg(bragg, n=n) @@ -1092,10 +1104,10 @@ def plot_data_vs_lambphi(self, xi=None, xj=None, data=None, spect1d = np.array([np.nanmean(data[ind==ii]) for ii in np.unique(ind)]) # plot - func = _plot_optics.CrystalBragg_plot_data_vs_lambphi - ax = func(xi, xj, bragg, lamb, phi, data, - lambfit=lambfit, phifit=phifit, spect1d=spect1d, - cmap=cmap, vmin=vmin, vmax=vmax, fs=fs) + ax = _plot_optics.CrystalBragg_plot_data_vs_lambphi( + xi, xj, bragg, lamb, phi, data, + lambfit=lambfit, phifit=phifit, spect1d=spect1d, + cmap=cmap, vmin=vmin, vmax=vmax, fs=fs) return ax def plot_data_fit2d(self, xi=None, xj=None, data=None, mask=None, diff --git a/tofu/geom/_plot_optics.py b/tofu/geom/_plot_optics.py index 07e669218..26014763d 100644 --- a/tofu/geom/_plot_optics.py +++ b/tofu/geom/_plot_optics.py @@ -395,7 +395,7 @@ def CrystalBragg_plot_data_vs_lambphi(xi, xj, bragg, lamb, phi, data, ax0.contour(xi, xj, phi, 10, cmap=cmap, ls='--') ax1.imshow(data, extent=extent, aspect='equal', origin='lower', vmin=vmin, vmax=vmax) - axs1.plot(xi, np.sum(data, axis=0), c='k', ls='-') + axs1.plot(xi, np.nanmean(data, axis=0), c='k', ls='-') ax2.scatter(lamb.ravel(), phi.ravel(), c=data.ravel(), s=2, marker='s', edgecolors='None', cmap=cmap, vmin=vmin, vmax=vmax) diff --git a/tofu/version.py b/tofu/version.py index 57829d158..9685ed84b 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.2-a5-2-g6065092' +__version__ = '1.4.2-a5-3-g860996b' From efbf5ffc8668a148e722ea5aaa7d8d1f700c1e85 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Tue, 3 Dec 2019 18:16:38 +0100 Subject: [PATCH 039/168] [Issue202] Advanced approx_detect() with di, dj, tilt add vertical sum to plot and mask, and optional dlines --- tofu/geom/_comp_optics.py | 39 ++++++++++++++++++++++++++++--- tofu/geom/_core_optics.py | 45 ++++++++++++++++-------------------- tofu/geom/_plot_optics.py | 48 +++++++++++++++++++++++++++++++++++---- tofu/version.py | 2 +- 4 files changed, 99 insertions(+), 35 deletions(-) diff --git a/tofu/geom/_comp_optics.py b/tofu/geom/_comp_optics.py index 4917835b5..4a81743cb 100644 --- a/tofu/geom/_comp_optics.py +++ b/tofu/geom/_comp_optics.py @@ -117,14 +117,47 @@ def get_approx_detector_rel(rcurve, bragg): return det_dist, det_nout_rel, det_ei_rel def get_det_abs_from_rel(det_dist, det_nout_rel, det_ei_rel, - summit, nout, e1, e2): + summit, nout, e1, e2, + ddist=None, di=None, dj=None, + dtheta=None, dpsi=None, tilt=None): + # Reference det_nout = (det_nout_rel[0]*nout + det_nout_rel[1]*e1 + det_nout_rel[2]*e2) det_ei = (det_ei_rel[0]*nout + det_ei_rel[1]*e1 + det_ei_rel[2]*e2) det_ej = np.cross(det_nout, det_ei) - det_cent = summit - det_dist*det_nout - return det_cent, det_nout, det_ei, det_ej + + # Apply translation of center (ddist, di, dj) + if ddist is None: + ddist = 0. + if di is None: + di = 0. + if dj is None: + dj = 0. + det_dist += ddist + det_cent = summit - det_dist*det_nout + di*det_ei + dj*det_ej + + # Apply angles on unit vectors + if dtheta is None: + dtheta = 0. + if dpsi is None: + dpsi = 0. + if tilt is None: + tilt = 0. + + # dtheta and dpsi + det_nout2 = ((np.cos(dpsi)*det_nout + + np.sin(dpsi)*det_ei)*np.cos(dtheta) + + np.sin(dtheta)*det_ej) + det_ei2 = (np.cos(dpsi)*det_ei - np.sin(dpsi)*det_nout) + det_ej2 = np.cross(det_nout2, det_ei2) + + # tilt + det_ei3 = np.cos(tilt)*det_ei2 + np.sin(tilt)*det_ej2 + det_ej3 = np.cross(det_nout2, det_ei3) + + + return det_cent, det_nout2, det_ei3, det_ej3 # ############################################### diff --git a/tofu/geom/_core_optics.py b/tofu/geom/_core_optics.py index 7db519d73..9957f9bdd 100644 --- a/tofu/geom/_core_optics.py +++ b/tofu/geom/_core_optics.py @@ -824,7 +824,8 @@ def get_Rays_envelop(self, # ----------------- def plot(self, lax=None, proj=None, res=None, element=None, - color=None, + color=None, det_cent=None, + det_nout=None, det_ei=None, det_ej=None, dP=None, dI=None, dBs=None, dBv=None, dVect=None, dIHor=None, dBsHor=None, dBvHor=None, dleg=None, @@ -857,9 +858,10 @@ def get_lamb_from_bragg(self, bragg, n=None): return _comp_optics.get_lamb_from_bragg(np.atleast_1d(bragg), self._dmat['d'], n=n) - def get_detector_frame(self, bragg=None, lamb=None, - rcurve=None, n=None, - dtheta=None, dpsi=None, ddist=None, plot=False): + def get_detector_approx(self, bragg=None, lamb=None, + rcurve=None, n=None, + ddist=None, di=None, dj=None, + dtheta=None, dpsi=None, tilt=None, plot=False): """ Return approximate ideal detector geometry Assumes infinitesimal and ideal crystal @@ -895,25 +897,13 @@ def get_detector_frame(self, bragg=None, lamb=None, func = _comp_optics.get_approx_detector_rel det_dist, det_nout_rel, det_ei_rel = func(rcurve, bragg) - # Apply small corrections - if dtheta is None: - dtheta = 0. - if dpsi is None: - dpsi = 0. - if ddist is None: - ddist = 0. - det_dist += ddist - # Deduce absolute position in (x, y, z) det_cent, det_nout, det_ei, det_ej = _comp_optics.get_det_abs_from_rel( det_dist, det_nout_rel, det_ei_rel, self._dgeom['summit'], - self._dgeom['nout'], self._dgeom['e1'], self._dgeom['e2']) - - if dtheta != 0. or dpsi != 0.: - det_nout = (np.cos(dpsi)*np.cos(dtheta)*det_nout - + np.cos(dpsi)*np.sin(dtheta)*det_ej - + np.sin(dpsi)*det_ei) + self._dgeom['nout'], self._dgeom['e1'], self._dgeom['e2'], + ddist=ddist, di=di, dj=dj, + dtheta=dtheta, dpsi=dpsi, tilt=tilt) if plot: dax = self.plot() @@ -1010,7 +1000,7 @@ def calc_xixj_from_phibragg(self, phi=None, det_ei is None, det_ej is None] assert all(lc) or not any(lc) if all(lc): - func = self.get_approx_detector_frame + func = self.get_detector_approx det_cent, det_nout, det_ei, det_ej = func(lamb=self._DEFLAMB) # Get local summit nout, e1, e2 if non-centered @@ -1035,6 +1025,7 @@ def calc_xixj_from_phibragg(self, phi=None, def _checkformat_xixj(xi, xj): xi = np.atleast_1d(xi) xj = np.atleast_1d(xj) + if xi.shape == xj.shape: return xi, xj, (xi, xj) else: @@ -1051,7 +1042,7 @@ def calc_phibragg_from_xixj(self, xi, xj, n=None, lc = [det_cent is None, det_ei is None, det_ej is None] assert all(lc) or not any(lc) if all(lc): - det_cent, _, det_ei, det_ej = self.get_approx_detector_frame( + det_cent, _, det_ei, det_ej = self.get_detector_approx( lamb=self._DEFLAMB) # Get local summit nout, e1, e2 if non-centered @@ -1078,11 +1069,11 @@ def calc_phibragg_from_xixj(self, xi, xj, n=None, def plot_johannerror(self, lamb=None): raise NotImplementedError - def plot_data_vs_lambphi(self, xi=None, xj=None, data=None, - det_cent=None, det_ei=None, det_ej=None, - theta=None, psi=None, n=None, - plot=True, fs=None, - cmap=None, vmin=None, vmax=None): + def plot_data_vs_lambphi(self, xi=None, xj=None, data=None, mask=None, + det_cent=None, det_ei=None, det_ej=None, + theta=None, psi=None, n=None, + plot=True, fs=None, + cmap=None, vmin=None, vmax=None): # Check / format inputs assert data is not None xi, xj, (xii, xjj) = self._checkformat_xixj(xi, xj) @@ -1101,6 +1092,8 @@ def plot_data_vs_lambphi(self, xi=None, xj=None, data=None, lambfit, phifit = _comp_optics.get_lambphifit(lamb, phi, nxi, nxj) lambfitbins = 0.5*(lambfit[1:] + lambfit[:-1]) ind = np.digitize(lamb, lambfitbins) + if mask is not None: + data[~mask] = np.nan spect1d = np.array([np.nanmean(data[ind==ii]) for ii in np.unique(ind)]) # plot diff --git a/tofu/geom/_plot_optics.py b/tofu/geom/_plot_optics.py index 26014763d..574e8e406 100644 --- a/tofu/geom/_plot_optics.py +++ b/tofu/geom/_plot_optics.py @@ -93,6 +93,7 @@ def _check_projdax_mpl(dax=None, proj=None, fs=None, wintit=None): def CrystalBragg_plot(cryst, lax=None, proj=None, res=None, element=None, color=None, dP=None, + det_cent=None, det_nout=None, det_ei=None, det_ej=None, dI=None, dBs=None, dBv=None, dVect=None, dIHor=None, dBsHor=None, dBvHor=None, dleg=None, indices=False, @@ -118,8 +119,10 @@ def CrystalBragg_plot(cryst, lax=None, proj=None, res=None, element=None, # Temporary matplotlib issue dleg = None else: - dax = _CrystalBragg_plot_crosshor(cryst, proj=proj, res=res, dax=lax, element=element, - color=color) + dax = _CrystalBragg_plot_crosshor(cryst, proj=proj, res=res, dax=lax, + element=element, color=color, + det_cent=det_cent, det_nout=det_nout, + det_ei=det_ei, det_ej=det_ej) # recompute the ax.dataLim ax0 = None @@ -139,7 +142,10 @@ def CrystalBragg_plot(cryst, lax=None, proj=None, res=None, element=None, ax0.figure.canvas.draw() return dax -def _CrystalBragg_plot_crosshor(cryst, proj=None, dax=None, element=None, res=None, +def _CrystalBragg_plot_crosshor(cryst, proj=None, dax=None, + element=None, res=None, + det_cent=None, det_nout=None, + det_ei=None, det_ej=None, Pdict=_def.TorPd, Idict=_def.TorId, Bsdict=_def.TorBsd, Bvdict=_def.TorBvd, Vdict=_def.TorVind, color=None, ms=None, quiver_cmap=None, @@ -232,8 +238,10 @@ def _CrystalBragg_plot_crosshor(cryst, proj=None, dax=None, element=None, res=No p0 = np.repeat(summ[:,None], 3, axis=1) v = np.concatenate((nin[:, None], e1[:, None], e2[:, None]), axis=1) if dax['cross'] is not None: - dax['cross'].quiver(np.hypot(p0[0,:], p0[1,:]), p0[2,:], - np.hypot(v[0,:], v[1,:]), v[2,:], + pr = np.hypot(p0[0,:], p0[1,:]) + vr = np.hypot(p0[0,:]+v[0,:], p0[1,:]+v[1,:]) - pr + dax['cross'].quiver(pr, p0[2,:], + vr, v[2,:], np.r_[0., 0.5, 1.], cmap=quiver_cmap, angles='xy', scale_units='xy', label=cryst.Id.NameLTX+" unit vect", **Vdict) @@ -244,6 +252,36 @@ def _CrystalBragg_plot_crosshor(cryst, proj=None, dax=None, element=None, res=No angles='xy', scale_units='xy', label=cryst.Id.NameLTX+" unit vect", **Vdict) + # Detector + sc = None + if det_cent is not None: + if dax['cross'] is not None: + dax['cross'].plot(np.hypot(det_cent[0], det_cent[1]), det_cent[2], + marker='x', ms=ms, c=color, label="det_cent") + if dax['hor'] is not None: + dax['hor'].plot(det_cent[0], det_cent[1], + marker='x', ms=ms, c=color, label="det_cent") + + if det_nout is not None: + assert det_ei is not None and det_ej is not None + p0 = np.repeat(det_cent[:, None], 3, axis=1) + v = np.concatenate((det_nout[:, None], det_ei[:, None], + det_ej[:, None]), axis=1) + if dax['cross'] is not None: + pr = np.hypot(p0[0,:], p0[1,:]) + vr = np.hypot(p0[0,:]+v[0,:], p0[1,:]+v[1,:]) - pr + dax['cross'].quiver(pr, p0[2,:], + vr, v[2,:], + np.r_[0., 0.5, 1.], cmap=quiver_cmap, + angles='xy', scale_units='xy', + label="det unit vect", **Vdict) + if dax['hor'] is not None: + dax['hor'].quiver(p0[0,:], p0[1,:], + v[0,:], v[1,:], + np.r_[0., 0.5, 1.], cmap=quiver_cmap, + angles='xy', scale_units='xy', + label="det unit vect", **Vdict) + return dax diff --git a/tofu/version.py b/tofu/version.py index 9685ed84b..432f412b3 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.2-a5-3-g860996b' +__version__ = '1.4.2-a5-4-g87899e8' From b186ea8b9055b7c8951b82bb48ea21c121a6c16f Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Wed, 4 Dec 2019 09:54:06 +0100 Subject: [PATCH 040/168] [deployment] on tags, branch --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index c551ce815..4b25cac08 100644 --- a/.travis.yml +++ b/.travis.yml @@ -130,6 +130,9 @@ before_deploy: deploy: - provider: pypi user: "Didou09" + on: + branch: deploy-test + tags: true password: secure: JNEDTDJVx/2fXNfHntNQ99iDRNuQ4uB3y+DBWVIBycCT95+UCb36YPtKzmruEk/UUS29Xgq4IYCGdfCSWE9smKqG8tV1PcHiw705m+AzcpKy77YtzbVECFBxqY4W36O2pHrkwEUzP/7acjFwNsnUFzArqEzsBJ+KdLaa4OPHJXCh30GA0GyqlrXYbBKG+DA9hX5vtsGo4C6w9noALYF3fS7pKPiI6ipKFnAlzGgHQ7Ke0uQME8N3IAFhmh+Z5xMtIIDWxlnqv+KszdG4DIaGV/W6NIJNAbRhzkqUd+Chu6LoPAd/XkHDTeirR/MBkNUc5UcRJxRnP9rUTRo1gCO/buTYuNRgFkMvqhV5a033+x9edWgtUiKNJIMPLXOxe0RJvc5GWji+Co77HtHxRmGRM2rnYqWMtZeYZlFbUdvHu/8jf0d6I8jyUgAoJYdlMA2u/ipENP3S6by4epE9qycUPXiIVh6r3DZbf3vPTMFvTZYAjBrA0NOzihv1xgcXwemmNUFOQSpe0io4UcFxtS9lLMo+30UMQjCHSnbEVM3zSlZmbMOKpkVOlKlt8Lz5NxwVgWtu9FuW2pGukLtE8AWbqvY9urXAPZCQqZlOIklIjJQIqOITnuw9LEV09cgvPHXfdvNni3ldbMlIQ89zryM6dYvhYryTiEZGK4JDR3wAKJA= server: https://test.pypi.org/legacy/ \ No newline at end of file From 5c69105a28768bde94e390e4e53b72bbf4fc1c4f Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Wed, 4 Dec 2019 10:17:47 +0100 Subject: [PATCH 041/168] [deployment] skipping exisiting --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 4b25cac08..2338266d5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -133,6 +133,7 @@ deploy: on: branch: deploy-test tags: true + skip_existing: true password: secure: JNEDTDJVx/2fXNfHntNQ99iDRNuQ4uB3y+DBWVIBycCT95+UCb36YPtKzmruEk/UUS29Xgq4IYCGdfCSWE9smKqG8tV1PcHiw705m+AzcpKy77YtzbVECFBxqY4W36O2pHrkwEUzP/7acjFwNsnUFzArqEzsBJ+KdLaa4OPHJXCh30GA0GyqlrXYbBKG+DA9hX5vtsGo4C6w9noALYF3fS7pKPiI6ipKFnAlzGgHQ7Ke0uQME8N3IAFhmh+Z5xMtIIDWxlnqv+KszdG4DIaGV/W6NIJNAbRhzkqUd+Chu6LoPAd/XkHDTeirR/MBkNUc5UcRJxRnP9rUTRo1gCO/buTYuNRgFkMvqhV5a033+x9edWgtUiKNJIMPLXOxe0RJvc5GWji+Co77HtHxRmGRM2rnYqWMtZeYZlFbUdvHu/8jf0d6I8jyUgAoJYdlMA2u/ipENP3S6by4epE9qycUPXiIVh6r3DZbf3vPTMFvTZYAjBrA0NOzihv1xgcXwemmNUFOQSpe0io4UcFxtS9lLMo+30UMQjCHSnbEVM3zSlZmbMOKpkVOlKlt8Lz5NxwVgWtu9FuW2pGukLtE8AWbqvY9urXAPZCQqZlOIklIjJQIqOITnuw9LEV09cgvPHXfdvNni3ldbMlIQ89zryM6dYvhYryTiEZGK4JDR3wAKJA= server: https://test.pypi.org/legacy/ \ No newline at end of file From c25c76c95682f4cf57c71cf72ff987c9b37cc224 Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Wed, 4 Dec 2019 11:23:15 +0100 Subject: [PATCH 042/168] [qf] update version was being appended twice the tofu sub path --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 5f45f94c0..8119e5b5c 100644 --- a/setup.py +++ b/setup.py @@ -186,7 +186,7 @@ def get_version_tofu(path=_HERE): .decode() ) if git_branch in ["master"]: - version_tofu = updateversion(os.path.join(path, "tofu")) + version_tofu = updateversion() else: isgit = False except Exception: From 0bfdf2b272210945353004dadf3b6ee0b69ad6eb Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Wed, 4 Dec 2019 11:30:19 +0100 Subject: [PATCH 043/168] undoing quick fix --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 8119e5b5c..5f45f94c0 100644 --- a/setup.py +++ b/setup.py @@ -186,7 +186,7 @@ def get_version_tofu(path=_HERE): .decode() ) if git_branch in ["master"]: - version_tofu = updateversion() + version_tofu = updateversion(os.path.join(path, "tofu")) else: isgit = False except Exception: From bbcea759fa60faf36e29711844783729b03231c3 Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Wed, 4 Dec 2019 11:30:46 +0100 Subject: [PATCH 044/168] [qf] update version was being appended twice the tofu sub path --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 5f45f94c0..8119e5b5c 100644 --- a/setup.py +++ b/setup.py @@ -186,7 +186,7 @@ def get_version_tofu(path=_HERE): .decode() ) if git_branch in ["master"]: - version_tofu = updateversion(os.path.join(path, "tofu")) + version_tofu = updateversion() else: isgit = False except Exception: From 3d79749f5ae1832688462a937f723ff00ab759c8 Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Wed, 4 Dec 2019 11:43:18 +0100 Subject: [PATCH 045/168] update in version update (setup) --- setup.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 5f45f94c0..f3fabc8e4 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,6 @@ from setuptools import setup, find_packages from setuptools import Extension # ... packages that need to be in pyproject.toml -import Cython as cth from Cython.Distutils import build_ext import numpy as np # ... @@ -36,6 +35,7 @@ logging.basicConfig(level=logging.INFO) logger = logging.getLogger("tofu.setup") + class CleanCommand(Clean): description = "Remove build artifacts from the source tree" @@ -136,6 +136,7 @@ def check_for_openmp(cc_var): shutil.rmtree(tmpdir) return result + # ....... Using function if is_platform_windows: openmp_installed = False @@ -155,7 +156,7 @@ def updateversion(path=_HERE): try: version_git = subprocess.check_output(["git", "describe"]).rstrip().decode() - except Exception as err: + except Exception: with open(version_py, 'r') as fh: version_git = fh.read().strip().split("=")[-1].replace("'", '') version_git = version_git.lower().replace('v', '') @@ -166,6 +167,7 @@ def updateversion(path=_HERE): fh.write(version_msg + msg) return version_git + def get_version_tofu(path=_HERE): # Try from git @@ -185,8 +187,8 @@ def get_version_tofu(path=_HERE): .rstrip() .decode() ) - if git_branch in ["master"]: - version_tofu = updateversion(os.path.join(path, "tofu")) + if git_branch in ["master", "deploy-test"]: + version_tofu = updateversion() else: isgit = False except Exception: @@ -201,6 +203,7 @@ def get_version_tofu(path=_HERE): version_tofu = version_tofu.lower().replace("v", "") return version_tofu + version_tofu = get_version_tofu(path=_HERE) print("") From 413be477bc685334aca52a88e31c93c4ab3cd59d Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Wed, 4 Dec 2019 14:29:36 +0100 Subject: [PATCH 046/168] [Issue202] Added vertsum1d to CrystBragg.plot_data_vs_philamb(), tunable nphifit and nlambfit, started adding magaxis phi computation => notes --- tofu/geom/_core_optics.py | 34 +++++++++++++++++++++++++++++++--- tofu/geom/_plot_optics.py | 17 ++++++++++++++--- tofu/version.py | 2 +- 3 files changed, 46 insertions(+), 7 deletions(-) diff --git a/tofu/geom/_core_optics.py b/tofu/geom/_core_optics.py index 9957f9bdd..687ebe515 100644 --- a/tofu/geom/_core_optics.py +++ b/tofu/geom/_core_optics.py @@ -840,6 +840,19 @@ def plot(self, lax=None, proj=None, res=None, element=None, # methods for generic first-approx # ----------------- + def get_phi_from_magaxis_summit(self, r, z, lamb=None, bragg=None, n=None): + # Check / format input + r = np.atleast_1d(r) + z = np.atleast_1d(z) + assert r.shape == z.shape + bragg = self._checkformat_bragglamb(bragg=bragg, lamb=lamb, n=n) + + # Compute phi + + return phi + + + def get_bragg_from_lamb(self, lamb, n=None): """ Braggs' law: n*lamb = 2dsin(bragg) """ if self._dmat['d'] is None: @@ -1072,6 +1085,8 @@ def plot_johannerror(self, lamb=None): def plot_data_vs_lambphi(self, xi=None, xj=None, data=None, mask=None, det_cent=None, det_ei=None, det_ej=None, theta=None, psi=None, n=None, + nlambfit=None, nphifit=None, + phiref=None, magaxis=None, plot=True, fs=None, cmap=None, vmin=None, vmax=None): # Check / format inputs @@ -1089,17 +1104,30 @@ def plot_data_vs_lambphi(self, xi=None, xj=None, data=None, mask=None, lamb = self.get_lamb_from_bragg(bragg, n=n) # Compute lambfit / phifit and spectrum1d - lambfit, phifit = _comp_optics.get_lambphifit(lamb, phi, nxi, nxj) - lambfitbins = 0.5*(lambfit[1:] + lambfit[:-1]) - ind = np.digitize(lamb, lambfitbins) if mask is not None: data[~mask] = np.nan + if nlambfit is None: + nlambfit = nxi + if nphifit is None: + nphifit = nxj + lambfit, phifit = _comp_optics.get_lambphifit(lamb, phi, + nlambfit, nphifit) + lambfitbins = 0.5*(lambfit[1:] + lambfit[:-1]) + ind = np.digitize(lamb, lambfitbins) spect1d = np.array([np.nanmean(data[ind==ii]) for ii in np.unique(ind)]) + phifitbins = 0.5*(phifit[1:] + phifit[:-1]) + ind = np.digitize(phi, phifitbins) + vertsum1d = np.array([np.nanmean(data[ind==ii]) for ii in np.unique(ind)]) + + # Get phiref from mag axis + if phiref is None and magaxis is not None: + phiref = None # plot ax = _plot_optics.CrystalBragg_plot_data_vs_lambphi( xi, xj, bragg, lamb, phi, data, lambfit=lambfit, phifit=phifit, spect1d=spect1d, + vertsum1d=vertsum1d, phiref=phiref, cmap=cmap, vmin=vmin, vmax=vmax, fs=fs) return ax diff --git a/tofu/geom/_plot_optics.py b/tofu/geom/_plot_optics.py index 574e8e406..69c28e047 100644 --- a/tofu/geom/_plot_optics.py +++ b/tofu/geom/_plot_optics.py @@ -381,7 +381,9 @@ def CrystalBragg_plot_braggangle_from_xixj(xi=None, xj=None, def CrystalBragg_plot_data_vs_lambphi(xi, xj, bragg, lamb, phi, data, - lambfit=None, phifit=None, spect1d=None, + lambfit=None, phifit=None, + spect1d=None, vertsum1d=None, + phiref=None, cmap=None, vmin=None, vmax=None, fs=None, dmargin=None, angunits='deg'): @@ -402,6 +404,8 @@ def CrystalBragg_plot_data_vs_lambphi(xi, xj, bragg, lamb, phi, data, bragg = bragg*180./np.pi phi = phi*180./np.pi phifit = phifit*180./np.pi + if phiref is not None: + phiref = 180*phiref/np.pi # pre-compute @@ -415,19 +419,23 @@ def CrystalBragg_plot_data_vs_lambphi(xi, xj, bragg, lamb, phi, data, # ------------ fig = fig = plt.figure(figsize=fs) - gs = gridspec.GridSpec(4, 3, **dmargin) + gs = gridspec.GridSpec(4, 4, **dmargin) ax0 = fig.add_subplot(gs[:3, 0], aspect='equal', adjustable='datalim') ax1 = fig.add_subplot(gs[:3, 1], aspect='equal', adjustable='datalim', sharex=ax0, sharey=ax0) axs1 = fig.add_subplot(gs[3, 1], sharex=ax0) ax2 = fig.add_subplot(gs[:3, 2]) axs2 = fig.add_subplot(gs[3, 2], sharex=ax2, sharey=axs1) + ax3 = fig.add_subplot(gs[:3, 3], sharey=ax2) ax0.set_title('Coordinates transform') ax1.set_title('Camera image') ax2.set_title('Camera image transformed') - ax0.set_ylabel(r'incidence angle ($deg$)') + ax2.set_ylabel(r'incidence angle ($deg$)') + ax2.set_xlabel(r'$\lambda$ ($m$)') + axs2.set_xlabel(r'$\lambda$ ($m$)') + ax3.set_ylabel(r'incidence angle ($deg$)') ax0.contour(xi, xj, bragg, 10, cmap=cmap) ax0.contour(xi, xj, phi, 10, cmap=cmap, ls='--') @@ -438,6 +446,9 @@ def CrystalBragg_plot_data_vs_lambphi(xi, xj, bragg, lamb, phi, data, marker='s', edgecolors='None', cmap=cmap, vmin=vmin, vmax=vmax) axs2.plot(lambfit, spect1d, c='k', ls='-') + ax3.plot(vertsum1d, phifit, c='k', ls='-') + if phiref is not None: + ax3.axhline(phiref, c='k', ls='--') ax2.set_xlim(extent2[0], extent2[1]) ax2.set_ylim(extent2[2], extent2[3]) diff --git a/tofu/version.py b/tofu/version.py index 432f412b3..a6dc38a33 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.2-a5-4-g87899e8' +__version__ = '1.4.2-a5-5-gefbf5ff' From 889acb55f146878e19c8e9997e219ed760d763ff Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Wed, 4 Dec 2019 15:31:15 +0100 Subject: [PATCH 047/168] put back all deploy methods --- .travis.yml | 72 +++++++++++++++++++++-------------------------------- 1 file changed, 29 insertions(+), 43 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2338266d5..3025bf4ac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -85,49 +85,35 @@ before_deploy: - export PKG_REAL=$(conda build . --output | tail -1) - echo "BEFORE DEPLOY END.........." -# deploy: -# # - provider: script -# # user: "ToFuProject" -# # script: $START/anaconda_upload.sh -# # on: -# # tags: true -# # branch: master -# # skip_cleanup: true -# # - provider: pypi -# # user: "Didou09" -# # distributions: "sdist" -# # skip_existing: true -# # skip_cleanup: true -# # on: -# # tags: true -# # branch: master -# # password: -# # secure: JNEDTDJVx/2fXNfHntNQ99iDRNuQ4uB3y+DBWVIBycCT95+UCb36YPtKzmruEk/UUS29Xgq4IYCGdfCSWE9smKqG8tV1PcHiw705m+AzcpKy77YtzbVECFBxqY4W36O2pHrkwEUzP/7acjFwNsnUFzArqEzsBJ+KdLaa4OPHJXCh30GA0GyqlrXYbBKG+DA9hX5vtsGo4C6w9noALYF3fS7pKPiI6ipKFnAlzGgHQ7Ke0uQME8N3IAFhmh+Z5xMtIIDWxlnqv+KszdG4DIaGV/W6NIJNAbRhzkqUd+Chu6LoPAd/XkHDTeirR/MBkNUc5UcRJxRnP9rUTRo1gCO/buTYuNRgFkMvqhV5a033+x9edWgtUiKNJIMPLXOxe0RJvc5GWji+Co77HtHxRmGRM2rnYqWMtZeYZlFbUdvHu/8jf0d6I8jyUgAoJYdlMA2u/ipENP3S6by4epE9qycUPXiIVh6r3DZbf3vPTMFvTZYAjBrA0NOzihv1xgcXwemmNUFOQSpe0io4UcFxtS9lLMo+30UMQjCHSnbEVM3zSlZmbMOKpkVOlKlt8Lz5NxwVgWtu9FuW2pGukLtE8AWbqvY9urXAPZCQqZlOIklIjJQIqOITnuw9LEV09cgvPHXfdvNni3ldbMlIQ89zryM6dYvhYryTiEZGK4JDR3wAKJA= -# # - provider: pypi -# # user: "Didou09" -# # distributions: "bdist_wheel" -# # skip_existing: true -# # skip_cleanup: true -# # on: -# # tags: true -# # condition: $OS = osx-64 -# # branch: master -# # password: -# # secure: JNEDTDJVx/2fXNfHntNQ99iDRNuQ4uB3y+DBWVIBycCT95+UCb36YPtKzmruEk/UUS29Xgq4IYCGdfCSWE9smKqG8tV1PcHiw705m+AzcpKy77YtzbVECFBxqY4W36O2pHrkwEUzP/7acjFwNsnUFzArqEzsBJ+KdLaa4OPHJXCh30GA0GyqlrXYbBKG+DA9hX5vtsGo4C6w9noALYF3fS7pKPiI6ipKFnAlzGgHQ7Ke0uQME8N3IAFhmh+Z5xMtIIDWxlnqv+KszdG4DIaGV/W6NIJNAbRhzkqUd+Chu6LoPAd/XkHDTeirR/MBkNUc5UcRJxRnP9rUTRo1gCO/buTYuNRgFkMvqhV5a033+x9edWgtUiKNJIMPLXOxe0RJvc5GWji+Co77HtHxRmGRM2rnYqWMtZeYZlFbUdvHu/8jf0d6I8jyUgAoJYdlMA2u/ipENP3S6by4epE9qycUPXiIVh6r3DZbf3vPTMFvTZYAjBrA0NOzihv1xgcXwemmNUFOQSpe0io4UcFxtS9lLMo+30UMQjCHSnbEVM3zSlZmbMOKpkVOlKlt8Lz5NxwVgWtu9FuW2pGukLtE8AWbqvY9urXAPZCQqZlOIklIjJQIqOITnuw9LEV09cgvPHXfdvNni3ldbMlIQ89zryM6dYvhYryTiEZGK4JDR3wAKJA= -# - provider: pypi -# user: "Didou09" -# distributions: "sdist" -# skip_existing: true -# skip_cleanup: true -# on: -# tags: true -# branch: deploy-test -# server: https://test.pypi.org/legacy/ -# password: -# secure: JNEDTDJVx/2fXNfHntNQ99iDRNuQ4uB3y+DBWVIBycCT95+UCb36YPtKzmruEk/UUS29Xgq4IYCGdfCSWE9smKqG8tV1PcHiw705m+AzcpKy77YtzbVECFBxqY4W36O2pHrkwEUzP/7acjFwNsnUFzArqEzsBJ+KdLaa4OPHJXCh30GA0GyqlrXYbBKG+DA9hX5vtsGo4C6w9noALYF3fS7pKPiI6ipKFnAlzGgHQ7Ke0uQME8N3IAFhmh+Z5xMtIIDWxlnqv+KszdG4DIaGV/W6NIJNAbRhzkqUd+Chu6LoPAd/XkHDTeirR/MBkNUc5UcRJxRnP9rUTRo1gCO/buTYuNRgFkMvqhV5a033+x9edWgtUiKNJIMPLXOxe0RJvc5GWji+Co77HtHxRmGRM2rnYqWMtZeYZlFbUdvHu/8jf0d6I8jyUgAoJYdlMA2u/ipENP3S6by4epE9qycUPXiIVh6r3DZbf3vPTMFvTZYAjBrA0NOzihv1xgcXwemmNUFOQSpe0io4UcFxtS9lLMo+30UMQjCHSnbEVM3zSlZmbMOKpkVOlKlt8Lz5NxwVgWtu9FuW2pGukLtE8AWbqvY9urXAPZCQqZlOIklIjJQIqOITnuw9LEV09cgvPHXfdvNni3ldbMlIQ89zryM6dYvhYryTiEZGK4JDR3wAKJA= - - deploy: + - provider: script + user: "ToFuProject" + script: $START/anaconda_upload.sh + on: + tags: true + branch: master + skip_cleanup: true + - provider: pypi + user: "Didou09" + distributions: "sdist" + skip_existing: true + skip_cleanup: true + on: + tags: true + branch: master + password: + secure: JNEDTDJVx/2fXNfHntNQ99iDRNuQ4uB3y+DBWVIBycCT95+UCb36YPtKzmruEk/UUS29Xgq4IYCGdfCSWE9smKqG8tV1PcHiw705m+AzcpKy77YtzbVECFBxqY4W36O2pHrkwEUzP/7acjFwNsnUFzArqEzsBJ+KdLaa4OPHJXCh30GA0GyqlrXYbBKG+DA9hX5vtsGo4C6w9noALYF3fS7pKPiI6ipKFnAlzGgHQ7Ke0uQME8N3IAFhmh+Z5xMtIIDWxlnqv+KszdG4DIaGV/W6NIJNAbRhzkqUd+Chu6LoPAd/XkHDTeirR/MBkNUc5UcRJxRnP9rUTRo1gCO/buTYuNRgFkMvqhV5a033+x9edWgtUiKNJIMPLXOxe0RJvc5GWji+Co77HtHxRmGRM2rnYqWMtZeYZlFbUdvHu/8jf0d6I8jyUgAoJYdlMA2u/ipENP3S6by4epE9qycUPXiIVh6r3DZbf3vPTMFvTZYAjBrA0NOzihv1xgcXwemmNUFOQSpe0io4UcFxtS9lLMo+30UMQjCHSnbEVM3zSlZmbMOKpkVOlKlt8Lz5NxwVgWtu9FuW2pGukLtE8AWbqvY9urXAPZCQqZlOIklIjJQIqOITnuw9LEV09cgvPHXfdvNni3ldbMlIQ89zryM6dYvhYryTiEZGK4JDR3wAKJA= + - provider: pypi + user: "Didou09" + distributions: "bdist_wheel" + skip_existing: true + skip_cleanup: true + on: + tags: true + condition: $OS = osx-64 + branch: master + password: + secure: JNEDTDJVx/2fXNfHntNQ99iDRNuQ4uB3y+DBWVIBycCT95+UCb36YPtKzmruEk/UUS29Xgq4IYCGdfCSWE9smKqG8tV1PcHiw705m+AzcpKy77YtzbVECFBxqY4W36O2pHrkwEUzP/7acjFwNsnUFzArqEzsBJ+KdLaa4OPHJXCh30GA0GyqlrXYbBKG+DA9hX5vtsGo4C6w9noALYF3fS7pKPiI6ipKFnAlzGgHQ7Ke0uQME8N3IAFhmh+Z5xMtIIDWxlnqv+KszdG4DIaGV/W6NIJNAbRhzkqUd+Chu6LoPAd/XkHDTeirR/MBkNUc5UcRJxRnP9rUTRo1gCO/buTYuNRgFkMvqhV5a033+x9edWgtUiKNJIMPLXOxe0RJvc5GWji+Co77HtHxRmGRM2rnYqWMtZeYZlFbUdvHu/8jf0d6I8jyUgAoJYdlMA2u/ipENP3S6by4epE9qycUPXiIVh6r3DZbf3vPTMFvTZYAjBrA0NOzihv1xgcXwemmNUFOQSpe0io4UcFxtS9lLMo+30UMQjCHSnbEVM3zSlZmbMOKpkVOlKlt8Lz5NxwVgWtu9FuW2pGukLtE8AWbqvY9urXAPZCQqZlOIklIjJQIqOITnuw9LEV09cgvPHXfdvNni3ldbMlIQ89zryM6dYvhYryTiEZGK4JDR3wAKJA= - provider: pypi user: "Didou09" on: @@ -136,4 +122,4 @@ deploy: skip_existing: true password: secure: JNEDTDJVx/2fXNfHntNQ99iDRNuQ4uB3y+DBWVIBycCT95+UCb36YPtKzmruEk/UUS29Xgq4IYCGdfCSWE9smKqG8tV1PcHiw705m+AzcpKy77YtzbVECFBxqY4W36O2pHrkwEUzP/7acjFwNsnUFzArqEzsBJ+KdLaa4OPHJXCh30GA0GyqlrXYbBKG+DA9hX5vtsGo4C6w9noALYF3fS7pKPiI6ipKFnAlzGgHQ7Ke0uQME8N3IAFhmh+Z5xMtIIDWxlnqv+KszdG4DIaGV/W6NIJNAbRhzkqUd+Chu6LoPAd/XkHDTeirR/MBkNUc5UcRJxRnP9rUTRo1gCO/buTYuNRgFkMvqhV5a033+x9edWgtUiKNJIMPLXOxe0RJvc5GWji+Co77HtHxRmGRM2rnYqWMtZeYZlFbUdvHu/8jf0d6I8jyUgAoJYdlMA2u/ipENP3S6by4epE9qycUPXiIVh6r3DZbf3vPTMFvTZYAjBrA0NOzihv1xgcXwemmNUFOQSpe0io4UcFxtS9lLMo+30UMQjCHSnbEVM3zSlZmbMOKpkVOlKlt8Lz5NxwVgWtu9FuW2pGukLtE8AWbqvY9urXAPZCQqZlOIklIjJQIqOITnuw9LEV09cgvPHXfdvNni3ldbMlIQ89zryM6dYvhYryTiEZGK4JDR3wAKJA= - server: https://test.pypi.org/legacy/ \ No newline at end of file + server: https://test.pypi.org/legacy/ From 038bf34f23db0fa52df615234e35c17719328890 Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Wed, 4 Dec 2019 16:54:44 +0100 Subject: [PATCH 048/168] [test pypi] trying with new token --- .travis.yml | 115 ++++++++++++++++++++++++---------------------------- 1 file changed, 54 insertions(+), 61 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3025bf4ac..c1ed041c8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,101 +1,94 @@ language: python - matrix: include: - - name: "Bionic python 3.7" + - name: Bionic python 3.7 os: linux dist: bionic python: 3.7 env: - - REPO=https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh - - OS=linux-64 - - name: "trusty python 3.6" + - REPO=https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh + - OS=linux-64 + - name: trusty python 3.6 os: linux dist: trusty python: 3.6 env: - - REPO=https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh - - OS=linux-64 - - name: "xenial python 3.7" + - REPO=https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh + - OS=linux-64 + - name: xenial python 3.7 os: linux dist: xenial python: 3.7 env: - - REPO=https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh - - OS=linux-64 - - name: "xenial python 3.6" + - REPO=https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh + - OS=linux-64 + - name: xenial python 3.6 os: linux dist: xenial python: 3.6 env: - - REPO=https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh - - OS=linux-64 - - name: "osx python 3.7" + - REPO=https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh + - OS=linux-64 + - name: osx python 3.7 os: osx language: generic env: - REPO=https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh - TRAVIS_PYTHON_VERSION=3.7 - OS=osx-64 - - name: "osx python 3.6" + - name: osx python 3.6 os: osx language: generic env: - REPO=https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh - TRAVIS_PYTHON_VERSION=3.6 - OS=osx-64 - before_install: - - gcc --version - - export START=$(pwd) - +- gcc --version +- export START=$(pwd) install: - - wget "$REPO" -O miniconda.sh - - bash miniconda.sh -b -p $HOME/miniconda - - export PATH="$HOME/miniconda/bin:$PATH" - - hash -r - - conda config --set always_yes yes --set changeps1 no - - conda config --append channels conda-forge - - conda config --append channels tofuproject - - conda info -a - - conda install -q python="$TRAVIS_PYTHON_VERSION" conda-verify - nose nose-timer coverage codecov - - export REV=$(python -c "import _updateversion as up; out=up.updateversion(); print(out)") - - export VERSION=$(echo $REV | tr - .) - - echo $REV - - pip install -e ".[dev]" - +- wget "$REPO" -O miniconda.sh +- bash miniconda.sh -b -p $HOME/miniconda +- export PATH="$HOME/miniconda/bin:$PATH" +- hash -r +- conda config --set always_yes yes --set changeps1 no +- conda config --append channels conda-forge +- conda config --append channels tofuproject +- conda info -a +- conda install -q python="$TRAVIS_PYTHON_VERSION" conda-verify nose nose-timer coverage + codecov +- export REV=$(python -c "import _updateversion as up; out=up.updateversion(); print(out)") +- export VERSION=$(echo $REV | tr - .) +- echo $REV +- pip install -e ".[dev]" script: - - cd $HOME - - nosetests tofu.tests --nocapture -v --with-id --with-timer --with-coverage - --cover-package=tofu - +- cd $HOME +- nosetests tofu.tests --nocapture -v --with-id --with-timer --with-coverage --cover-package=tofu after_success: - - codecov - - chmod +x $START/anaconda_upload.sh - - echo $TRAVIS_TAG - +- codecov +- chmod +x $START/anaconda_upload.sh +- echo $TRAVIS_TAG before_deploy: - - echo "BEFORE DEPLOY START........" - - ls $START - - cd $START - - conda config --set anaconda_upload no - - conda install anaconda-client conda-build - - conda build conda_recipe - - export PKG_REAL=$(conda build . --output | tail -1) - - echo "BEFORE DEPLOY END.........." - +- echo "BEFORE DEPLOY START........" +- ls $START +- cd $START +- conda config --set anaconda_upload no +- conda install anaconda-client conda-build +- conda build conda_recipe +- export PKG_REAL=$(conda build . --output | tail -1) +- echo "BEFORE DEPLOY END.........." deploy: + matrix: - provider: script - user: "ToFuProject" - script: $START/anaconda_upload.sh + user: ToFuProject + script: "$START/anaconda_upload.sh" on: tags: true branch: master skip_cleanup: true - provider: pypi - user: "Didou09" - distributions: "sdist" + user: Didou09 + distributions: sdist skip_existing: true skip_cleanup: true on: @@ -104,22 +97,22 @@ deploy: password: secure: JNEDTDJVx/2fXNfHntNQ99iDRNuQ4uB3y+DBWVIBycCT95+UCb36YPtKzmruEk/UUS29Xgq4IYCGdfCSWE9smKqG8tV1PcHiw705m+AzcpKy77YtzbVECFBxqY4W36O2pHrkwEUzP/7acjFwNsnUFzArqEzsBJ+KdLaa4OPHJXCh30GA0GyqlrXYbBKG+DA9hX5vtsGo4C6w9noALYF3fS7pKPiI6ipKFnAlzGgHQ7Ke0uQME8N3IAFhmh+Z5xMtIIDWxlnqv+KszdG4DIaGV/W6NIJNAbRhzkqUd+Chu6LoPAd/XkHDTeirR/MBkNUc5UcRJxRnP9rUTRo1gCO/buTYuNRgFkMvqhV5a033+x9edWgtUiKNJIMPLXOxe0RJvc5GWji+Co77HtHxRmGRM2rnYqWMtZeYZlFbUdvHu/8jf0d6I8jyUgAoJYdlMA2u/ipENP3S6by4epE9qycUPXiIVh6r3DZbf3vPTMFvTZYAjBrA0NOzihv1xgcXwemmNUFOQSpe0io4UcFxtS9lLMo+30UMQjCHSnbEVM3zSlZmbMOKpkVOlKlt8Lz5NxwVgWtu9FuW2pGukLtE8AWbqvY9urXAPZCQqZlOIklIjJQIqOITnuw9LEV09cgvPHXfdvNni3ldbMlIQ89zryM6dYvhYryTiEZGK4JDR3wAKJA= - provider: pypi - user: "Didou09" - distributions: "bdist_wheel" + user: Didou09 + distributions: bdist_wheel skip_existing: true skip_cleanup: true on: tags: true - condition: $OS = osx-64 + condition: "$OS = osx-64" branch: master password: secure: JNEDTDJVx/2fXNfHntNQ99iDRNuQ4uB3y+DBWVIBycCT95+UCb36YPtKzmruEk/UUS29Xgq4IYCGdfCSWE9smKqG8tV1PcHiw705m+AzcpKy77YtzbVECFBxqY4W36O2pHrkwEUzP/7acjFwNsnUFzArqEzsBJ+KdLaa4OPHJXCh30GA0GyqlrXYbBKG+DA9hX5vtsGo4C6w9noALYF3fS7pKPiI6ipKFnAlzGgHQ7Ke0uQME8N3IAFhmh+Z5xMtIIDWxlnqv+KszdG4DIaGV/W6NIJNAbRhzkqUd+Chu6LoPAd/XkHDTeirR/MBkNUc5UcRJxRnP9rUTRo1gCO/buTYuNRgFkMvqhV5a033+x9edWgtUiKNJIMPLXOxe0RJvc5GWji+Co77HtHxRmGRM2rnYqWMtZeYZlFbUdvHu/8jf0d6I8jyUgAoJYdlMA2u/ipENP3S6by4epE9qycUPXiIVh6r3DZbf3vPTMFvTZYAjBrA0NOzihv1xgcXwemmNUFOQSpe0io4UcFxtS9lLMo+30UMQjCHSnbEVM3zSlZmbMOKpkVOlKlt8Lz5NxwVgWtu9FuW2pGukLtE8AWbqvY9urXAPZCQqZlOIklIjJQIqOITnuw9LEV09cgvPHXfdvNni3ldbMlIQ89zryM6dYvhYryTiEZGK4JDR3wAKJA= - provider: pypi - user: "Didou09" + user: Didou09 on: branch: deploy-test tags: true skip_existing: true password: - secure: JNEDTDJVx/2fXNfHntNQ99iDRNuQ4uB3y+DBWVIBycCT95+UCb36YPtKzmruEk/UUS29Xgq4IYCGdfCSWE9smKqG8tV1PcHiw705m+AzcpKy77YtzbVECFBxqY4W36O2pHrkwEUzP/7acjFwNsnUFzArqEzsBJ+KdLaa4OPHJXCh30GA0GyqlrXYbBKG+DA9hX5vtsGo4C6w9noALYF3fS7pKPiI6ipKFnAlzGgHQ7Ke0uQME8N3IAFhmh+Z5xMtIIDWxlnqv+KszdG4DIaGV/W6NIJNAbRhzkqUd+Chu6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5TI1qauk6Htw= + server: https://test.pypi.org/legacy/ \ No newline at end of file From f0af1a4f9cd2d3d35092dbdf190a5a028e48249a Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Wed, 4 Dec 2019 17:25:06 +0100 Subject: [PATCH 049/168] [test pypi] took out automatically added matrix --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c1ed041c8..a89175203 100644 --- a/.travis.yml +++ b/.travis.yml @@ -78,7 +78,6 @@ before_deploy: - export PKG_REAL=$(conda build . --output | tail -1) - echo "BEFORE DEPLOY END.........." deploy: - matrix: - provider: script user: ToFuProject script: "$START/anaconda_upload.sh" From f1e768c4abc8686b9b67e46646f87b0d7412c459 Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Wed, 4 Dec 2019 17:31:51 +0100 Subject: [PATCH 050/168] [debugging] debugging mac vol <= 0. --- tofu/geom/_comp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tofu/geom/_comp.py b/tofu/geom/_comp.py index 8ddef84bf..b91a9c6fb 100644 --- a/tofu/geom/_comp.py +++ b/tofu/geom/_comp.py @@ -3,7 +3,6 @@ """ # Built-in -import sys import warnings # Common @@ -63,6 +62,7 @@ def _Struct_set_Poly( else: Vol, BaryV = _GG.Poly_VolAngTor(Poly) msg = "Pb. with volume computation for Ves object of type 'Tor' !" + msg = "\n Here Volume = " + str(Vol) assert Vol > 0.0, msg # Compute the non-normalized vector of each side of the Poly From 2548de567acddb7dd618f6e8c152ec14790419b8 Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Wed, 4 Dec 2019 17:46:59 +0100 Subject: [PATCH 051/168] [deploy] trying only one deployment no tags --- .travis.yml | 60 +++++++++++++++++++++++++++-------------------------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/.travis.yml b/.travis.yml index a89175203..3bd7048ad 100644 --- a/.travis.yml +++ b/.travis.yml @@ -77,40 +77,42 @@ before_deploy: - conda build conda_recipe - export PKG_REAL=$(conda build . --output | tail -1) - echo "BEFORE DEPLOY END.........." + +deploy: + # - provider: script + # user: ToFuProject + # script: "$START/anaconda_upload.sh" + # on: + # tags: true + # branch: master + # skip_cleanup: true + # - provider: pypi + # user: Didou09 + # distributions: sdist + # skip_existing: true + # skip_cleanup: true + # on: + # tags: true + # branch: master + # password: + # secure: JNEDTDJVx/2fXNfHntNQ99iDRNuQ4uB3y+DBWVIBycCT95+UCb36YPtKzmruEk/UUS29Xgq4IYCGdfCSWE9smKqG8tV1PcHiw705m+AzcpKy77YtzbVECFBxqY4W36O2pHrkwEUzP/7acjFwNsnUFzArqEzsBJ+KdLaa4OPHJXCh30GA0GyqlrXYbBKG+DA9hX5vtsGo4C6w9noALYF3fS7pKPiI6ipKFnAlzGgHQ7Ke0uQME8N3IAFhmh+Z5xMtIIDWxlnqv+KszdG4DIaGV/W6NIJNAbRhzkqUd+Chu6LoPAd/XkHDTeirR/MBkNUc5UcRJxRnP9rUTRo1gCO/buTYuNRgFkMvqhV5a033+x9edWgtUiKNJIMPLXOxe0RJvc5GWji+Co77HtHxRmGRM2rnYqWMtZeYZlFbUdvHu/8jf0d6I8jyUgAoJYdlMA2u/ipENP3S6by4epE9qycUPXiIVh6r3DZbf3vPTMFvTZYAjBrA0NOzihv1xgcXwemmNUFOQSpe0io4UcFxtS9lLMo+30UMQjCHSnbEVM3zSlZmbMOKpkVOlKlt8Lz5NxwVgWtu9FuW2pGukLtE8AWbqvY9urXAPZCQqZlOIklIjJQIqOITnuw9LEV09cgvPHXfdvNni3ldbMlIQ89zryM6dYvhYryTiEZGK4JDR3wAKJA= + # - provider: pypi + # user: Didou09 + # distributions: bdist_wheel + # skip_existing: true + # skip_cleanup: true + # on: + # tags: true + # condition: "$OS = osx-64" + # branch: master + # password: + # secure: JNEDTDJVx/2fXNfHntNQ99iDRNuQ4uB3y+DBWVIBycCT95+UCb36YPtKzmruEk/UUS29Xgq4IYCGdfCSWE9smKqG8tV1PcHiw705m+AzcpKy77YtzbVECFBxqY4W36O2pHrkwEUzP/7acjFwNsnUFzArqEzsBJ+KdLaa4OPHJXCh30GA0GyqlrXYbBKG+DA9hX5vtsGo4C6w9noALYF3fS7pKPiI6ipKFnAlzGgHQ7Ke0uQME8N3IAFhmh+Z5xMtIIDWxlnqv+KszdG4DIaGV/W6NIJNAbRhzkqUd+Chu6LoPAd/XkHDTeirR/MBkNUc5UcRJxRnP9rUTRo1gCO/buTYuNRgFkMvqhV5a033+x9edWgtUiKNJIMPLXOxe0RJvc5GWji+Co77HtHxRmGRM2rnYqWMtZeYZlFbUdvHu/8jf0d6I8jyUgAoJYdlMA2u/ipENP3S6by4epE9qycUPXiIVh6r3DZbf3vPTMFvTZYAjBrA0NOzihv1xgcXwemmNUFOQSpe0io4UcFxtS9lLMo+30UMQjCHSnbEVM3zSlZmbMOKpkVOlKlt8Lz5NxwVgWtu9FuW2pGukLtE8AWbqvY9urXAPZCQqZlOIklIjJQIqOITnuw9LEV09cgvPHXfdvNni3ldbMlIQ89zryM6dYvhYryTiEZGK4JDR3wAKJA= + deploy: - - provider: script - user: ToFuProject - script: "$START/anaconda_upload.sh" - on: - tags: true - branch: master - skip_cleanup: true - - provider: pypi - user: Didou09 - distributions: sdist - skip_existing: true - skip_cleanup: true - on: - tags: true - branch: master - password: - secure: JNEDTDJVx/2fXNfHntNQ99iDRNuQ4uB3y+DBWVIBycCT95+UCb36YPtKzmruEk/UUS29Xgq4IYCGdfCSWE9smKqG8tV1PcHiw705m+AzcpKy77YtzbVECFBxqY4W36O2pHrkwEUzP/7acjFwNsnUFzArqEzsBJ+KdLaa4OPHJXCh30GA0GyqlrXYbBKG+DA9hX5vtsGo4C6w9noALYF3fS7pKPiI6ipKFnAlzGgHQ7Ke0uQME8N3IAFhmh+Z5xMtIIDWxlnqv+KszdG4DIaGV/W6NIJNAbRhzkqUd+Chu6LoPAd/XkHDTeirR/MBkNUc5UcRJxRnP9rUTRo1gCO/buTYuNRgFkMvqhV5a033+x9edWgtUiKNJIMPLXOxe0RJvc5GWji+Co77HtHxRmGRM2rnYqWMtZeYZlFbUdvHu/8jf0d6I8jyUgAoJYdlMA2u/ipENP3S6by4epE9qycUPXiIVh6r3DZbf3vPTMFvTZYAjBrA0NOzihv1xgcXwemmNUFOQSpe0io4UcFxtS9lLMo+30UMQjCHSnbEVM3zSlZmbMOKpkVOlKlt8Lz5NxwVgWtu9FuW2pGukLtE8AWbqvY9urXAPZCQqZlOIklIjJQIqOITnuw9LEV09cgvPHXfdvNni3ldbMlIQ89zryM6dYvhYryTiEZGK4JDR3wAKJA= - - provider: pypi - user: Didou09 - distributions: bdist_wheel - skip_existing: true - skip_cleanup: true - on: - tags: true - condition: "$OS = osx-64" - branch: master - password: - secure: JNEDTDJVx/2fXNfHntNQ99iDRNuQ4uB3y+DBWVIBycCT95+UCb36YPtKzmruEk/UUS29Xgq4IYCGdfCSWE9smKqG8tV1PcHiw705m+AzcpKy77YtzbVECFBxqY4W36O2pHrkwEUzP/7acjFwNsnUFzArqEzsBJ+KdLaa4OPHJXCh30GA0GyqlrXYbBKG+DA9hX5vtsGo4C6w9noALYF3fS7pKPiI6ipKFnAlzGgHQ7Ke0uQME8N3IAFhmh+Z5xMtIIDWxlnqv+KszdG4DIaGV/W6NIJNAbRhzkqUd+Chu6LoPAd/XkHDTeirR/MBkNUc5UcRJxRnP9rUTRo1gCO/buTYuNRgFkMvqhV5a033+x9edWgtUiKNJIMPLXOxe0RJvc5GWji+Co77HtHxRmGRM2rnYqWMtZeYZlFbUdvHu/8jf0d6I8jyUgAoJYdlMA2u/ipENP3S6by4epE9qycUPXiIVh6r3DZbf3vPTMFvTZYAjBrA0NOzihv1xgcXwemmNUFOQSpe0io4UcFxtS9lLMo+30UMQjCHSnbEVM3zSlZmbMOKpkVOlKlt8Lz5NxwVgWtu9FuW2pGukLtE8AWbqvY9urXAPZCQqZlOIklIjJQIqOITnuw9LEV09cgvPHXfdvNni3ldbMlIQ89zryM6dYvhYryTiEZGK4JDR3wAKJA= - provider: pypi user: Didou09 on: branch: deploy-test - tags: true skip_existing: true password: secure: u2L1S7GumIbaNgxcHgI8NFlQgDgEbYmbXNTkldngtejPVD4Cnuf9fUJ+vhP8FT/WV62WYCktt3l7g+TzyTo3hErap+i/61KZ0T2iScAHFWPb8t7B6SuwOr/9gsDs5HIIO31GZ8OjarLeJoO/T7cPr+167OT4DQsJcz6OcOD7S+XwjXBF/2ZnH0Wzl5PgdCcxudlJDLB0X+cpWUJ871LoCWQRWABRx+/FVuLflaKYrKQwbqExVoPmCv9VaH6K3KUj80xSgCnvpOv5CZixITz2FzyEM3P/u7fg7skv3lXxcjVKKphOOHi5iCw5ffYIAbmFrbr8VB9aCwCLzV4a3DyywXrA5JqsOXioIXKMTY8WD+MWQ4icV45s2S4RDz3QaRxbtjNF7gQnEGTG1/pqwiJnKJ7UB8luDaU7t0ADzXkPp/Xgqgpfi05vkoucwSmQgAcCVG6muxNbOW+gcWy+Wmf2pltyYLnep4OIx2phtf7Phk03igCFUktcVb8jPdcw9TvJyYztMQ1x0xd6q9jQB/cKz+JEw7+1xs7pszaR8xFXdDYWOW4Lc3TE2+LgFG6YeL3c9zPF8BjxF1Ocp60CAckm+tZwFL0TmC0UYsSNc9PSHEQ2hn9IFSih3tNgGcGgx8EMHCF5HVu1TXOUpETYAeeqJRBCISChFns5TI1qauk6Htw= From 7b9be6cdf891a41e0b74030d1b0c5747a3510cac Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Wed, 4 Dec 2019 18:09:25 +0100 Subject: [PATCH 052/168] [Issue202] Computing cone intersection with circle too cumbersome => discretize circle and select in interval of interest --- .../SpectroX2D_ConeCircleMagAxis.pdf | Bin 0 -> 71783 bytes .../SpectroX2D_ConeCircleMagAxis.tex | 133 ++++++++++++++++++ tofu/version.py | 2 +- 3 files changed, 134 insertions(+), 1 deletion(-) create mode 100644 Notes_Upgrades/SpectroX2D/SpectroX2D_ConeCircleMagAxis.pdf create mode 100644 Notes_Upgrades/SpectroX2D/SpectroX2D_ConeCircleMagAxis.tex diff --git a/Notes_Upgrades/SpectroX2D/SpectroX2D_ConeCircleMagAxis.pdf b/Notes_Upgrades/SpectroX2D/SpectroX2D_ConeCircleMagAxis.pdf new file mode 100644 index 0000000000000000000000000000000000000000..136140d9c72c9a9829e046150e85b643dc6c48b2 GIT binary patch literal 71783 zcmce81z6P2);}N^NJuv>-LcCS2+~MN3j%_qbhikih?JN}gQ9ebC@Br1gdibGiA&*V5M9)zjKt7|I7ZdzRSR*$UGLebAWqoVAOSwWqru->)~~ z|Avf*wWX(>i?cBF9|=KWzbQFeyW3epEM1(fA?D6j5LZWYXY0S{LdE_gVc1~~p~zo^ zRh$9)2gCm+hx(7?#14~#iT)y|W$tc{nKEG2+Re)xGpWC*!l3_-s+YxY0f_yh2w?DE zq?O!VoFEqN<~BA!05*;XV!(}O?GEvDfjGKYnma-)&D}k%J?zY#fv{ZMt?Zo5!PnnR z{5wsWySf7P+4%~~{=>}v(xoi!z2#wA|4E&)|2P-1ztpLV)AwIoiTzvs{T2-%_D|&g zQljo(t$tJdH!3t1!^}tr0ufQN^MsfjvRe3o5+Rb3#3Jg}&NiO55SSPWg8N4d+B*VM z0sS0-KozVlU97B$fz5k(x?7t&5&QOs+?UpD6eVfe*r8^9l*;Bkn_);HGWapd~# zoLGSe3yj&MH}7exn#qu;YnD8DG*W!~1blE|Rr>0@w}HPSeiZxo(ZLg8jJ*^`I0TSF zWgLsyJ&au?aIav!{Ta^?zwLArXLia2AiVTreHx^K3DqP z*$jIbPSQ+Way`c!J( zl`({3-1%VM2QH75D)4=*@bvs#tsx>><~G*EBJwW4!JIukAXxG05R2$od$@SH12ck% zVax~AoVT{JGnaGmg&1QrfDlIr!%#>F8V(gki<=MwI_`h~1dcIW9UyVY!I1C+cft;- z0Qsd@k&A{#5Hvzq6p%-ukitj=#M#Ty(d2N?13UbmdLod*=)d>GvixhBN?>Y$1h5DI zCvc1f>tLQy5IDwXbugwSqUG*lscY>CF$VHbP=bi)S^EO3JI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GQ%WDA0gR5Dff@vY z^{EX#Z<;H(PXWeHpF&^@oP{I{LoO8NIfGm>E))Y7$u#i2B-k}WoR(IAfiF7g|1FFR z#jFo>z^{SKH=g%-pfPg69V|3nBw?O7I$D5(PTgW*o;pdy67uM+7%?Chgb6S#sPZqy zFJh#Ud=`hlfNo(rn@6`$_!Bw?%clS%p-b`umccRx=u@U%e@S$a zz4KPJ(CK_X^F#Q}3+O|}ZhlGaKM0N952KPS`fxfc7D!z%Zb{S?93oL@G@jhNcez22z=MfXR>SC#4_`L(;VzCT8bE^Z@UxNJt^XVOYAXf5GS= zNcu1_58zp#BAU*3s(9u^p|5oQ?V;ps5hDSl`Ck7Z6hb1u642L5j>tm<~V65W+uT3$x#o{n{ zW*8ifg7&LS{h?66lo(+IIJ9+UfPwxX8)JZh{-CWJ6AX=Gff2CKjKNS3i$g<`F9Qq? z$3SMy3`2t{kr76~vG4_pL$T@s97AA{B^=Ar7EWN5B^HOoFw+dw1=?jW(gMf9S?VF+ zEb;}a0S<$)v}MHsR=q4V1NX*^1B=DLnd@P(C@9>*Kpz%MfEI!bFgW5*G-IGuDpNfa zv?^zUVbQF3k*vCbM1${=nA#$-&v+*{RyzmJ%CYbT zjli<>hetze2}T@vIJ5|2grSiv(k%6WlVyd$@yznYV(_ef zh=9Pb(1*uE3q1zBa6E?9zu*Z_#E7vT0naLP0-C@)4mbe`Zum2|#j@}ji-SY^VI~{| z7GDC6d=i-JA>bI6`3MAWam=y=@mv-g1nVzoam#=g0YJ<=MWDd^&0G(K0}mH4wFPdM zSvL@9EGvuvCMl-2NbtTS^VpDBG>eWSfpcf6M?kXJ8EFEc(FJH%iIWHP_TuuEsnrqA6PtsMW4a<0Iam&(FB(M@EDf42MbJ)SsqwCgI>|7 zL^4=Q^2o} Date: Wed, 4 Dec 2019 18:16:52 +0100 Subject: [PATCH 053/168] [deploy] new token and user is __token__ --- .travis.yml | 47 ++++++++--------------------------------------- 1 file changed, 8 insertions(+), 39 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3bd7048ad..9b2613e3e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -77,43 +77,12 @@ before_deploy: - conda build conda_recipe - export PKG_REAL=$(conda build . --output | tail -1) - echo "BEFORE DEPLOY END.........." - deploy: - # - provider: script - # user: ToFuProject - # script: "$START/anaconda_upload.sh" - # on: - # tags: true - # branch: master - # skip_cleanup: true - # - provider: pypi - # user: Didou09 - # distributions: sdist - # skip_existing: true - # skip_cleanup: true - # on: - # tags: true - # branch: master - # password: - # secure: JNEDTDJVx/2fXNfHntNQ99iDRNuQ4uB3y+DBWVIBycCT95+UCb36YPtKzmruEk/UUS29Xgq4IYCGdfCSWE9smKqG8tV1PcHiw705m+AzcpKy77YtzbVECFBxqY4W36O2pHrkwEUzP/7acjFwNsnUFzArqEzsBJ+KdLaa4OPHJXCh30GA0GyqlrXYbBKG+DA9hX5vtsGo4C6w9noALYF3fS7pKPiI6ipKFnAlzGgHQ7Ke0uQME8N3IAFhmh+Z5xMtIIDWxlnqv+KszdG4DIaGV/W6NIJNAbRhzkqUd+Chu6LoPAd/XkHDTeirR/MBkNUc5UcRJxRnP9rUTRo1gCO/buTYuNRgFkMvqhV5a033+x9edWgtUiKNJIMPLXOxe0RJvc5GWji+Co77HtHxRmGRM2rnYqWMtZeYZlFbUdvHu/8jf0d6I8jyUgAoJYdlMA2u/ipENP3S6by4epE9qycUPXiIVh6r3DZbf3vPTMFvTZYAjBrA0NOzihv1xgcXwemmNUFOQSpe0io4UcFxtS9lLMo+30UMQjCHSnbEVM3zSlZmbMOKpkVOlKlt8Lz5NxwVgWtu9FuW2pGukLtE8AWbqvY9urXAPZCQqZlOIklIjJQIqOITnuw9LEV09cgvPHXfdvNni3ldbMlIQ89zryM6dYvhYryTiEZGK4JDR3wAKJA= - # - provider: pypi - # user: Didou09 - # distributions: bdist_wheel - # skip_existing: true - # skip_cleanup: true - # on: - # tags: true - # condition: "$OS = osx-64" - # branch: master - # password: - # secure: JNEDTDJVx/2fXNfHntNQ99iDRNuQ4uB3y+DBWVIBycCT95+UCb36YPtKzmruEk/UUS29Xgq4IYCGdfCSWE9smKqG8tV1PcHiw705m+AzcpKy77YtzbVECFBxqY4W36O2pHrkwEUzP/7acjFwNsnUFzArqEzsBJ+KdLaa4OPHJXCh30GA0GyqlrXYbBKG+DA9hX5vtsGo4C6w9noALYF3fS7pKPiI6ipKFnAlzGgHQ7Ke0uQME8N3IAFhmh+Z5xMtIIDWxlnqv+KszdG4DIaGV/W6NIJNAbRhzkqUd+Chu6LoPAd/XkHDTeirR/MBkNUc5UcRJxRnP9rUTRo1gCO/buTYuNRgFkMvqhV5a033+x9edWgtUiKNJIMPLXOxe0RJvc5GWji+Co77HtHxRmGRM2rnYqWMtZeYZlFbUdvHu/8jf0d6I8jyUgAoJYdlMA2u/ipENP3S6by4epE9qycUPXiIVh6r3DZbf3vPTMFvTZYAjBrA0NOzihv1xgcXwemmNUFOQSpe0io4UcFxtS9lLMo+30UMQjCHSnbEVM3zSlZmbMOKpkVOlKlt8Lz5NxwVgWtu9FuW2pGukLtE8AWbqvY9urXAPZCQqZlOIklIjJQIqOITnuw9LEV09cgvPHXfdvNni3ldbMlIQ89zryM6dYvhYryTiEZGK4JDR3wAKJA= - -deploy: - - provider: pypi - user: Didou09 - on: - branch: deploy-test - skip_existing: true - password: - secure: u2L1S7GumIbaNgxcHgI8NFlQgDgEbYmbXNTkldngtejPVD4Cnuf9fUJ+vhP8FT/WV62WYCktt3l7g+TzyTo3hErap+i/61KZ0T2iScAHFWPb8t7B6SuwOr/9gsDs5HIIO31GZ8OjarLeJoO/T7cPr+167OT4DQsJcz6OcOD7S+XwjXBF/2ZnH0Wzl5PgdCcxudlJDLB0X+cpWUJ871LoCWQRWABRx+/FVuLflaKYrKQwbqExVoPmCv9VaH6K3KUj80xSgCnvpOv5CZixITz2FzyEM3P/u7fg7skv3lXxcjVKKphOOHi5iCw5ffYIAbmFrbr8VB9aCwCLzV4a3DyywXrA5JqsOXioIXKMTY8WD+MWQ4icV45s2S4RDz3QaRxbtjNF7gQnEGTG1/pqwiJnKJ7UB8luDaU7t0ADzXkPp/Xgqgpfi05vkoucwSmQgAcCVG6muxNbOW+gcWy+Wmf2pltyYLnep4OIx2phtf7Phk03igCFUktcVb8jPdcw9TvJyYztMQ1x0xd6q9jQB/cKz+JEw7+1xs7pszaR8xFXdDYWOW4Lc3TE2+LgFG6YeL3c9zPF8BjxF1Ocp60CAckm+tZwFL0TmC0UYsSNc9PSHEQ2hn9IFSih3tNgGcGgx8EMHCF5HVu1TXOUpETYAeeqJRBCISChFns5TI1qauk6Htw= - server: https://test.pypi.org/legacy/ \ No newline at end of file + provider: pypi + on: + branch: deploy-test + skip_existing: true + user: __token__ + password: + secure: a4HWH6oCDqnWkaqALeppbs/ud1k/bxlyhjUkMMwV7R55V07n/FSROyGPp+Vo1bOGUi35AnsqUF8PWfxvAhKSUZNFYpIrDGRe960JCGRlMrpkzObY3r+uUeVyyxP5540mUW0oqK+uaAynFWxqNgfRNh+SUS4Kgvx9lPslpnlNDTIBA9TN9cnReBuwcFhbosm9QSSqjJ8+ybP5OawIlL5iYiPot4NFXbTe3vjQrdNKfpNCS98QFBbbTijM0Hw5eU8X2R7/PyReU3TlLJvpUqO4PrOvAW85eIy6vrfKo9dgfFczJf3hUUfjGFSK3brm2HqJDUsxn/hg+GM7vynH63HyCLdQq+HZJUTCzfzts4BljQzrrAn6+0Ze/oMuVKynFZKnm0A08rHdLpcCiE3C+ehcJ9zttYPkiJYpRRQssPes8/ZqVVYAHHgH88Cts8i736rcR1eYyGzNrTRoT1AGCbco98Vaj/6/pEtC84OQIfXLFPeFGBSeAQcJ6RKwlDKeJeyQ23gUFyqRFqs9SR8EE6pfo7zYpWpuW+ZT1ESKghWuel14T4xcVohbX1MTsKEkjR+25SGWCq4KE1ql4H+m8h0A2FvIvRnK74uFfNFv1qbXYrFEYVTW2T19MtcWcYnzhMyOgIbb9I1MEgpEB6WgPC9EZhvSBiOBh5r8i+MlcxaMQZ4= + server: https://test.pypi.org/legacy/ From 83457f9885110f7d421b817696b85fbe24f1481d Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Wed, 4 Dec 2019 18:38:47 +0100 Subject: [PATCH 054/168] [deploy] added other deployments (different order) --- .travis.yml | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9b2613e3e..2d5960481 100644 --- a/.travis.yml +++ b/.travis.yml @@ -78,11 +78,27 @@ before_deploy: - export PKG_REAL=$(conda build . --output | tail -1) - echo "BEFORE DEPLOY END.........." deploy: - provider: pypi - on: - branch: deploy-test - skip_existing: true - user: __token__ - password: - secure: a4HWH6oCDqnWkaqALeppbs/ud1k/bxlyhjUkMMwV7R55V07n/FSROyGPp+Vo1bOGUi35AnsqUF8PWfxvAhKSUZNFYpIrDGRe960JCGRlMrpkzObY3r+uUeVyyxP5540mUW0oqK+uaAynFWxqNgfRNh+SUS4Kgvx9lPslpnlNDTIBA9TN9cnReBuwcFhbosm9QSSqjJ8+ybP5OawIlL5iYiPot4NFXbTe3vjQrdNKfpNCS98QFBbbTijM0Hw5eU8X2R7/PyReU3TlLJvpUqO4PrOvAW85eIy6vrfKo9dgfFczJf3hUUfjGFSK3brm2HqJDUsxn/hg+GM7vynH63HyCLdQq+HZJUTCzfzts4BljQzrrAn6+0Ze/oMuVKynFZKnm0A08rHdLpcCiE3C+ehcJ9zttYPkiJYpRRQssPes8/ZqVVYAHHgH88Cts8i736rcR1eYyGzNrTRoT1AGCbco98Vaj/6/pEtC84OQIfXLFPeFGBSeAQcJ6RKwlDKeJeyQ23gUFyqRFqs9SR8EE6pfo7zYpWpuW+ZT1ESKghWuel14T4xcVohbX1MTsKEkjR+25SGWCq4KE1ql4H+m8h0A2FvIvRnK74uFfNFv1qbXYrFEYVTW2T19MtcWcYnzhMyOgIbb9I1MEgpEB6WgPC9EZhvSBiOBh5r8i+MlcxaMQZ4= - server: https://test.pypi.org/legacy/ + - provider: pypi + on: + branch: deploy-test + skip_existing: true + user: __token__ + password: + secure: a4HWH6oCDqnWkaqALeppbs/ud1k/bxlyhjUkMMwV7R55V07n/FSROyGPp+Vo1bOGUi35AnsqUF8PWfxvAhKSUZNFYpIrDGRe960JCGRlMrpkzObY3r+uUeVyyxP5540mUW0oqK+uaAynFWxqNgfRNh+SUS4Kgvx9lPslpnlNDTIBA9TN9cnReBuwcFhbosm9QSSqjJ8+ybP5OawIlL5iYiPot4NFXbTe3vjQrdNKfpNCS98QFBbbTijM0Hw5eU8X2R7/PyReU3TlLJvpUqO4PrOvAW85eIy6vrfKo9dgfFczJf3hUUfjGFSK3brm2HqJDUsxn/hg+GM7vynH63HyCLdQq+HZJUTCzfzts4BljQzrrAn6+0Ze/oMuVKynFZKnm0A08rHdLpcCiE3C+ehcJ9zttYPkiJYpRRQssPes8/ZqVVYAHHgH88Cts8i736rcR1eYyGzNrTRoT1AGCbco98Vaj/6/pEtC84OQIfXLFPeFGBSeAQcJ6RKwlDKeJeyQ23gUFyqRFqs9SR8EE6pfo7zYpWpuW+ZT1ESKghWuel14T4xcVohbX1MTsKEkjR+25SGWCq4KE1ql4H+m8h0A2FvIvRnK74uFfNFv1qbXYrFEYVTW2T19MtcWcYnzhMyOgIbb9I1MEgpEB6WgPC9EZhvSBiOBh5r8i+MlcxaMQZ4= + server: https://test.pypi.org/legacy/ + - provider: pypi + distributions: "sdist" + user: __token__ + skip_existing: true + server: https://test.pypi.org/legacy/ + password: + secure: o63EC+U+EtdAgUSV3plrLfZ7QZ6Aflp0quV5jJQxD9w47Ds5i4k5GjEHogV8x8l5NGwxbXPKp/1eKEfYgFH/i+WUnj1n9reiYZBd0lkr2Ih9nExNEIrziMhPbqjDEYAB672bjkXseS6mF44boqDUEP3jyDaamLB+aR75RCMM1j6aha/54Ko88ZJKXBW5FuNSraBGzgvjVG0P63jG5epS85hX09dEcKNR0XO0kbiGfNnYIp78QBohO0Pdv99x2ryp/QaoWD4m7cMUOts2xIcI2KCJNMhZNdIS8C0TVvk2tgumb+G2px7PsOxA8yZgxLefs+A14IAjg6uKe/jmwrihN1V6R6FF3WCcxM6kdzt9bpr+QKBoXjkF8BdxVbgmdnxkr+Ah5WIxmw2boQoW/SIMy9GVPrgtkSvocN6NwOExsO4pagiOwTLIvjIe+/0+OJt/Pud+mwF/94HD+B7j/XxsK7QehLCd9v5NTrdNgpS/TiWOyCDP1DLnpl1V9/vZ56x9NSQhN4Wr6hRrTxjWNAYLxsMxZf6uR+WWg1TqyicVlGrSf0to2asNIPWTTeGq3tB0/7WNslRQzP7QD67p5SuX0Z3Sv0WnQx+rZH77EN6FPCbv8Xn+D4ff06VKHaXXOkiFdK+6pTQ1VmFVPH/ablbWODhhcja/O3Xn3d/zTIyM+oQ= + - provider: pypi + distributions: "bdist_wheel" + user: __token__ + skip_existing: true + server: https://test.pypi.org/legacy/ + on: + condition: $OS = osx-64 + password: + secure: o63EC+U+EtdAgUSV3plrLfZ7QZ6Aflp0quV5jJQxD9w47Ds5i4k5GjEHogV8x8l5NGwxbXPKp/1eKEfYgFH/i+WUnj1n9reiYZBd0lkr2Ih9nExNEIrziMhPbqjDEYAB672bjkXseS6mF44boqDUEP3jyDaamLB+aR75RCMM1j6aha/54Ko88ZJKXBW5FuNSraBGzgvjVG0P63jG5epS85hX09dEcKNR0XO0kbiGfNnYIp78QBohO0Pdv99x2ryp/QaoWD4m7cMUOts2xIcI2KCJNMhZNdIS8C0TVvk2tgumb+G2px7PsOxA8yZgxLefs+A14IAjg6uKe/jmwrihN1V6R6FF3WCcxM6kdzt9bpr+QKBoXjkF8BdxVbgmdnxkr+Ah5WIxmw2boQoW/SIMy9GVPrgtkSvocN6NwOExsO4pagiOwTLIvjIe+/0+OJt/Pud+mwF/94HD+B7j/XxsK7QehLCd9v5NTrdNgpS/TiWOyCDP1DLnpl1V9/vZ56x9NSQhN4Wr6hRrTxjWNAYLxsMxZf6uR+WWg1TqyicVlGrSf0to2asNIPWTTeGq3tB0/7WNslRQzP7QD67p5SuX0Z3Sv0WnQx+rZH77EN6FPCbv8Xn+D4ff06VKHaXXOkiFdK+6pTQ1VmFVPH/ablbWODhhcja/O3Xn3d/zTIyM+oQ= From 2af533bc9e22615905342ec2d4c1993585db0c4b Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Fri, 6 Dec 2019 12:25:41 +0100 Subject: [PATCH 055/168] [devel] version number update --- tofu/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tofu/version.py b/tofu/version.py index ab0e46b95..577989cce 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.2-a5' +__version__ = '1.4.2-a5-10-ge0d44f3' From 072d1632f4bb66869031067e573f9445e8a6310e Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Fri, 6 Dec 2019 16:07:39 +0100 Subject: [PATCH 056/168] [Issue202] Added magnetic axis to plot => investigate rhotn transform ? --- tofu/geom/_core_optics.py | 59 +++++++++++++++++++++++++++++++++------ tofu/geom/_plot_optics.py | 11 ++++---- tofu/version.py | 2 +- 3 files changed, 58 insertions(+), 14 deletions(-) diff --git a/tofu/geom/_core_optics.py b/tofu/geom/_core_optics.py index 687ebe515..9e81ce040 100644 --- a/tofu/geom/_core_optics.py +++ b/tofu/geom/_core_optics.py @@ -1079,6 +1079,32 @@ def calc_phibragg_from_xixj(self, xi, xj, n=None, braggunits='deg', angunits='deg', **kwdargs) return bragg, phi + def calc_phibragg_from_pts(self, pts, n=None): + """ Return the bragg angle and phi of pts from crystal summit + + The pts are provided as a (x, y, z) coordinates array + The bragg angle and phi are computed from the crystal's summit + + """ + # Check / format inputs + pts = np.asarray(pts) + assert pts.ndim in [1, 2] + assert 3 in pts.shape + if pts.ndim == 1: + pts = pts[:, None] + if pts.shape[0] != 3: + pts = pts.T + + # Compute + vect = pts - self._dgeom['summit'][:, None] + vect = vect / np.sqrt(np.sum(vect**2, axis=0)) + bragg = np.pi/2 - np.arccos(np.sum(vect*self._dgeom['nin'][:, None], axis=0)) + v1 = np.sum(vect*self._dgeom['e1'][:, None], axis=0) + v2 = np.sum(vect*self._dgeom['e2'][:, None], axis=0) + phi = np.arctan2(v2, v1) + return bragg, phi + + def plot_johannerror(self, lamb=None): raise NotImplementedError @@ -1086,7 +1112,7 @@ def plot_data_vs_lambphi(self, xi=None, xj=None, data=None, mask=None, det_cent=None, det_ei=None, det_ej=None, theta=None, psi=None, n=None, nlambfit=None, nphifit=None, - phiref=None, magaxis=None, + magaxis=None, npaxis=None, plot=True, fs=None, cmap=None, vmin=None, vmax=None): # Check / format inputs @@ -1120,15 +1146,32 @@ def plot_data_vs_lambphi(self, xi=None, xj=None, data=None, mask=None, vertsum1d = np.array([np.nanmean(data[ind==ii]) for ii in np.unique(ind)]) # Get phiref from mag axis - if phiref is None and magaxis is not None: - phiref = None + lambax, phiax = None, None + if magaxis is not None: + if npaxis is None: + npaxis = 1000 + thetacryst = np.arctan2(self._dgeom['summit'][1], + self._dgeom['summit'][0]) + thetaax = thetacryst + np.pi/2*np.linspace(-1, 1, npaxis) + pts = np.array([magaxis[0]*np.cos(thetaax), + magaxis[0]*np.sin(thetaax), + np.full((npaxis,), magaxis[1])]) + braggax, phiax = self.calc_phibragg_from_pts(pts) + lambax = self.get_lamb_from_bragg(braggax) + phiax = np.arctan2(np.sin(phiax-np.pi), np.cos(phiax-np.pi)) + ind = ((lambax >= lambfit[0]) & (lambax <= lambfit[-1]) + & (phiax >= phifit[0]) & (phiax <= phifit[-1])) + lambax, phiax = lambax[ind], phiax[ind] + ind = np.argsort(lambax) + lambax, phiax = lambax[ind], phiax[ind] # plot - ax = _plot_optics.CrystalBragg_plot_data_vs_lambphi( - xi, xj, bragg, lamb, phi, data, - lambfit=lambfit, phifit=phifit, spect1d=spect1d, - vertsum1d=vertsum1d, phiref=phiref, - cmap=cmap, vmin=vmin, vmax=vmax, fs=fs) + if plot: + ax = _plot_optics.CrystalBragg_plot_data_vs_lambphi( + xi, xj, bragg, lamb, phi, data, + lambfit=lambfit, phifit=phifit, spect1d=spect1d, + vertsum1d=vertsum1d, lambax=lambax, phiax=phiax, + cmap=cmap, vmin=vmin, vmax=vmax, fs=fs) return ax def plot_data_fit2d(self, xi=None, xj=None, data=None, mask=None, diff --git a/tofu/geom/_plot_optics.py b/tofu/geom/_plot_optics.py index 69c28e047..e9e0faef2 100644 --- a/tofu/geom/_plot_optics.py +++ b/tofu/geom/_plot_optics.py @@ -383,7 +383,7 @@ def CrystalBragg_plot_braggangle_from_xixj(xi=None, xj=None, def CrystalBragg_plot_data_vs_lambphi(xi, xj, bragg, lamb, phi, data, lambfit=None, phifit=None, spect1d=None, vertsum1d=None, - phiref=None, + lambax=None, phiax=None, cmap=None, vmin=None, vmax=None, fs=None, dmargin=None, angunits='deg'): @@ -404,8 +404,9 @@ def CrystalBragg_plot_data_vs_lambphi(xi, xj, bragg, lamb, phi, data, bragg = bragg*180./np.pi phi = phi*180./np.pi phifit = phifit*180./np.pi - if phiref is not None: - phiref = 180*phiref/np.pi + if phiax is not None: + phiax = 180*phiax/np.pi + # pre-compute @@ -447,8 +448,8 @@ def CrystalBragg_plot_data_vs_lambphi(xi, xj, bragg, lamb, phi, data, cmap=cmap, vmin=vmin, vmax=vmax) axs2.plot(lambfit, spect1d, c='k', ls='-') ax3.plot(vertsum1d, phifit, c='k', ls='-') - if phiref is not None: - ax3.axhline(phiref, c='k', ls='--') + if phiax is not None: + ax2.plot(lambax, phiax, c='r', ls='-', lw=1.) ax2.set_xlim(extent2[0], extent2[1]) ax2.set_ylim(extent2[2], extent2[3]) diff --git a/tofu/version.py b/tofu/version.py index 3c77326e5..d75255f8a 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.2-a5-15-gc472511' +__version__ = '1.4.2-a5-16-g7b9be6c' From 16d7c7952b7bfdf61e2ad83d62e16609d39785e5 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Fri, 6 Dec 2019 16:27:46 +0100 Subject: [PATCH 057/168] [Issue202] MultiIDSLoader.add_ids() now working with already gotten ids handles (e.g.: multi.add_ids(bolo, isget=True)) --- tofu/imas2tofu/_core.py | 4 ++-- tofu/version.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tofu/imas2tofu/_core.py b/tofu/imas2tofu/_core.py index 39ee55ce1..879a617c6 100644 --- a/tofu/imas2tofu/_core.py +++ b/tofu/imas2tofu/_core.py @@ -1331,9 +1331,9 @@ def _checkformat_ids(self, ids, occ=None, idd=None, isget=None): isgeti = np.zeros((nocc,), dtype=bool) if dids[lids[ii]]['ids'] is not None: if isget is None: - isgeti = False + isgeti = np.r_[False] elif type(isget) is bool: - isgeti = bool(isget) + isgeti = np.r_[bool(isget)] elif hasattr(isget,'__iter__'): if len(isget) == nids: isgeti = np.r_[isget[ii]] diff --git a/tofu/version.py b/tofu/version.py index 577989cce..65c2a2a8a 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.2-a5-10-ge0d44f3' +__version__ = '1.4.2-a5-11-g2af533b' From 1874b9153ec9945f0bc6732e7d8132a1b519cb72 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Fri, 6 Dec 2019 18:17:11 +0100 Subject: [PATCH 058/168] [Issue202] Implementing add_ids_for_synthdiag() --- tofu/imas2tofu/_core.py | 72 ++++++++++++++++++++++++++++++++++++++--- tofu/version.py | 2 +- 2 files changed, 69 insertions(+), 5 deletions(-) diff --git a/tofu/imas2tofu/_core.py b/tofu/imas2tofu/_core.py index 39ee55ce1..74dafb0a3 100644 --- a/tofu/imas2tofu/_core.py +++ b/tofu/imas2tofu/_core.py @@ -1268,6 +1268,52 @@ def get_idd(self, idd=None): assert idd in self._didd.keys() return self._didd[idd]['idd'] + def get_inputs_for_synthsignal(self, ids=None, verb=True, returnas=False): + """ Return and / or print a dict of the default inputs for desired ids + + Synthetic signal for a given diagnostic ids is computed from + signal that comes from other ids (e.g. core_profiles, equilibrium...) + For some diagnostics, the inputs required are already tabulated in + self._didsdiag[]['synth'] + + This method simply shows this already tabulated information + Advanced users may edit this hidden dictionnary to their needs + + """ + + if ids is None: + if len(self._dids) == 1: + ids = list(self._dids.keys())[0] + else: + msg = "Please provide a valid ids!" + raise Exception(msg) + + # Eliminate trivial case + if (ids not in self._didsdiag.keys() or 'synth' not in + self._didsdiag[ids].keys()): + msg = ("Necessary inputs for synthetic signal not tabulated for:\n" + + "\t- {}".format(str(ids))) + if verb: + print(msg) + if returnas is True: + return msg + + # Deal with real case + out = self._didsdiag[ids]['synth'] + lids = sorted(out.get('dsig', {}).keys()) + if verb: + dmsg = ("\n\t-" + + "\n\t-".join([kk+':\n\t\t'+'\n\t\t'.join(vv) + for kk, vv in out.get('dsig', {}).items()])) + extra = {kk: vv for kk, vv in out.items() + if kk not in ['dsynth', 'dsig']} + msg = ("For computing synthetic signal for ids {}".format(ids) + + dmsg + '\n' + + "\t- Extra parametersi (if any):\n" + + "\t\t{}\n".format(extra)) + print(msg) + if returnas is True: + return out def _checkformat_ids(self, ids, occ=None, idd=None, isget=None): @@ -1323,7 +1369,6 @@ def _checkformat_ids(self, ids, occ=None, idd=None, isget=None): if dids[lids[ii]]['ids'] is not None: dids[lids[ii]]['ids'] = [dids[lids[ii]]['ids']]*nocc - # Format isget / get for ii in range(0,nids): nocc = dids[lids[ii]]['nocc'] @@ -1347,8 +1392,6 @@ def _checkformat_ids(self, ids, occ=None, idd=None, isget=None): return dids - - def add_ids(self, ids=None, occ=None, idd=None, preset=None, shot=None, run=None, refshot=None, refrun=None, user=None, tokamak=None, version=None, @@ -1395,7 +1438,6 @@ def add_ids(self, ids=None, occ=None, idd=None, preset=None, assert idd in self._didd.keys() # Add ids - if ids is not None: dids = self._checkformat_ids(ids, occ=occ, idd=idd, isget=isget) @@ -1403,6 +1445,28 @@ def add_ids(self, ids=None, occ=None, idd=None, preset=None, if get: self.open_get_close(ids=ids) + def add_ids_for_synthdiag(self, ids=None, occ=None, idd=None, preset=None, + shot=None, run=None, refshot=None, refrun=None, + user=None, tokamak=None, version=None, + ref=None, isget=None, get=None): + """ Add pre-tabulated input ids necessary for calculating synth. signal + + The necessary input ids are given by self.get_inputs_for_synthsignal() + + """ + lc = [ids is None, isinstance(ids, str), isinstance(ids, list)] + assert any(lc) + lidssynth = [kk for kk, vv in self._didsdiag.items() + if 'synth' in vv.keys()] + + if lc[0]: + ids = list(set(self._dids.keys()).) + elif lc[1]: + ids = [ids] + lids = [] + for idsi in ids: + pass + def remove_ids(self, ids=None, occ=None): """ Remove an ids (optionally remove only an occurence) diff --git a/tofu/version.py b/tofu/version.py index 577989cce..65c2a2a8a 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.2-a5-10-ge0d44f3' +__version__ = '1.4.2-a5-11-g2af533b' From bbc8b8e21f992f9b79e33c333a7203c663f6a24c Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Mon, 9 Dec 2019 13:34:02 +0100 Subject: [PATCH 059/168] [Issue318] MultiIDSLoader.add_ids_synthdiag() operational, with _checkformat_ids_synthdiag() and get_inputs_for_synthdiag() --- tofu/imas2tofu/_core.py | 128 +++++++++++++++++++++++++--------------- tofu/version.py | 2 +- 2 files changed, 82 insertions(+), 48 deletions(-) diff --git a/tofu/imas2tofu/_core.py b/tofu/imas2tofu/_core.py index 74dafb0a3..cdd0dd484 100644 --- a/tofu/imas2tofu/_core.py +++ b/tofu/imas2tofu/_core.py @@ -1268,6 +1268,38 @@ def get_idd(self, idd=None): assert idd in self._didd.keys() return self._didd[idd]['idd'] + def _checkformat_ids_synthdiag(self, ids=None): + lc = [ids is None, isinstance(ids, str), isinstance(ids, list), + hasattr(ids, 'ids_properties')] + if not any(lc): + msg = ("Provided ids not understood!\n" + + "\t- provided: {}".format(str(ids))) + raise Exception(msg) + + lidssynth = [kk for kk, vv in self._didsdiag.items() + if 'synth' in vv.keys()] + if lc[0]: + ids = sorted(set(self._dids.keys()).intersection(lidssynth)) + elif lc[1]: + ids = [ids] + elif lc[3]: + ids = [ids.__class__.__name__] + + ids = sorted( + set(ids).intersection(lidssynth).intersection(self._dids.keys())) + if len(ids) == 0: + msg = ("The provided ids must be:\n" + + "\t- an is name (str)\n" + + "\t- a list of ids names\n" + + "\t- an ids instance\n" + + "\t- None\n" + + "And it must:\n" + + "\t- Already be added (cf. self.dids.keys())\n" + + "\t- Be a diagnostic ids with tabulated 'synth'") + # Turn to warning? => see user feedback + raise Exception(msg) + return ids + def get_inputs_for_synthsignal(self, ids=None, verb=True, returnas=False): """ Return and / or print a dict of the default inputs for desired ids @@ -1280,47 +1312,48 @@ def get_inputs_for_synthsignal(self, ids=None, verb=True, returnas=False): Advanced users may edit this hidden dictionnary to their needs """ + assert returnas in [False, True, dict, list] + ids = self._checkformat_ids_synthdiag(ids) - if ids is None: - if len(self._dids) == 1: - ids = list(self._dids.keys())[0] - else: - msg = "Please provide a valid ids!" - raise Exception(msg) - - # Eliminate trivial case - if (ids not in self._didsdiag.keys() or 'synth' not in - self._didsdiag[ids].keys()): - msg = ("Necessary inputs for synthetic signal not tabulated for:\n" - + "\t- {}".format(str(ids))) + # Deal with real case + if len(ids) == 1: + out = self._didsdiag[ids[0]]['synth'] + lids = sorted(out.get('dsig', {}).keys()) if verb: + dmsg = ("\n\t-" + + "\n\t-".join([kk+':\n\t\t'+'\n\t\t'.join(vv) + for kk, vv in out.get('dsig', {}).items()])) + extra = {kk: vv for kk, vv in out.items() + if kk not in ['dsynth', 'dsig']} + msg = ("For computing synthetic signal for ids {}".format(ids) + + dmsg + '\n' + + "\t- Extra parameters (if any):\n" + + "\t\t{}\n".format(extra)) print(msg) if returnas is True: - return msg - - # Deal with real case - out = self._didsdiag[ids]['synth'] - lids = sorted(out.get('dsig', {}).keys()) - if verb: - dmsg = ("\n\t-" + - "\n\t-".join([kk+':\n\t\t'+'\n\t\t'.join(vv) - for kk, vv in out.get('dsig', {}).items()])) - extra = {kk: vv for kk, vv in out.items() - if kk not in ['dsynth', 'dsig']} - msg = ("For computing synthetic signal for ids {}".format(ids) - + dmsg + '\n' - + "\t- Extra parametersi (if any):\n" - + "\t\t{}\n".format(extra)) - print(msg) - if returnas is True: + returnas = dict + else: + out = None + lids = sorted(set(itt.chain.from_iterable([ + self._didsdiag[idsi]['synth'].get('dsig', {}).keys() + for idsi in ids]))) + if verb: + print(lids) + if returnas is True: + returnas = list + if returnas is dict: return out + elif returnas is list: + return lids - def _checkformat_ids(self, ids, occ=None, idd=None, isget=None): + def _checkformat_ids(self, ids, occ=None, idd=None, isget=None, + synthdiag=False): # Check value and make dict if necessary lc = [type(ids) is str, type(ids) is list, - hasattr(ids, 'ids_properties')] + hasattr(ids, 'ids_properties'), + ids is None and synthdiag is True] if not any(lc): msg = "Arg ids must be either:\n" msg += " - str : valid ids name\n" @@ -1330,9 +1363,15 @@ def _checkformat_ids(self, ids, occ=None, idd=None, isget=None): msg += " Conditions: %s"%str(lc) raise Exception(msg) + # Synthdiag-specific + if synthdiag is True: + ids = self.get_inputs_for_synthsignal(ids=ids, verb=False, + returnas=list) + lc[1] = True + # Prepare dids[name] = {'ids':None/ids, 'needidd':bool} dids = {} - if lc[0]or lc[1]: + if lc[0] or lc[1]: if lc[0]: ids = [ids] for ids_ in ids: @@ -1443,9 +1482,9 @@ def add_ids(self, ids=None, occ=None, idd=None, preset=None, self._dids.update(dids) if get: - self.open_get_close(ids=ids) + self.open_get_close() - def add_ids_for_synthdiag(self, ids=None, occ=None, idd=None, preset=None, + def add_ids_for_synthdiag(self, ids=None, occ=None, idd=None, shot=None, run=None, refshot=None, refrun=None, user=None, tokamak=None, version=None, ref=None, isget=None, get=None): @@ -1454,19 +1493,14 @@ def add_ids_for_synthdiag(self, ids=None, occ=None, idd=None, preset=None, The necessary input ids are given by self.get_inputs_for_synthsignal() """ - lc = [ids is None, isinstance(ids, str), isinstance(ids, list)] - assert any(lc) - lidssynth = [kk for kk, vv in self._didsdiag.items() - if 'synth' in vv.keys()] - - if lc[0]: - ids = list(set(self._dids.keys()).) - elif lc[1]: - ids = [ids] - lids = [] - for idsi in ids: - pass - + if get is None: + get = True + ids = self.get_inputs_for_synthsignal(ids=ids, verb=False, + returnas=list) + self.add_ids(ids=ids, occ=occ, idd=idd, preset=None, + shot=shot, run=run, refshot=refshot, refrun=refrun, + user=user, tokamak=tokamak, version=version, + ref=ref, isget=isget, get=get) def remove_ids(self, ids=None, occ=None): """ Remove an ids (optionally remove only an occurence) diff --git a/tofu/version.py b/tofu/version.py index 65c2a2a8a..d56adb720 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.2-a5-11-g2af533b' +__version__ = '1.4.2-a5-12-g1874b91' From de4bc6741c2b3e3824cbd746b133df5faa3f3cf1 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Mon, 9 Dec 2019 13:44:57 +0100 Subject: [PATCH 060/168] [Issue318] ids_base=None and synthdiag=None now available from instanciation (True and False by default), add_ids_base() operational --- tofu/imas2tofu/_core.py | 27 +++++++++++++++++++++++++-- tofu/version.py | 2 +- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/tofu/imas2tofu/_core.py b/tofu/imas2tofu/_core.py index cdd0dd484..4c3bf7618 100644 --- a/tofu/imas2tofu/_core.py +++ b/tofu/imas2tofu/_core.py @@ -614,7 +614,7 @@ def _rhosign(rho, theta): 'core_profiles':['t','Te','ne']} } - + _IDS_BASE = ['wall', 'pulse_schedule'] ################################### @@ -625,7 +625,8 @@ def _rhosign(rho, theta): def __init__(self, preset=None, dids=None, ids=None, occ=None, idd=None, shot=None, run=None, refshot=None, refrun=None, - user=None, tokamak=None, version=None, get=None, ref=True): + user=None, tokamak=None, version=None, + ids_base=None, synthdiag=None, get=None, ref=True): super(MultiIDSLoader, self).__init__() # Initialize dicts @@ -642,6 +643,14 @@ def __init__(self, preset=None, dids=None, ids=None, occ=None, idd=None, self.add_ids(preset=preset, ids=ids, occ=occ, idd=idd, get=False) if get is None and (ids is not None or preset is not None): get = True + if ids_base is None: + ids_base = True + if ids_base is True: + self.add_ids_base(get=False) + if synthdiag is None: + synthdiag = False + if synthdiag is True: + self.add_ids_synthdiag(get=False) else: self.set_dids(dids) if get is None: @@ -1484,6 +1493,20 @@ def add_ids(self, ids=None, occ=None, idd=None, preset=None, if get: self.open_get_close() + def add_ids_base(self, occ=None, idd=None, + shot=None, run=None, refshot=None, refrun=None, + user=None, tokamak=None, version=None, + ref=None, isget=None, get=None): + """ Add th list of ids stored in self._IDS_BASE + + Typically used to add a list of common ids without having to re-type + them every time + """ + self.add_ids(ids=self._IDS_BASE, occ=occ, idd=idd, + shot=shot, run=run, refshot=refshot, refrun=refrun, + user=user, tokamak=tokamak, version=version, + ref=ref, isget=isget, get=get) + def add_ids_for_synthdiag(self, ids=None, occ=None, idd=None, shot=None, run=None, refshot=None, refrun=None, user=None, tokamak=None, version=None, diff --git a/tofu/version.py b/tofu/version.py index d56adb720..332000a59 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.2-a5-12-g1874b91' +__version__ = '1.4.2-a5-13-gbbc8b8e' From 231dacd2ca04f7e272a6c069da71380e66855015 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Mon, 9 Dec 2019 14:36:41 +0100 Subject: [PATCH 061/168] [Issue318] MultiIDSLoader.get_events() operational (verb=True/False, returnas=False/list/tuple) --- tofu/imas2tofu/_core.py | 50 ++++++++++++++++++++++++++++++++++------- tofu/version.py | 2 +- 2 files changed, 43 insertions(+), 9 deletions(-) diff --git a/tofu/imas2tofu/_core.py b/tofu/imas2tofu/_core.py index 4c3bf7618..e20dea41a 100644 --- a/tofu/imas2tofu/_core.py +++ b/tofu/imas2tofu/_core.py @@ -641,8 +641,6 @@ def __init__(self, preset=None, dids=None, ids=None, occ=None, idd=None, assert len(lidd) <= 1 idd = lidd[0] if len(lidd) > 0 else None self.add_ids(preset=preset, ids=ids, occ=occ, idd=idd, get=False) - if get is None and (ids is not None or preset is not None): - get = True if ids_base is None: ids_base = True if ids_base is True: @@ -651,12 +649,14 @@ def __init__(self, preset=None, dids=None, ids=None, occ=None, idd=None, synthdiag = False if synthdiag is True: self.add_ids_synthdiag(get=False) + if get is None and (len(self._dids) > 0 or preset is not None): + get = True else: self.set_dids(dids) if get is None: get = True self._set_fsig() - if get: + if get is True: self.open_get_close() def _init_dict(self): @@ -1650,11 +1650,12 @@ def __repr__(self): #--------------------- def _checkformat_getdata_ids(self, ids): - msg = "Arg ids must be either:\n" - msg += " - None: if self.dids only has one key\n" - msg += " - str: a valid key of self.dids\n\n" - msg += " Provided : %s\n"%ids - msg += " Available: %s"%str(list(self._dids.keys())) + msg = ("Arg ids must be either:\n" + + "\t- None: if self.dids only has one key\n" + + "\t- str: a valid key of self.dids\n\n" + + " Provided : %s\n"%ids + + " Available: %s\n"%str(list(self._dids.keys())) + + " => Consider using self.add_ids({})".format(str(ids))) lc = [ids is None, type(ids) is str] if not any(lc): @@ -2094,6 +2095,39 @@ def get_data_all(self, dsig=None, stack=True, return dout + def get_events(self, occ=None, verb=True, returnas=False): + """ Return chronoligical events stored in pulse_schedule + + If verb = True => print (default) + False => don't print + If returnas = list => return as list of tuples (name, time) + np.ndarray => return as np.ndarray + False => don't return (default) + """ + + # Check / format inputs + if verb is None: + verb = True + if returnas is None: + returnas = False + assert isinstance(verb, bool) + assert returnas in [False, list, tuple] + + events = self.get_data('pulse_schedule', sig='events', occ=occ)['events'] + name, time = zip(*events) + ind = np.argsort(time) + if verb: + name, time = zip(*events[ind]) + msg = np.array([name, time], dtype='U').T + msg = np.char.ljust(msg, np.nanmax(np.char.str_len(msg))) + print(msg) + if returnas is list: + return events[ind].tolist() + elif returnas is tuple: + name, time = zip(*events[ind]) + return name, time + + #--------------------- # Methods for exporting to tofu objects diff --git a/tofu/version.py b/tofu/version.py index 332000a59..90db6eae1 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.2-a5-13-gbbc8b8e' +__version__ = '1.4.2-a5-14-gde4bc67' From c8c408776f0fb950eb6c3cfc4e81ee54dc2d6363 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Mon, 9 Dec 2019 15:20:48 +0100 Subject: [PATCH 062/168] [Issue318] PEP8 Compliance --- tofu/imas2tofu/_core.py | 15 ++++++++------- tofu/version.py | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/tofu/imas2tofu/_core.py b/tofu/imas2tofu/_core.py index e20dea41a..4615d0180 100644 --- a/tofu/imas2tofu/_core.py +++ b/tofu/imas2tofu/_core.py @@ -1330,8 +1330,9 @@ def get_inputs_for_synthsignal(self, ids=None, verb=True, returnas=False): lids = sorted(out.get('dsig', {}).keys()) if verb: dmsg = ("\n\t-" + - "\n\t-".join([kk+':\n\t\t'+'\n\t\t'.join(vv) - for kk, vv in out.get('dsig', {}).items()])) + "\n\t-".join([ + kk+':\n\t\t'+'\n\t\t'.join(vv) + for kk, vv in out.get('dsig', {}).items()])) extra = {kk: vv for kk, vv in out.items() if kk not in ['dsynth', 'dsig']} msg = ("For computing synthetic signal for ids {}".format(ids) @@ -1340,7 +1341,7 @@ def get_inputs_for_synthsignal(self, ids=None, verb=True, returnas=False): + "\t\t{}\n".format(extra)) print(msg) if returnas is True: - returnas = dict + returnas = dict else: out = None lids = sorted(set(itt.chain.from_iterable([ @@ -1653,8 +1654,8 @@ def _checkformat_getdata_ids(self, ids): msg = ("Arg ids must be either:\n" + "\t- None: if self.dids only has one key\n" + "\t- str: a valid key of self.dids\n\n" - + " Provided : %s\n"%ids - + " Available: %s\n"%str(list(self._dids.keys())) + + " Provided : {}\n".format(ids) + + " Available: {}\n".format(str(list(self._dids.keys()))) + " => Consider using self.add_ids({})".format(str(ids))) lc = [ids is None, type(ids) is str] @@ -2094,7 +2095,6 @@ def get_data_all(self, dsig=None, stack=True, warnings.warn(msg) return dout - def get_events(self, occ=None, verb=True, returnas=False): """ Return chronoligical events stored in pulse_schedule @@ -2113,7 +2113,8 @@ def get_events(self, occ=None, verb=True, returnas=False): assert isinstance(verb, bool) assert returnas in [False, list, tuple] - events = self.get_data('pulse_schedule', sig='events', occ=occ)['events'] + events = self.get_data('pulse_schedule', + sig='events', occ=occ)['events'] name, time = zip(*events) ind = np.argsort(time) if verb: diff --git a/tofu/version.py b/tofu/version.py index 90db6eae1..52ca3f491 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.2-a5-14-gde4bc67' +__version__ = '1.4.2-a5-15-g231dacd' From b6ed4fc9adb224bc55a4870f2a985b7399eb865c Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Mon, 9 Dec 2019 18:13:51 +0100 Subject: [PATCH 063/168] [Issue202] CrystBragg.calc_johannerror() operational with plot, but Detector not tangential to Rowland circle ! needs to be fixed in _get_detect_approx() --- tofu/geom/_comp_optics.py | 14 +++++++-- tofu/geom/_core_optics.py | 63 +++++++++++++++++++++++++++++++++++-- tofu/geom/_plot_optics.py | 65 +++++++++++++++++++++++++++++++++++++++ tofu/version.py | 2 +- 4 files changed, 137 insertions(+), 7 deletions(-) diff --git a/tofu/geom/_comp_optics.py b/tofu/geom/_comp_optics.py index 4a81743cb..4a8b0d956 100644 --- a/tofu/geom/_comp_optics.py +++ b/tofu/geom/_comp_optics.py @@ -106,14 +106,22 @@ def get_lamb_from_bragg(bragg, d, n=None): # Approximate solution # ############################################### -def get_approx_detector_rel(rcurve, bragg): +def get_approx_detector_rel(rcurve, bragg, tangent_to_rowland=None): + + if tangent_to_rowland is None: + tangent_to_rowland = True # distance crystal - det_center det_dist = rcurve*np.sin(bragg) # det_nout and det_e1 in (nout, e1, e2) (det_e2 = e2) - det_nout_rel = np.r_[np.sin(bragg), -np.cos(bragg), 0.] - det_ei_rel = np.r_[np.cos(bragg), np.sin(bragg), 0] + if tangent_to_rowland: + # TBF !!!!!!!!!!!!!!! + det_nout_rel = p.r_[np.sin(bragg)] + det_ei_rel = None + else: + det_nout_rel = np.r_[np.sin(bragg), -np.cos(bragg), 0.] + det_ei_rel = np.r_[np.cos(bragg), np.sin(bragg), 0] return det_dist, det_nout_rel, det_ei_rel def get_det_abs_from_rel(det_dist, det_nout_rel, det_ei_rel, diff --git a/tofu/geom/_core_optics.py b/tofu/geom/_core_optics.py index 9e81ce040..e5ab9da08 100644 --- a/tofu/geom/_core_optics.py +++ b/tofu/geom/_core_optics.py @@ -874,7 +874,8 @@ def get_lamb_from_bragg(self, bragg, n=None): def get_detector_approx(self, bragg=None, lamb=None, rcurve=None, n=None, ddist=None, di=None, dj=None, - dtheta=None, dpsi=None, tilt=None, plot=False): + dtheta=None, dpsi=None, tilt=None, + tangent_to_rowland=None, plot=False): """ Return approximate ideal detector geometry Assumes infinitesimal and ideal crystal @@ -1105,8 +1106,64 @@ def calc_phibragg_from_pts(self, pts, n=None): return bragg, phi - def plot_johannerror(self, lamb=None): - raise NotImplementedError + def calc_johannerror(self, xi=None, xj=None, err=None, + det_cent=None, det_ei=None, det_ej=None, n=None, + lpsi=None, ltheta=None, + plot=True, fs=None, cmap=None, vmin=None, vmax=None): + """ Plot the johann error + + The johann error is the error (scattering) induced by defocalization + due to finite crystal dimensions + There is a johann error on wavelength (lamb => loss of spectral + resolution) and on directionality (phi) + If provided, lpsi and ltheta are taken as normalized variations with + respect to the crystal summit and to its extenthalf. + Typical values are: + - lpsi = [-1, 1, 1, -1] + - ltheta = [-1, -1, 1, 1] + They must have the same len() + + """ + + + # Check / format inputs + xi, xj, (xii, xjj) = self._checkformat_xixj(xi, xj) + nxi = xi.size if xi is not None else np.unique(xii).size + nxj = xj.size if xj is not None else np.unique(xjj).size + + # Compute lamb / phi + bragg, phi = self.calc_phibragg_from_xixj( + xii, xjj, n=n, + det_cent=det_cent, det_ei=det_ei, det_ej=det_ej, + theta=None, psi=None, plot=False) + assert bragg.shape == phi.shape + lamb = self.get_lamb_from_bragg(bragg, n=n) + + if lpsi is None: + lpsi = self._dgeom['extenthalf'][0]*np.r_[-1., 1., 1., -1.] + else: + lpsi = self._dgeom['extenthalf'][0]*np.r_[lpsi] + if ltheta is None: + ltheta = np.pi/2 + self._dgeom['extenthalf'][1]*np.r_[-1., -1., 1., 1.] + else: + ltheta = np.pi/2 + self._dgeom['extenthalf'][1]*np.r_[ltheta] + npsi = lpsi.size + assert npsi == ltheta.size + lamberr = np.full(tuple(np.r_[npsi, lamb.shape]), np.nan) + phierr = np.full(lamberr.shape, np.nan) + for ii in range(len(ltheta)): + bragg, phierr[ii, ...] = self.calc_phibragg_from_xixj( + xii, xjj, n=n, + det_cent=det_cent, det_ei=det_ei, det_ej=det_ej, + theta=ltheta[ii], psi=lpsi[ii], plot=False) + lamberr[ii, ...] = self.get_lamb_from_bragg(bragg, n=n) + err_lamb = np.nanmax(np.abs(lamb[None, ...] - lamberr), axis=0) + err_phi = np.nanmax(np.abs(phi[None, ...] - phierr), axis=0) + if plot is True: + ax = _plot_optics.CrystalBragg_plot_johannerror( + xi, xj, lamb, phi, err_lamb, err_phi, err=err, + cmap=cmap, vmin=vmin, vmax=vmax, fs=fs) + return err_lamb, err_phi def plot_data_vs_lambphi(self, xi=None, xj=None, data=None, mask=None, det_cent=None, det_ei=None, det_ej=None, diff --git a/tofu/geom/_plot_optics.py b/tofu/geom/_plot_optics.py index e9e0faef2..ba97a89bb 100644 --- a/tofu/geom/_plot_optics.py +++ b/tofu/geom/_plot_optics.py @@ -380,6 +380,71 @@ def CrystalBragg_plot_braggangle_from_xixj(xi=None, xj=None, return ax +def CrystalBragg_plot_johannerror(xi, xj, lamb, phi, err_lamb, err_phi, + cmap=None, vmin=None, vmax=None, + fs=None, dmargin=None, + angunits='deg', err=None): + + # Check inputs + # ------------ + + if fs is None: + fs = (14, 8) + if cmap is None: + cmap = plt.cm.viridis + if dmargin is None: + dmargin = {'left':0.03, 'right':0.99, + 'bottom':0.05, 'top':0.92, + 'wspace':None, 'hspace':0.4} + assert angunits in ['deg', 'rad'] + if angunits == 'deg': + # bragg = bragg*180./np.pi + phi = phi*180./np.pi + err_phi = err_phi*180./np.pi + + if err is None: + err = 'abs' + if err == 'rel': + err_lamb = 100.*err_lamb / (np.nanmax(lamb) - np.nanmin(lamb)) + err_phi = 100.*err_phi / (np.nanmax(phi) - np.nanmin(phi)) + + + # pre-compute + # ------------ + + # extent + extent = (xi.min(), xi.max(), xj.min(), xj.max()) + + # Plot + # ------------ + + fig = fig = plt.figure(figsize=fs) + gs = gridspec.GridSpec(1, 3, **dmargin) + ax0 = fig.add_subplot(gs[0, 0], aspect='equal', adjustable='datalim') + ax1 = fig.add_subplot(gs[0, 1], aspect='equal', adjustable='datalim', + sharex=ax0, sharey=ax0) + ax2 = fig.add_subplot(gs[0, 2], aspect='equal', adjustable='datalim', + sharex=ax0, sharey=ax0) + + ax0.set_title('Iso-lamb and iso-phi at crystal summit') + ax1.set_title('Focalization error on lamb') + ax2.set_title('Focalization error on phi') + + ax0.contour(xi, xj, lamb, 10, cmap=cmap) + ax0.contour(xi, xj, phi, 10, cmap=cmap, ls='--') + imlamb = ax1.imshow(err_lamb, extent=extent, aspect='equal', + origin='lower', interpolation='nearest', + vmin=vmin, vmax=vmax) + imphi = ax2.imshow(err_phi, extent=extent, aspect='equal', + origin='lower', interpolation='nearest', + vmin=vmin, vmax=vmax) + + plt.colorbar(imlamb, ax=ax1) + plt.colorbar(imphi, ax=ax2) + + return [ax0, ax1, ax2] + + def CrystalBragg_plot_data_vs_lambphi(xi, xj, bragg, lamb, phi, data, lambfit=None, phifit=None, spect1d=None, vertsum1d=None, diff --git a/tofu/version.py b/tofu/version.py index d75255f8a..913c1a02b 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.2-a5-16-g7b9be6c' +__version__ = '1.4.2-a5-17-g072d163' From 9ce7828cdeebde6c63fee480613a090301339469 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 9 Dec 2019 22:40:45 +0100 Subject: [PATCH 064/168] [Issue202] Fixed tanget_to_rowland, and more informative exception messages --- tofu/geom/_comp_optics.py | 21 ++++++++++++--------- tofu/geom/_core_optics.py | 29 +++++++++++++++++++++-------- 2 files changed, 33 insertions(+), 17 deletions(-) diff --git a/tofu/geom/_comp_optics.py b/tofu/geom/_comp_optics.py index 4a8b0d956..fa88405dc 100644 --- a/tofu/geom/_comp_optics.py +++ b/tofu/geom/_comp_optics.py @@ -115,16 +115,17 @@ def get_approx_detector_rel(rcurve, bragg, tangent_to_rowland=None): det_dist = rcurve*np.sin(bragg) # det_nout and det_e1 in (nout, e1, e2) (det_e2 = e2) + n_crystdet_rel = np.r_[-np.sin(bragg), np.cos(bragg), 0.] if tangent_to_rowland: - # TBF !!!!!!!!!!!!!!! - det_nout_rel = p.r_[np.sin(bragg)] - det_ei_rel = None + bragg2 = 2.*bragg + det_nout_rel = np.r_[-np.cos(bragg2), -np.sin(bragg2), 0.] + det_ei_rel = np.r_[np.sin(bragg2), -np.cos(bragg2), 0.] else: - det_nout_rel = np.r_[np.sin(bragg), -np.cos(bragg), 0.] + det_nout_rel = -n_crystdet_rel det_ei_rel = np.r_[np.cos(bragg), np.sin(bragg), 0] - return det_dist, det_nout_rel, det_ei_rel + return det_dist, n_crystdet_rel, det_nout_rel, det_ei_rel -def get_det_abs_from_rel(det_dist, det_nout_rel, det_ei_rel, +def get_det_abs_from_rel(det_dist, n_crystdet_rel, det_nout_rel, det_ei_rel, summit, nout, e1, e2, ddist=None, di=None, dj=None, dtheta=None, dpsi=None, tilt=None): @@ -143,9 +144,12 @@ def get_det_abs_from_rel(det_dist, det_nout_rel, det_ei_rel, if dj is None: dj = 0. det_dist += ddist - det_cent = summit - det_dist*det_nout + di*det_ei + dj*det_ej - # Apply angles on unit vectors + n_crystdet = (n_crystdet_rel[0]*nout + + n_crystdet_rel[1]*e1 + n_crystdet_rel[2]*e2) + det_cent = summit + det_dist*n_crystdet + di*det_ei + dj*det_ej + + # Apply angles on unit vectors with respect to themselves if dtheta is None: dtheta = 0. if dpsi is None: @@ -164,7 +168,6 @@ def get_det_abs_from_rel(det_dist, det_nout_rel, det_ei_rel, det_ei3 = np.cos(tilt)*det_ei2 + np.sin(tilt)*det_ej2 det_ej3 = np.cross(det_nout2, det_ei3) - return det_cent, det_nout2, det_ei3, det_ej3 diff --git a/tofu/geom/_core_optics.py b/tofu/geom/_core_optics.py index e5ab9da08..8a48cd824 100644 --- a/tofu/geom/_core_optics.py +++ b/tofu/geom/_core_optics.py @@ -292,17 +292,17 @@ def _checkformat_dmat(cls, dmat=None): assert all([ss in lkok for ss in dmat.keys()]) for kk in cls._ddef['dmat'].keys(): dmat[kk] = dmat.get(kk, cls._ddef['dmat'][kk]) - if dmat['d'] is not None: + if dmat.get('d') is not None: dmat['d'] = float(dmat['d']) - if dmat['formula'] is not None: + if dmat.get('formula') is not None: assert isinstance(dmat['formula'], str) - if dmat['density'] is not None: + if dmat.get('density') is not None: dmat['density'] = float(dmat['density']) - if dmat['lengths'] is not None: + if dmat.get('lengths') is not None: dmat['lengths'] = np.atleast_1d(dmat['lengths']).ravel() - if dmat['angles'] is not None: + if dmat.get('angles') is not None: dmat['angles'] = np.atleast_1d(dmat['angles']).ravel() - if dmat['cut'] is not None: + if dmat.get('cut') is not None: dmat['cut'] = np.atleast_1d(dmat['cut']).ravel().astype(int) assert dmat['cut'].size <= 4 return dmat @@ -906,14 +906,27 @@ def get_detector_approx(self, bragg=None, lamb=None, if rcurve is None: rcurve = self._dgeom['rcurve'] bragg = self._checkformat_bragglamb(bragg=bragg, lamb=lamb, n=n) + if np.all(np.isnan(bragg)): + msg = ("There is no available bragg angle!\n" + + " => Check the vlue of self.dmat['d'] vs lamb") + raise Exception(msg) + + lf = ['summit', 'nout', 'e1', 'e2'] + lc = [rcurve is None] + [self._dgeom[kk] is None for kk in lf] + if any(lc): + msg = ("Some missing fields in dgeom for computation:" + + "\n\t-" + "\n\t-".join(['rcurve'] + lf)) + raise Exception(msg) # Compute crystal-centered parameters in (nout, e1, e2) func = _comp_optics.get_approx_detector_rel - det_dist, det_nout_rel, det_ei_rel = func(rcurve, bragg) + (det_dist, n_crystdet_rel, + det_nout_rel, det_ei_rel) = _comp_optics.get_approx_detector_rel( + rcurve, bragg, tangent_to_rowland=tangent_to_rowland) # Deduce absolute position in (x, y, z) det_cent, det_nout, det_ei, det_ej = _comp_optics.get_det_abs_from_rel( - det_dist, det_nout_rel, det_ei_rel, + det_dist, n_crystdet_rel, det_nout_rel, det_ei_rel, self._dgeom['summit'], self._dgeom['nout'], self._dgeom['e1'], self._dgeom['e2'], ddist=ddist, di=di, dj=dj, From 063c16509e7368a50b6c5d84b48372b8397b9f56 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Tue, 10 Dec 2019 08:42:23 +0100 Subject: [PATCH 065/168] [Issue202] Plotted images for ITER PDR, implemented tit / wintit in CrystalBragg_plot_johannerror() --- tofu/geom/_core_optics.py | 13 +++++++++---- tofu/geom/_plot_optics.py | 23 ++++++++++++++++++----- tofu/version.py | 2 +- 3 files changed, 28 insertions(+), 10 deletions(-) diff --git a/tofu/geom/_core_optics.py b/tofu/geom/_core_optics.py index 8a48cd824..7000268f4 100644 --- a/tofu/geom/_core_optics.py +++ b/tofu/geom/_core_optics.py @@ -1122,7 +1122,8 @@ def calc_phibragg_from_pts(self, pts, n=None): def calc_johannerror(self, xi=None, xj=None, err=None, det_cent=None, det_ei=None, det_ej=None, n=None, lpsi=None, ltheta=None, - plot=True, fs=None, cmap=None, vmin=None, vmax=None): + plot=True, fs=None, cmap=None, + vmin=None, vmax=None, tit=None, wintit=None): """ Plot the johann error The johann error is the error (scattering) induced by defocalization @@ -1153,11 +1154,15 @@ def calc_johannerror(self, xi=None, xj=None, err=None, lamb = self.get_lamb_from_bragg(bragg, n=n) if lpsi is None: - lpsi = self._dgeom['extenthalf'][0]*np.r_[-1., 1., 1., -1.] + lpsi = self._dgeom['extenthalf'][0]*np.r_[-1., 0., 1., 1., + 1., 0., -1, -1] else: lpsi = self._dgeom['extenthalf'][0]*np.r_[lpsi] if ltheta is None: - ltheta = np.pi/2 + self._dgeom['extenthalf'][1]*np.r_[-1., -1., 1., 1.] + ltheta = np.pi/2 + self._dgeom['extenthalf'][1]*np.r_[-1., -1., + -1., 0., + 1., 1., + 1., 0.] else: ltheta = np.pi/2 + self._dgeom['extenthalf'][1]*np.r_[ltheta] npsi = lpsi.size @@ -1175,7 +1180,7 @@ def calc_johannerror(self, xi=None, xj=None, err=None, if plot is True: ax = _plot_optics.CrystalBragg_plot_johannerror( xi, xj, lamb, phi, err_lamb, err_phi, err=err, - cmap=cmap, vmin=vmin, vmax=vmax, fs=fs) + cmap=cmap, vmin=vmin, vmax=vmax, fs=fs, tit=tit, wintit=wintit) return err_lamb, err_phi def plot_data_vs_lambphi(self, xi=None, xj=None, data=None, mask=None, diff --git a/tofu/geom/_plot_optics.py b/tofu/geom/_plot_optics.py index ba97a89bb..936eb8966 100644 --- a/tofu/geom/_plot_optics.py +++ b/tofu/geom/_plot_optics.py @@ -382,7 +382,7 @@ def CrystalBragg_plot_braggangle_from_xixj(xi=None, xj=None, def CrystalBragg_plot_johannerror(xi, xj, lamb, phi, err_lamb, err_phi, cmap=None, vmin=None, vmax=None, - fs=None, dmargin=None, + fs=None, dmargin=None, wintit=None, tit=None, angunits='deg', err=None): # Check inputs @@ -393,8 +393,8 @@ def CrystalBragg_plot_johannerror(xi, xj, lamb, phi, err_lamb, err_phi, if cmap is None: cmap = plt.cm.viridis if dmargin is None: - dmargin = {'left':0.03, 'right':0.99, - 'bottom':0.05, 'top':0.92, + dmargin = {'left':0.05, 'right':0.99, + 'bottom':0.06, 'top':0.92, 'wspace':None, 'hspace':0.4} assert angunits in ['deg', 'rad'] if angunits == 'deg': @@ -407,7 +407,16 @@ def CrystalBragg_plot_johannerror(xi, xj, lamb, phi, err_lamb, err_phi, if err == 'rel': err_lamb = 100.*err_lamb / (np.nanmax(lamb) - np.nanmin(lamb)) err_phi = 100.*err_phi / (np.nanmax(phi) - np.nanmin(phi)) + err_lamb_units = '%' + err_phi_units = '%' + else: + err_lamb_units = 'm' + err_phi_units = angunits + if wintit is None: + wintit = _WINTIT + if tit is None: + tit = False # pre-compute # ------------ @@ -427,8 +436,8 @@ def CrystalBragg_plot_johannerror(xi, xj, lamb, phi, err_lamb, err_phi, sharex=ax0, sharey=ax0) ax0.set_title('Iso-lamb and iso-phi at crystal summit') - ax1.set_title('Focalization error on lamb') - ax2.set_title('Focalization error on phi') + ax1.set_title('Focalization error on lamb ({})'.format(err_lamb_units)) + ax2.set_title('Focalization error on phi ({})'.format(err_phi_units)) ax0.contour(xi, xj, lamb, 10, cmap=cmap) ax0.contour(xi, xj, phi, 10, cmap=cmap, ls='--') @@ -441,6 +450,10 @@ def CrystalBragg_plot_johannerror(xi, xj, lamb, phi, err_lamb, err_phi, plt.colorbar(imlamb, ax=ax1) plt.colorbar(imphi, ax=ax2) + if wintit is not False: + fig.canvas.set_window_title(wintit) + if tit is not False: + fig.suptitle(tit, size=14, weight='bold') return [ax0, ax1, ax2] diff --git a/tofu/version.py b/tofu/version.py index 913c1a02b..4d5b0289a 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.2-a5-17-g072d163' +__version__ = '1.4.2-a5-19-g9ce7828' From ebe97e311b2f660b2a48f2e7f8e6077ca12aed5d Mon Sep 17 00:00:00 2001 From: root Date: Wed, 11 Dec 2019 00:25:33 +0100 Subject: [PATCH 066/168] [Issue202] Added rockingcurve to dbragg and plot_rockingcurve() to be finished --- tofu/geom/_core_optics.py | 24 +++++++++++++++++++++++- tofu/geom/_plot_optics.py | 27 +++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/tofu/geom/_core_optics.py b/tofu/geom/_core_optics.py index 7000268f4..aca8c62bd 100644 --- a/tofu/geom/_core_optics.py +++ b/tofu/geom/_core_optics.py @@ -312,12 +312,19 @@ def _checkformat_dbragg(cls, dbragg=None): if dbragg is None: return assert isinstance(dbragg, dict) - lkok = ['angle'] + lkok = cls._get_keys_dbragg() assert all([isinstance(ss, str) for ss in dbragg.keys()]) assert all([ss in lkok for ss in dbragg.keys()]) for kk in cls._ddef['dbragg'].keys(): dbragg[kk] = dbragg.get(kk, cls._ddef['dbragg'][kk]) + if dbragg.get('rockingcurve') is not None: + assert isinstance(dbragg['rockingcurve'], dict) + drock = dbragg['rockingcurve'] + if drock.get('sigma') is not None: + dbragg['rockingcurve']['sigma'] = float(drock['sigma']) + dbragg['rockingcurve']['deltad'] = float(drock.get('deltad', 0.)) + dbragg['rockingcurve']['Rmax'] = float(drock.get('Rmax', 1.)) return dbragg @classmethod @@ -570,6 +577,13 @@ def summit(self): def center(self): return self._dgeom['center'] + @property + def rockingcurve(self): + if self._bragg.get('rockingcurve') is not None: + if self._dbragg['rocingcurve'].get('sigma') is not None: + return self._dbragg['rockingcurve'] + raise Exception("rockingcurve was not set!") + # ----------------- # methods for color # ----------------- @@ -692,6 +706,14 @@ def move(self, kind=None, **kwdargs): if kind == 'rotate': self._rotate(**kwdargs) + # ----------------- + # methods for rocking curve + # ----------------- + + def plot_rockingcurve(self): + drock = self.rockingcurve + return _plot.CrystalBragg_plot_rockingcurve(drock) + # ----------------- # methods for surface and contour sampling # ----------------- diff --git a/tofu/geom/_plot_optics.py b/tofu/geom/_plot_optics.py index 936eb8966..96d56da00 100644 --- a/tofu/geom/_plot_optics.py +++ b/tofu/geom/_plot_optics.py @@ -285,6 +285,33 @@ def _CrystalBragg_plot_crosshor(cryst, proj=None, dax=None, return dax +# ################################################################# +# ################################################################# +# Rocking curve plot +# ################################################################# +# ################################################################# + +def CrystalBragg_plot_rockingcurve(Rmax=None, sigma=None, + bragg=None, delta_bragg=None, npts=None): + + # Prepare + def func(angle, d=d, deltad=drock['deltad'], + Rmax=drock['Rmax'], sigma=drock['sigma']): + return Rmax*((sigma**2/(((angle - (bragg+delta_bragg))**2 + sigma**2)/(sigma*np.pi)) + + if npts is None: + npts = 1000 + angle = bragg + delta_bragg + 3.*sigma*np.linspace(-1, 1, npts) + curve = func(angle) + + # Plot + fig = plt.figure() + ax = fig.add_axes([0.1, 0.1, 0.8, 0.8]) + ax.plot(angle, curve, ls='-', lw=1., c='k') + ax.axvline(bragg, ls='--', lw=1, c='k') + return ax + + # ################################################################# # ################################################################# # Bragg diffraction plot From fb0ea5e63d59d8d14a90be31e522592db22ae155 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 11 Dec 2019 11:43:13 +0100 Subject: [PATCH 067/168] [Issue202] Added get_rockingcurve_func(), TODO: add possibility of tabulated rocking curve --- tofu/geom/_core_optics.py | 20 ++++++++++++++++++-- tofu/geom/_plot_optics.py | 9 +++------ 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/tofu/geom/_core_optics.py b/tofu/geom/_core_optics.py index aca8c62bd..1de24b890 100644 --- a/tofu/geom/_core_optics.py +++ b/tofu/geom/_core_optics.py @@ -710,9 +710,25 @@ def move(self, kind=None, **kwdargs): # methods for rocking curve # ----------------- - def plot_rockingcurve(self): + def get_rockingcurve_func(self, lamb=None, bragg=None, n=None): drock = self.rockingcurve - return _plot.CrystalBragg_plot_rockingcurve(drock) + bragg = self._checkformat_bragglamb(bragg=bragg, lamb=lamb, n=n) + delta_bragg = self. - bragg + def func(angle, d=d, delta_bragg=delta_bragg, + Rmax=drock['Rmax'], sigma=drock['sigma']): + core = (sigma**2/(((angle - (bragg+delta_bragg))**2 + sigma**2) + if Rmax is None: + return core/(sigma*np.pi) + else: + return Rmax*core + return func + + def plot_rockingcurve(self, lamb=None, bragg=None, + fs=None, ax=None): + drock = self.rockingcurve + bragg = self._checkformat_bragglamb(bragg=bragg, lamb=lamb, n=n) + func = self.get_rockingcurve_func(bragg=bragg, n=n) + return _plot.CrystalBragg_plot_rockingcurve(func, fs=fs, ax=ax) # ----------------- # methods for surface and contour sampling diff --git a/tofu/geom/_plot_optics.py b/tofu/geom/_plot_optics.py index 96d56da00..4f7942530 100644 --- a/tofu/geom/_plot_optics.py +++ b/tofu/geom/_plot_optics.py @@ -295,18 +295,15 @@ def CrystalBragg_plot_rockingcurve(Rmax=None, sigma=None, bragg=None, delta_bragg=None, npts=None): # Prepare - def func(angle, d=d, deltad=drock['deltad'], - Rmax=drock['Rmax'], sigma=drock['sigma']): - return Rmax*((sigma**2/(((angle - (bragg+delta_bragg))**2 + sigma**2)/(sigma*np.pi)) - if npts is None: npts = 1000 angle = bragg + delta_bragg + 3.*sigma*np.linspace(-1, 1, npts) curve = func(angle) # Plot - fig = plt.figure() - ax = fig.add_axes([0.1, 0.1, 0.8, 0.8]) + if ax is None: + fig = plt.figure() + ax = fig.add_axes([0.1, 0.1, 0.8, 0.8]) ax.plot(angle, curve, ls='-', lw=1., c='k') ax.axvline(bragg, ls='--', lw=1, c='k') return ax From 5fe6eee411cb8148c9aeabb665ec53bba85499d9 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Wed, 11 Dec 2019 18:16:36 +0100 Subject: [PATCH 068/168] [Issue202] Rocking curve more elaborate, now allows for tabulated data, with source, consider lamb-dependent tab? saved in cryst --- tofu/geom/_core_optics.py | 45 ++++++++++++++++++++++++++++----------- tofu/version.py | 2 +- 2 files changed, 34 insertions(+), 13 deletions(-) diff --git a/tofu/geom/_core_optics.py b/tofu/geom/_core_optics.py index 1de24b890..e3cca59af 100644 --- a/tofu/geom/_core_optics.py +++ b/tofu/geom/_core_optics.py @@ -321,10 +321,31 @@ def _checkformat_dbragg(cls, dbragg=None): if dbragg.get('rockingcurve') is not None: assert isinstance(dbragg['rockingcurve'], dict) drock = dbragg['rockingcurve'] - if drock.get('sigma') is not None: - dbragg['rockingcurve']['sigma'] = float(drock['sigma']) - dbragg['rockingcurve']['deltad'] = float(drock.get('deltad', 0.)) - dbragg['rockingcurve']['Rmax'] = float(drock.get('Rmax', 1.)) + try: + if drock.get('sigma') is not None: + dbragg['rockingcurve']['sigma'] = float(drock['sigma']) + dbragg['rockingcurve']['deltad'] = float(drock.get('deltad', 0.)) + dbragg['rockingcurve']['Rmax'] = float(drock.get('Rmax', 1.)) + dbragg['rockingcurve']['type'] = 'lorentz-log' + elif drock.get('angle') is not None: + dbragg['rockingcurve']['angle'] = np.r_[drock['angle']] + dbragg['rockingcurve']['value'] = np.r_[drock['value']] + dbragg['rockingcurve']['type'] = 'tabulated' + if drock.get('source') is None: + msg = "Unknonw source for the tabulated rocking curve!" + warnings.warn(msg) + dbragg['rockingcurve']['source'] = drock.get('source') + except Exception as err: + msg = ("Provide the rocking curve as a dict with either:\n" + + "\t- parameters of a lorentzian in log10:\n" + + "\t\t{'sigma': float,\n" + + "\t\t 'deltad': float,\n" + + "\t\t 'Rmax': float}\n" + + "\t- tabulated (angle, value), with source (url...)" + + "\t\t{'angle': np.ndarray,\n" + + "\t\t 'value': np.ndarray,\n" + + "\t\t 'source': str}") + raise Exception(msg) return dbragg @classmethod @@ -411,7 +432,7 @@ def set_dmat(self, dmat=None): dmat = self._checkformat_dmat(dmat) self._dmat = dmat - def _set_dbragg(self, dbragg=None): + def set_dbragg(self, dbragg=None): dbragg = self._checkformat_dbragg(dbragg) self._dbragg = dbragg @@ -713,14 +734,14 @@ def move(self, kind=None, **kwdargs): def get_rockingcurve_func(self, lamb=None, bragg=None, n=None): drock = self.rockingcurve bragg = self._checkformat_bragglamb(bragg=bragg, lamb=lamb, n=n) - delta_bragg = self. - bragg + delta_bragg = None def func(angle, d=d, delta_bragg=delta_bragg, - Rmax=drock['Rmax'], sigma=drock['sigma']): - core = (sigma**2/(((angle - (bragg+delta_bragg))**2 + sigma**2) - if Rmax is None: - return core/(sigma*np.pi) - else: - return Rmax*core + Rmax=drock['Rmax'], sigma=drock['sigma']): + core = sigma**2/((angle - (bragg+delta_bragg))**2 + sigma**2) + if Rmax is None: + return core/(sigma*np.pi) + else: + return Rmax*core return func def plot_rockingcurve(self, lamb=None, bragg=None, diff --git a/tofu/version.py b/tofu/version.py index 4d5b0289a..bb5bab542 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.2-a5-19-g9ce7828' +__version__ = '1.4.2-a5-22-gfb0ea5e' From dfd201172de369d53ca2feee2bd84b879e6ebb30 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Wed, 11 Dec 2019 18:18:32 +0100 Subject: [PATCH 069/168] [Issue202] Added input files for tests and develeping, to be deleted before PR --- ...CS_ArXVII_sh00000_Vers1.4.1-174-g453d6a3.npz | Bin 0 -> 46371 bytes tofu/version.py | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 TFG_CrystalBragg_ExpWEST_DgXICS_ArXVII_sh00000_Vers1.4.1-174-g453d6a3.npz diff --git a/TFG_CrystalBragg_ExpWEST_DgXICS_ArXVII_sh00000_Vers1.4.1-174-g453d6a3.npz b/TFG_CrystalBragg_ExpWEST_DgXICS_ArXVII_sh00000_Vers1.4.1-174-g453d6a3.npz new file mode 100644 index 0000000000000000000000000000000000000000..57f982f97fe1d656264c0b41a0b2edee6d81ec98 GIT binary patch literal 46371 zcmdsg30zF?_kWWLAtA{gA!}MhX*o~3O36~T_JyQPO{>aOvPYz3NsH|J*2jk^M0O$) zvTxbfEQSB`%yiAYw`o3ozCN%1^}AljZSKr@&pFRI=h>e#cGk_L6eI*!FNyai_r@&2 zF9^wD@|^A!;HNerBG60CKQJQM*51Z$GDjj*Vz#QMSFlHr>PTf(eS0m{!OE)B0)n_f zZvHL-L7raZxw)Hfuor$F?ClolgBndwy z)De?V?tl=k?+kx&;ty*m@q@5nUYI;EaWOGfxZ|=)E)72=B#%j;LU4$m-wbZug+EQF zU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aR0_e9Xq^9uui%0#qy(EmauP maN8GSss0Cvm`lxmOMat>ltx;H6zdB7@1`pLEv`iJ>i+>miO?bd literal 0 HcmV?d00001 diff --git a/tofu/version.py b/tofu/version.py index bb5bab542..eb4b78d2f 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.2-a5-22-gfb0ea5e' +__version__ = '1.4.2-a5-23-g5fe6eee' From 7d3011e7a2ff9e036663a0b9c5090258198c24bc Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Thu, 12 Dec 2019 10:53:15 +0100 Subject: [PATCH 070/168] [Issue202] CrystBragg.get_summary() now displays rocking curve type --- tofu/geom/_core_optics.py | 11 ++++++++--- tofu/version.py | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/tofu/geom/_core_optics.py b/tofu/geom/_core_optics.py index e3cca59af..5d3f985b7 100644 --- a/tofu/geom/_core_optics.py +++ b/tofu/geom/_core_optics.py @@ -600,8 +600,8 @@ def center(self): @property def rockingcurve(self): - if self._bragg.get('rockingcurve') is not None: - if self._dbragg['rocingcurve'].get('sigma') is not None: + if self._dbragg.get('rockingcurve') is not None: + if self._dbragg['rockingcurve'].get('type') is not None: return self._dbragg['rockingcurve'] raise Exception("rockingcurve was not set!") @@ -626,11 +626,16 @@ def get_summary(self, sep=' ', line='-', just='l', # ----------------------- # Build material col0 = ['formula', 'symmetry', 'cut', 'density', - 'd (A)', 'bragg(%s A) (deg)'%str(self._DEFLAMB)] + 'd (A)', 'bragg(%s A) (deg)'%str(self._DEFLAMB), 'rocking curve'] ar0 = [self._dmat['formula'], self._dmat['symmetry'], str(self._dmat['cut']), str(self._dmat['density']), '{0:5.3f}'.format(self._dmat['d']*1.e10), str(self.get_bragg_from_lamb(self._DEFLAMB)[0]*180./np.pi)] + try: + ar0.append(self.rockingcurve['type']) + except Exception as err: + ar0.append('None') + # ----------------------- # Build geometry diff --git a/tofu/version.py b/tofu/version.py index d8838e0cb..5dedecfc4 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.2-a5-24-gdfd2011' +__version__ = '1.4.2-a5-35-gebc5fa7' From f44434fc3ef58b311befc347c3c227f9c0db7b2f Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Thu, 12 Dec 2019 18:16:49 +0100 Subject: [PATCH 071/168] [Issue202] Both tabulated-1d and 2d rocking curves possible, finish plotting routines and get 2d data for Quartz crystal --- ..._ArXVII_sh00000_Vers1.4.1-174-g453d6a3.npz | Bin 46371 -> 47307 bytes tofu/geom/_core_optics.py | 81 ++++++++++++++---- tofu/version.py | 2 +- 3 files changed, 67 insertions(+), 16 deletions(-) diff --git a/TFG_CrystalBragg_ExpWEST_DgXICS_ArXVII_sh00000_Vers1.4.1-174-g453d6a3.npz b/TFG_CrystalBragg_ExpWEST_DgXICS_ArXVII_sh00000_Vers1.4.1-174-g453d6a3.npz index 57f982f97fe1d656264c0b41a0b2edee6d81ec98..1620a6b6c4e939677de17363b5d1e0f1304fd571 100644 GIT binary patch delta 5509 zcmZWt2|Scr*ym8f7-QcCGnT=a88fBL@;;O$T#^>rgs5!UiWE&HD%@^4$QB79#Yn1q ztG9hG?WLqrQrx7XP1N^}d+YnU-~0Rhf6sHy`~08fob#Ody;ISHuDnB%(F~Oh<#{$^ zRAgkNFv4uU&ZyAf= zXo)X6ROW&p(|6LP^)(3G1ozq&)8rsC=&q()tQ@!#2^N-j~@c&~pG)0_BnA|@aVy1}~ zWf=G?0FN_VF#MMSypk)fdtx*ODmx~Tr#6g%Z8un)%C0fsRZmXJ@Kl5=N4@Qq)hoi8 z@WF+i>Pm22r+PgvQ3|YTe{?SzlB@>9vv?T1W@EqQkbGC+RTc9vX1o zOcerqBWKiXR)vgxA(t~>t3tnJbMOR92K0%u5-jF1V3(h2tZp^~Y!77aQzRK6R178u z`xwyC*7?`pY&B>fd-Up~nQE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0xqr5rsL;&T<_)@B#Vjn+y#B{L#y*{C%Y4-q|C8!@LrjHH`z zTso1_4Qxb{;j0Zo+BMlvrtnC)1>RLlM|;!o;zkjgpRQnM=VlsiZDb?e41z@R)U7k9 zSl*zDdNZ&?lMq#A;?yP)irkEMX6xdIO>D%@!oFLXitwPBjwoBOZ?h+A-+~9Wkrcgd zqTw6F$kuH9s9A)TZN+A%M95*AV#U=v7z)%zjZU1RBjxS*%qdUQy&aD|Ek(z3@XcLJ h9DABgjom>2Jn=M3U0G!`PxcW%_sl31`< 0: + msg = ("Unauthorized keys in dbrag['rockingcurve']:\n" + + "\t-" + "\n\t-".join(lkout)) + raise Exception(msg) try: if drock.get('sigma') is not None: dbragg['rockingcurve']['sigma'] = float(drock['sigma']) dbragg['rockingcurve']['deltad'] = float(drock.get('deltad', 0.)) dbragg['rockingcurve']['Rmax'] = float(drock.get('Rmax', 1.)) dbragg['rockingcurve']['type'] = 'lorentz-log' - elif drock.get('angle') is not None: - dbragg['rockingcurve']['angle'] = np.r_[drock['angle']] - dbragg['rockingcurve']['value'] = np.r_[drock['value']] - dbragg['rockingcurve']['type'] = 'tabulated' + elif drock.get('dangle') is not None: + c2d = (drock.get('lamb') is not None + and drock.get('value').ndim == 2) + if c2d: + if drock['value'].shape != (drock['dangle'].size, + drock['lamb'].size): + msg = ("Tabulated 2d rocking curve should be:\n" + + "\tshape = (dangle.size, lamb.size)") + raise Exception(msg) + dbragg['rockingcurve']['dangle'] = np.r_[drock['dangle']] + dbragg['rockingcurve']['lamb'] = np.r_[drock['lamb']] + dbragg['rockingcurve']['value'] = drock['value'] + dbragg['rockingcurve']['type'] = 'tabulated-2d' + else: + if drock.get('lamb') is None: + msg = ("Please also specify the lamb for which the " + + "rocking curve was tabulated!") + raise Exception(msg) + dbragg['rockingcurve']['lamb'] = float(drock['lamb']) + dbragg['rockingcurve']['dangle'] = np.r_[drock['dangle']] + dbragg['rockingcurve']['value'] = np.r_[drock['value']] + dbragg['rockingcurve']['type'] = 'tabulated-1d' if drock.get('source') is None: msg = "Unknonw source for the tabulated rocking curve!" warnings.warn(msg) @@ -341,8 +367,8 @@ def _checkformat_dbragg(cls, dbragg=None): + "\t\t{'sigma': float,\n" + "\t\t 'deltad': float,\n" + "\t\t 'Rmax': float}\n" - + "\t- tabulated (angle, value), with source (url...)" - + "\t\t{'angle': np.ndarray,\n" + + "\t- tabulated (dangle, value), with source (url...)" + + "\t\t{'dangle': np.ndarray,\n" + "\t\t 'value': np.ndarray,\n" + "\t\t 'source': str}") raise Exception(msg) @@ -738,15 +764,40 @@ def move(self, kind=None, **kwdargs): def get_rockingcurve_func(self, lamb=None, bragg=None, n=None): drock = self.rockingcurve - bragg = self._checkformat_bragglamb(bragg=bragg, lamb=lamb, n=n) - delta_bragg = None - def func(angle, d=d, delta_bragg=delta_bragg, - Rmax=drock['Rmax'], sigma=drock['sigma']): - core = sigma**2/((angle - (bragg+delta_bragg))**2 + sigma**2) - if Rmax is None: - return core/(sigma*np.pi) - else: - return Rmax*core + if drock['type'] == 'tabulated-1d': + if lamb is not None and lamb != drock['lamb']: + msg = ("rocking curve was tabulated only for:\n" + + "\tlamb = {} m\n".format(lamb) + + " => Please let lamb=None") + raise Exception(msg) + bragg = self._checkformat_bragglamb(lamb=drock['lamb'], n=n) + func = scpinterp.interp1d(drock['dangle']+bragg, drock['value'], + kind='linear', bounds_error=False, + fill_value=0, assume_sorted=True) + + elif drock['type'] == 'tabulated-2d': + bragg = self._checkformat_bragglamb(bragg=bragg, lamb=lamb, n=n) + lamb = self.get_lamb_from_bragg(bragg) + lmin, lmax = drock['lamb'].min(), drock['lamb'].max() + if lamb is None or lamb < lmin or lamb > lmax: + msg = ("rocking curve was tabulated only in interval:\n" + + "\tlamb in [{}; {}] m\n".format(lmin, lmax) + + " => Please set lamb accordingly") + raise Exception(msg) + bragg = self._checkformat_bragglamb(lamb=lamb, n=n) + def func(angle, lamb=lamb, bragg=bragg, drock=drock): + return scpinterp.interp2d(drock['dangle']+bragg, drock['lamb'], + drock['value'], kind='linear', + bounds_error=False, fill_value=0, + assume_sorted=True)(angle, lamb) + else: + def func(angle, d=d, delta_bragg=delta_bragg, + Rmax=drock['Rmax'], sigma=drock['sigma']): + core = sigma**2/((angle - (bragg+delta_bragg))**2 + sigma**2) + if Rmax is None: + return core/(sigma*np.pi) + else: + return Rmax*core return func def plot_rockingcurve(self, lamb=None, bragg=None, diff --git a/tofu/version.py b/tofu/version.py index 5dedecfc4..e6a5a9db5 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.2-a5-35-gebc5fa7' +__version__ = '1.4.2-a5-36-g7d3011e' From b2beda9c6fa19a29cadbfbf8353184c73729d8f5 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Fri, 13 Dec 2019 17:45:20 +0100 Subject: [PATCH 072/168] [Issue202] Johann error now also visible with plot_line_tracing() for a single lambda, and computation from plasma points started with calc_psidthetaphi_from_pts_lamb() --- tofu/geom/_comp_optics.py | 52 +++++++++- tofu/geom/_core_optics.py | 199 +++++++++++++++++++++++++++++++++++--- tofu/geom/_plot_optics.py | 53 ++++++++++ tofu/version.py | 2 +- 4 files changed, 288 insertions(+), 18 deletions(-) diff --git a/tofu/geom/_comp_optics.py b/tofu/geom/_comp_optics.py index fa88405dc..4c1d2200d 100644 --- a/tofu/geom/_comp_optics.py +++ b/tofu/geom/_comp_optics.py @@ -146,7 +146,7 @@ def get_det_abs_from_rel(det_dist, n_crystdet_rel, det_nout_rel, det_ei_rel, det_dist += ddist n_crystdet = (n_crystdet_rel[0]*nout - + n_crystdet_rel[1]*e1 + n_crystdet_rel[2]*e2) + + n_crystdet_rel[1]*e1 + n_crystdet_rel[2]*e2) det_cent = summit + det_dist*n_crystdet + di*det_ei + dj*det_ej # Apply angles on unit vectors with respect to themselves @@ -244,3 +244,53 @@ def get_lambphifit(lamb, phi, nxi, nxj): phiD = phi.max() - phi.min() phifit = phi.min() + phiD*np.linspace(0, 1, nxj) return lambfit, phifit + + +# ############################################### +# From plasma pts +# ############################################### + +def calc_psidthetaphi_from_pts_lamb(pts, bragg, , nlamb, npts, ntheta): + + scaPCem = np.full((nlamb, npts), np.nan) + psi = np.full((nlamb, npts, ntheta), np.nan) + dtheta = np.full((nlamb, npts, ntheta), np.nan) + phi = np.full((nlamb, npts, ntheta), np.nan) + + # Get to scalar product + PC = C[:, None] - pts + PCnorm2 = np.sum(PC**2, axis=0)**2 + cos2 = np.cos(bragg)**2 + deltaon4 = (*R**2*cos2[:, None]**2 + - *(R**2*cos2[:, None] + - PCnorm2[None, :]*np.sin(bragg)[:, None]**2)) + + # Get two relevant solutions + ind = deltaon4 >= 0. + PCnorm = np.tile(np.sqrt(PCnorm2), (nlamb, 1))[ind] + sol1 = -R*cos2 - np.sqrt(deltaon4[ind]) + sol2 = -R*cos2 + np.sqrt(deltaon4[ind]) + ind1 = (np.abs(sol1) <= PCnorm) & (sol1 >= -R) + ind2 = (np.abs(sol2) <= PCnorm) & (sol2 >= -R) + assert not np.any(ind1 & ind2) + sol1 = sol1[ind1] + sol2 = sol2[ind2] + indn = ind.nonzero() + ind1 = [indn[0][ind1], indn[1][ind1]] + ind2 = [indn[0][ind2], indn[1][ind2]] + scaPCem[ind1[0], ind1[1]] = sol1 + scaPCem[ind2[0], ind2[1]] = sol2 + ind = ~np.isnan(scaPCem) + + # Get equation on PCem + X = np.sum(PC*nout[:, None], axis=0) + Y = np.sum(PC*e1[:, None], axis=0) + Z = np.sum(PC*e2[:, None], axis=0) + XYnorm = np.sqrt(X**2 + Y**2) + psi = (np.arccos(XYnorm * (scaPCem[ind] - Z*np.sin(dtheta))/np.cos(dtheta)) + + np.arctan2(Y, X)) + psi = np.arctan2(np.sin(psi), np.cos(psi)) + + dtheta = extenthalf[1]*np.linspace(-1, 1, ntheta) + + return dtheta, psi, phi diff --git a/tofu/geom/_core_optics.py b/tofu/geom/_core_optics.py index 49fb960d8..4d39664e4 100644 --- a/tofu/geom/_core_optics.py +++ b/tofu/geom/_core_optics.py @@ -762,7 +762,7 @@ def move(self, kind=None, **kwdargs): # methods for rocking curve # ----------------- - def get_rockingcurve_func(self, lamb=None, bragg=None, n=None): + def get_rockingcurve_func(self, lamb=None, n=None): drock = self.rockingcurve if drock['type'] == 'tabulated-1d': if lamb is not None and lamb != drock['lamb']: @@ -776,8 +776,6 @@ def get_rockingcurve_func(self, lamb=None, bragg=None, n=None): fill_value=0, assume_sorted=True) elif drock['type'] == 'tabulated-2d': - bragg = self._checkformat_bragglamb(bragg=bragg, lamb=lamb, n=n) - lamb = self.get_lamb_from_bragg(bragg) lmin, lmax = drock['lamb'].min(), drock['lamb'].max() if lamb is None or lamb < lmin or lamb > lmax: msg = ("rocking curve was tabulated only in interval:\n" @@ -800,10 +798,9 @@ def func(angle, d=d, delta_bragg=delta_bragg, return Rmax*core return func - def plot_rockingcurve(self, lamb=None, bragg=None, + def plot_rockingcurve(self, lamb=None, fs=None, ax=None): drock = self.rockingcurve - bragg = self._checkformat_bragglamb(bragg=bragg, lamb=lamb, n=n) func = self.get_rockingcurve_func(bragg=bragg, n=n) return _plot.CrystalBragg_plot_rockingcurve(func, fs=fs, ax=ax) @@ -1233,6 +1230,83 @@ def calc_phibragg_from_pts(self, pts, n=None): phi = np.arctan2(v2, v1) return bragg, phi + def plot_line_tracing_on_det(self, lamb=None, n=None, + xi_bounds=None, xj_bounds=None, nphi=None, + det_cent=None, det_nout=None, + det_ei=None, det_ej=None, + johann=False, lpsi=None, ltheta=None, + rocking=False, fs=None, dmargin=None, + wintit=None, tit=None): + """ Visualize the de-focusing by ray-tracing of chosen lamb + """ + # Check / format inputs + if lamb is None: + lamb = self._DEFLAMB + lamb = np.atleast_1d(lamb).ravel() + nlamb = lamb.size + + det = np.array([[xi_bounds[0], xi_bounds[1], xi_bounds[1], + xi_bounds[0], xi_bounds[0]], + [xj_bounds[0], xj_bounds[0], xj_bounds[1], + xj_bounds[1], xj_bounds[0]]]) + + # Compute lamb / phi + _, phi = self.calc_phibragg_from_xixj( + det[0, :], det[1, :], n=n, + det_cent=det_cent, det_ei=det_ei, det_ej=det_ej, + theta=None, psi=None, plot=False) + phimin, phimax = np.nanmin(phi), np.nanmax(phi) + phimin, phimax = phimin-(phimax-phimin)/10, phimax+(phimax-phimin)/10 + del phi + + # Get reference ray-tracing + if nphi is None: + nphi = 300 + phi = np.linspace(phimin, phimax, nphi) + bragg = self._checkformat_bragglamb(lamb=lamb, n=n) + + xi = np.full((nlamb, nphi), np.nan) + xj = np.full((nlamb, nphi), np.nan) + for ll in range(nlamb): + xi[ll, :], xj[ll, :] = self.calc_xixj_from_phibragg( + bragg=bragg[ll], phi=phi, n=n, + det_cent=det_cent, det_nout=det_nout, + det_ei=det_ei, det_ej=det_ej, plot=False) + + # Get johann-error raytracing (multiple positions on crystal) + xi_err, xj_err = None, None + if johann and not rocking: + if lpsi is None or ltheta is None: + lpsi = np.linspace(-1., 1., 15) + ltheta = np.linspace(-1., 1., 15) + lpsi, ltheta = np.meshgrid(lpsi, ltheta) + lpsi = lpsi.ravel() + ltheta = ltheta.ravel() + lpsi = self._dgeom['extenthalf'][0]*np.r_[lpsi] + ltheta = np.pi/2 + self._dgeom['extenthalf'][1]*np.r_[ltheta] + npsi = lpsi.size + assert npsi == ltheta.size + + xi_err = np.full((nlamb, npsi*nphi), np.nan) + xj_err = np.full((nlamb, npsi*nphi), np.nan) + for l in range(nlamb): + for ii in range(npsi): + i0 = np.arange(ii*nphi, (ii+1)*nphi) + xi_err[l, i0], xj_err[l, i0] = self.calc_xixj_from_phibragg( + phi=phi, bragg=bragg[l], lamb=None, n=n, + theta=ltheta[ii], psi=lpsi[ii], + det_cent=det_cent, det_nout=det_nout, + det_ei=det_ei, det_ej=det_ej, plot=False) + + # Get rocking curve error + if rocking: + pass + + # Plot + ax = _plot_optics.CrystalBragg_plot_line_tracing_on_det( + lamb, xi, xj, xi_err, xj_err, det=det, + johann=johann, rocking=rocking, + fs=fs, dmargin=dmargin, wintit=wintit, tit=tit) def calc_johannerror(self, xi=None, xj=None, err=None, det_cent=None, det_ei=None, det_ej=None, n=None, @@ -1269,22 +1343,16 @@ def calc_johannerror(self, xi=None, xj=None, err=None, lamb = self.get_lamb_from_bragg(bragg, n=n) if lpsi is None: - lpsi = self._dgeom['extenthalf'][0]*np.r_[-1., 0., 1., 1., - 1., 0., -1, -1] - else: - lpsi = self._dgeom['extenthalf'][0]*np.r_[lpsi] + lpsi = np.r_[-1., 0., 1., 1., 1., 0., -1, -1] + lpsi = self._dgeom['extenthalf'][0]*np.r_[lpsi] if ltheta is None: - ltheta = np.pi/2 + self._dgeom['extenthalf'][1]*np.r_[-1., -1., - -1., 0., - 1., 1., - 1., 0.] - else: - ltheta = np.pi/2 + self._dgeom['extenthalf'][1]*np.r_[ltheta] + ltheta = np.r_[-1., -1., -1., 0., 1., 1., 1., 0.] + ltheta = np.pi/2 + self._dgeom['extenthalf'][1]*np.r_[ltheta] npsi = lpsi.size assert npsi == ltheta.size lamberr = np.full(tuple(np.r_[npsi, lamb.shape]), np.nan) phierr = np.full(lamberr.shape, np.nan) - for ii in range(len(ltheta)): + for ii in range(npsi): bragg, phierr[ii, ...] = self.calc_phibragg_from_xixj( xii, xjj, n=n, det_cent=det_cent, det_ei=det_ei, det_ej=det_ej, @@ -1298,6 +1366,105 @@ def calc_johannerror(self, xi=None, xj=None, err=None, cmap=cmap, vmin=vmin, vmax=vmax, fs=fs, tit=tit, wintit=wintit) return err_lamb, err_phi + def calc_braggphi_from_pts(self, pts): + pass + + def calc_thetapsi_from_lambpts(self, lamb=None, pts=None): + + # Check / Format inputs + pts = np.atleast_1d(pts) + if pts.ndim == 1: + pts = pts.reshape((3, 1)) + npts = pts.shape[1] + + lamb = np.r_[lamb] + nlamb = lamb.size + bragg = self. + + + dtheta, psi = _comp_optics.calc_psidthetaphi_from_pts_lamb() + + return dtheta, psi, phi, bragg + + + def plot_line_from_pts_on_det(self, lamb=None, pts=None,) + xi_bounds=None, xj_bounds=None, nphi=None, + det_cent=None, det_nout=None, + det_ei=None, det_ej=None, + johann=False, lpsi=None, ltheta=None, + rocking=False, fs=None, dmargin=None, + wintit=None, tit=None): + """ Visualize the de-focusing by ray-tracing of chosen lamb + """ + # Check / format inputs + if lamb is None: + lamb = self._DEFLAMB + lamb = np.atleast_1d(lamb).ravel() + nlamb = lamb.size + + det = np.array([[xi_bounds[0], xi_bounds[1], xi_bounds[1], + xi_bounds[0], xi_bounds[0]], + [xj_bounds[0], xj_bounds[0], xj_bounds[1], + xj_bounds[1], xj_bounds[0]]]) + + # Compute lamb / phi + _, phi = self.calc_phibragg_from_xixj( + det[0, :], det[1, :], n=n, + det_cent=det_cent, det_ei=det_ei, det_ej=det_ej, + theta=None, psi=None, plot=False) + phimin, phimax = np.nanmin(phi), np.nanmax(phi) + phimin, phimax = phimin-(phimax-phimin)/10, phimax+(phimax-phimin)/10 + del phi + + # Get reference ray-tracing + if nphi is None: + nphi = 300 + phi = np.linspace(phimin, phimax, nphi) + bragg = self._checkformat_bragglamb(lamb=lamb, n=n) + + xi = np.full((nlamb, nphi), np.nan) + xj = np.full((nlamb, nphi), np.nan) + for ll in range(nlamb): + xi[ll, :], xj[ll, :] = self.calc_xixj_from_phibragg( + bragg=bragg[ll], phi=phi, n=n, + det_cent=det_cent, det_nout=det_nout, + det_ei=det_ei, det_ej=det_ej, plot=False) + + # Get johann-error raytracing (multiple positions on crystal) + xi_err, xj_err = None, None + if johann and not rocking: + if lpsi is None or ltheta is None: + lpsi = np.linspace(-1., 1., 15) + ltheta = np.linspace(-1., 1., 15) + lpsi, ltheta = np.meshgrid(lpsi, ltheta) + lpsi = lpsi.ravel() + ltheta = ltheta.ravel() + lpsi = self._dgeom['extenthalf'][0]*np.r_[lpsi] + ltheta = np.pi/2 + self._dgeom['extenthalf'][1]*np.r_[ltheta] + npsi = lpsi.size + assert npsi == ltheta.size + + xi_err = np.full((nlamb, npsi*nphi), np.nan) + xj_err = np.full((nlamb, npsi*nphi), np.nan) + for l in range(nlamb): + for ii in range(npsi): + i0 = np.arange(ii*nphi, (ii+1)*nphi) + xi_err[l, i0], xj_err[l, i0] = self.calc_xixj_from_phibragg( + phi=phi, bragg=bragg[l], lamb=None, n=n, + theta=ltheta[ii], psi=lpsi[ii], + det_cent=det_cent, det_nout=det_nout, + det_ei=det_ei, det_ej=det_ej, plot=False) + + # Get rocking curve error + if rocking: + pass + + # Plot + ax = _plot_optics.CrystalBragg_plot_line_tracing_on_det( + lamb, xi, xj, xi_err, xj_err, det=det, + johann=johann, rocking=rocking, + fs=fs, dmargin=dmargin, wintit=wintit, tit=tit) + def plot_data_vs_lambphi(self, xi=None, xj=None, data=None, mask=None, det_cent=None, det_ei=None, det_ej=None, theta=None, psi=None, n=None, diff --git a/tofu/geom/_plot_optics.py b/tofu/geom/_plot_optics.py index 4f7942530..e166d6a55 100644 --- a/tofu/geom/_plot_optics.py +++ b/tofu/geom/_plot_optics.py @@ -404,6 +404,59 @@ def CrystalBragg_plot_braggangle_from_xixj(xi=None, xj=None, return ax +def CrystalBragg_plot_line_tracing_on_det(lamb, xi, xj, xi_err, xj_err, + det=None, + johann=None, rocking=None, + fs=None, dmargin=None, wintit=None, tit=None): + + # Check inputs + # ------------ + + if fs is None: + fs = (6, 8) + if dmargin is None: + dmargin = {'left':0.05, 'right':0.99, + 'bottom':0.06, 'top':0.92, + 'wspace':None, 'hspace':0.4} + + if wintit is None: + wintit = _WINTIT + if tit is None: + tit = "line tracing" + if johann is True: + tit += " - johann error" + if rocking is True: + tit += " - rocking curve" + + plot_err = johann is True or rocking is True + + # Plot + # ------------ + + fig = fig = plt.figure(figsize=fs) + gs = gridspec.GridSpec(1, 1, **dmargin) + ax0 = fig.add_subplot(gs[0, 0], aspect='equal', adjustable='datalim') + + ax0.plot(det[0, :], det[1, :], ls='-', lw=1., c='k') + for l in range(lamb.size): + lab = r'$\lambda$'+' = {:6.3f} A'.format(lamb[l]*1.e10) + l0, = ax0.plot(xi[l, :], xj[l, :], ls='-', lw=1., label=lab) + if plot_err: + ax0.plot(xi_err[l, ...], xj_err[l, ...], + ls='None', lw=1., c=l0.get_color(), + marker='.', ms=1) + + ax0.legend() + + if wintit is not False: + fig.canvas.set_window_title(wintit) + if tit is not False: + fig.suptitle(tit, size=14, weight='bold') + return [ax0] + + + + def CrystalBragg_plot_johannerror(xi, xj, lamb, phi, err_lamb, err_phi, cmap=None, vmin=None, vmax=None, fs=None, dmargin=None, wintit=None, tit=None, diff --git a/tofu/version.py b/tofu/version.py index e6a5a9db5..324ba765a 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.2-a5-36-g7d3011e' +__version__ = '1.4.2-a5-37-gf44434f' From f1da5210c73137cda685c628a42d8da727836d76 Mon Sep 17 00:00:00 2001 From: "Laura S. Mendoza" Date: Sat, 14 Dec 2019 19:55:41 +0100 Subject: [PATCH 073/168] trying automatic CI with new name, to be reverted --- setup.py | 2 +- tofu/version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index f3fabc8e4..ecc74bc89 100644 --- a/setup.py +++ b/setup.py @@ -282,7 +282,7 @@ def get_version_tofu(path=_HERE): setup( - name="tofu", + name="tofuproject", version="{ver}".format(ver=version_tofu), # Use scm to get code version from git tags # cf. https://pypi.python.org/pypi/setuptools_scm diff --git a/tofu/version.py b/tofu/version.py index ab0e46b95..fbadd4a44 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.2-a5' +__version__ = '1.4.2' From f0a4a89fae34328efa65e6bf4098d0c0dd85bdcf Mon Sep 17 00:00:00 2001 From: "Laura S. Mendoza" Date: Sun, 15 Dec 2019 23:43:30 +0100 Subject: [PATCH 074/168] trying automatic CI with new name, to be reverted --- examples/tutorials/tuto_plot_custom_emissivity.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/tutorials/tuto_plot_custom_emissivity.py b/examples/tutorials/tuto_plot_custom_emissivity.py index 5959a37af..d6aecf05c 100644 --- a/examples/tutorials/tuto_plot_custom_emissivity.py +++ b/examples/tutorials/tuto_plot_custom_emissivity.py @@ -95,4 +95,4 @@ def project_to_2D(xyz): t=time_vector) sig.plot(ntMax=1) -plt.show(block=False) +plt.show(block=True) diff --git a/setup.py b/setup.py index ecc74bc89..2e7deb6a2 100644 --- a/setup.py +++ b/setup.py @@ -282,7 +282,7 @@ def get_version_tofu(path=_HERE): setup( - name="tofuproject", + name="tofuproject", # to switch back to tofu version="{ver}".format(ver=version_tofu), # Use scm to get code version from git tags # cf. https://pypi.python.org/pypi/setuptools_scm From c7511173fc84f93c33896df9cfe06970a7ff1182 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Mon, 16 Dec 2019 10:53:32 +0100 Subject: [PATCH 075/168] [Issue202] Corrected lack of recurrence of self.to_dict(sep=...) in tf.utils.flatten_dict() --- tofu/geom/_comp_optics.py | 8 ++++---- tofu/geom/_core_optics.py | 4 ++-- tofu/utils.py | 10 +++++----- tofu/version.py | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tofu/geom/_comp_optics.py b/tofu/geom/_comp_optics.py index 4c1d2200d..2d4d38169 100644 --- a/tofu/geom/_comp_optics.py +++ b/tofu/geom/_comp_optics.py @@ -250,7 +250,7 @@ def get_lambphifit(lamb, phi, nxi, nxj): # From plasma pts # ############################################### -def calc_psidthetaphi_from_pts_lamb(pts, bragg, , nlamb, npts, ntheta): +def calc_psidthetaphi_from_pts_lamb(pts, bragg, nlamb, npts, ntheta): scaPCem = np.full((nlamb, npts), np.nan) psi = np.full((nlamb, npts, ntheta), np.nan) @@ -261,9 +261,9 @@ def calc_psidthetaphi_from_pts_lamb(pts, bragg, , nlamb, npts, ntheta): PC = C[:, None] - pts PCnorm2 = np.sum(PC**2, axis=0)**2 cos2 = np.cos(bragg)**2 - deltaon4 = (*R**2*cos2[:, None]**2 - - *(R**2*cos2[:, None] - - PCnorm2[None, :]*np.sin(bragg)[:, None]**2)) + deltaon4 = (R**2*cos2[:, None]**2 + - (R**2*cos2[:, None] + - PCnorm2[None, :]*np.sin(bragg)[:, None]**2)) # Get two relevant solutions ind = deltaon4 >= 0. diff --git a/tofu/geom/_core_optics.py b/tofu/geom/_core_optics.py index 4d39664e4..11a0a4ebf 100644 --- a/tofu/geom/_core_optics.py +++ b/tofu/geom/_core_optics.py @@ -1379,7 +1379,7 @@ def calc_thetapsi_from_lambpts(self, lamb=None, pts=None): lamb = np.r_[lamb] nlamb = lamb.size - bragg = self. + bragg = self dtheta, psi = _comp_optics.calc_psidthetaphi_from_pts_lamb() @@ -1387,7 +1387,7 @@ def calc_thetapsi_from_lambpts(self, lamb=None, pts=None): return dtheta, psi, phi, bragg - def plot_line_from_pts_on_det(self, lamb=None, pts=None,) + def plot_line_from_pts_on_det(self, lamb=None, pts=None, xi_bounds=None, xj_bounds=None, nphi=None, det_cent=None, det_nout=None, det_ei=None, det_ej=None, diff --git a/tofu/utils.py b/tofu/utils.py index 06784657a..e5efcdfbb 100644 --- a/tofu/utils.py +++ b/tofu/utils.py @@ -142,7 +142,7 @@ def flatten_dict(d, parent_key='', sep=None, deep='ref', if k not in lexcept_key: if issubclass(v.__class__, ToFuObjectBase): if deep=='dict': - v = v.to_dict(deep='dict') + v = v.to_dict(sep=sep, deep='dict') elif deep=='copy': v = v.copy(deep='copy') new_key = parent_key + sep + k if parent_key else k @@ -1625,7 +1625,7 @@ def to_dict(self, strip=None, sep=None, deep='ref'): # Call class-specific dd = self._to_dict() # --------------------- - dd['dId'] = self._get_dId() + dd['dId'] = self._get_dId(sep=sep) dd['dstrip'] = {'dict':self._dstrip, 'lexcept':None} dout = {} @@ -1646,7 +1646,7 @@ def to_dict(self, strip=None, sep=None, deep='ref'): dout = flatten_dict(dout, parent_key='', sep=sep, deep=deep) return dout - def _get_dId(self): + def _get_dId(self, sep=None): """ To be overloaded """ return {'dict':{}} @@ -1875,8 +1875,8 @@ def Id(self): """ return self._Id - def _get_dId(self): - return {'dict':self.Id.to_dict()} + def _get_dId(self, sep=None): + return {'dict':self.Id.to_dict(sep=sep)} def _reset(self): if hasattr(self,'_Id'): diff --git a/tofu/version.py b/tofu/version.py index 324ba765a..c6cbd36f8 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.2-a5-37-gf44434f' +__version__ = '1.4.2-a5-38-gb2beda9' From b0dac67b9aa0ad53b8ff3061aee1bdf83358002c Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Mon, 16 Dec 2019 11:26:08 +0100 Subject: [PATCH 076/168] [Issue202] imas2tofu more robust vs Config saving and loading to/from ids wall, and fully recursive to_dict for .mat saving --- tofu/imas2tofu/_core.py | 8 ++--- tofu/utils.py | 66 +++++++++++++++++++++-------------------- tofu/version.py | 2 +- 3 files changed, 39 insertions(+), 37 deletions(-) diff --git a/tofu/imas2tofu/_core.py b/tofu/imas2tofu/_core.py index 2a73d5be6..1145db24c 100644 --- a/tofu/imas2tofu/_core.py +++ b/tofu/imas2tofu/_core.py @@ -2222,7 +2222,7 @@ def _get_t0(self, t0=None): def to_Config(self, Name=None, occ=None, indDescription=None, plot=True): lidsok = ['wall'] if indDescription is None: - indDescription = 0 + indDescription = 2 # --------------------------- # Preliminary checks on data source consistency @@ -3978,11 +3978,11 @@ def _save_to_imas_Config( obj, idd=None, shotfile=None, raise Exception(msg) if description_2d is None: - if nS == 1 and lcls[0] in ['Ves','PlasmaDomain']: + if nS == 1 and lcls[0] in ['Ves', 'PlasmaDomain']: description_2d = 0 else: - descrption_2d = 2 - assert description_2d in [0,2] + description_2d = 2 + assert description_2d in [0, 2] # Make sure StructIn is last (IMAS requirement) ind = lcls.index(lclsIn[0]) diff --git a/tofu/utils.py b/tofu/utils.py index e5efcdfbb..4eddd4a23 100644 --- a/tofu/utils.py +++ b/tofu/utils.py @@ -639,7 +639,7 @@ def _get_exception(q, ids, qtype='quantity'): def load_from_imas(shot=None, run=None, user=None, tokamak=None, version=None, - ids=None, Name=None, out=None, tlim=None, config=None, + ids=None, Name=None, returnas=None, tlim=None, config=None, occ=None, indch=None, indDescription=None, equilibrium=None, dsig=None, data=None, X=None, t0=None, dextra=None, plot=True, plot_sig=None, plot_X=None, @@ -657,14 +657,16 @@ def load_from_imas(shot=None, run=None, user=None, tokamak=None, version=None, raise Exception(msg) lok = ['Config', 'Plasma2D', 'Cam', 'Data'] - c0 = out is None or out in lok + c0 = returnas is None or returnas in lok if not c0: - msg = "Arg out must be in %s"%str(lok) + msg = "Arg returnas must be in %s"%str(lok) raise Exception(msg) # ------------------- # Prepare ids - assert ids is None or type(ids) in [list,str] + if type(ids) not in [list, str]: + msg = "Please specify an ids to load data from!" + raise Exception(msg) if type(ids) is str: ids = [ids] if type(ids) is list: @@ -826,17 +828,17 @@ def load_from_imas(shot=None, run=None, user=None, tokamak=None, version=None, # ------------------- - # Prepare out - loutok = ['Config','Plasma2D','Cam','Data'] - c0 = out is None - c1 = out in loutok - c2 = type(out) is list and all([oo is None or oo in loutok - for oo in out]) + # Prepare returnas + loutok = ['Config', 'Plasma2D', 'Cam', 'Data'] + c0 = returnas is None + c1 = returnas in loutok + c2 = type(returnas) is list and all([oo is None or oo in loutok + for oo in returnas]) assert c0 or c1 or c2 if c0: - out = [None for _ in ids] + returnas = [None for _ in ids] elif c1: - out = [str(out) for _ in ids] + returnas = [str(returnas) for _ in ids] # Temporary caveat if nids > 1: @@ -852,35 +854,35 @@ def load_from_imas(shot=None, run=None, user=None, tokamak=None, version=None, # Config if ids[ii] == 'wall': - assert out[ii] in [None,'Config'] - out[ii] = 'Config' - if out[ii] == 'Config': + assert returnas[ii] in [None,'Config'] + returnas[ii] = 'Config' + if returnas[ii] == 'Config': assert ids[ii] in [None,'wall'] # Plasma2D lids = imas2tofu.MultiIDSLoader._lidsplasma if ids[ii] in lids: - assert out[ii] in [None,'Plasma2D'] - out[ii] = 'Plasma2D' - if out[ii] == 'Plasma2D': + assert returnas[ii] in [None,'Plasma2D'] + returnas[ii] = 'Plasma2D' + if returnas[ii] == 'Plasma2D': assert ids[ii] in lids # Cam or Data lids = imas2tofu.MultiIDSLoader._lidsdiag if ids[ii] in lids: - assert out[ii] in [None,'Cam','Data'] - if out[ii] is None: - out[ii] = 'Data' - if out[ii] in ['Cam','Data']: + assert returnas[ii] in [None,'Cam','Data'] + if returnas[ii] is None: + returnas[ii] = 'Data' + if returnas[ii] in ['Cam','Data']: assert ids[ii] in lids - dout = {shot[jj]: {oo:[] for oo in set(out)} for jj in range(0,nshot)} + dout = {shot[jj]: {oo:[] for oo in set(returnas)} for jj in range(0,nshot)} # ------------------- # Prepare plot_ and complement ids - lPla = [ii for ii in range(0,nids) if out[ii] == 'Plasma2D'] - lCam = [ii for ii in range(0,nids) if out[ii] == 'Cam'] - lDat = [ii for ii in range(0,nids) if out[ii] == 'Data'] + lPla = [ii for ii in range(0,nids) if returnas[ii] == 'Plasma2D'] + lCam = [ii for ii in range(0,nids) if returnas[ii] == 'Cam'] + lDat = [ii for ii in range(0,nids) if returnas[ii] == 'Data'] nPla, nCam, nDat = len(lPla), len(lCam), len(lDat) if nDat > 1: plot_ = False @@ -960,23 +962,23 @@ def load_from_imas(shot=None, run=None, user=None, tokamak=None, version=None, # export to instances for ii in range(0,nids): - if out[ii] == 'Config': + if returnas[ii] == 'Config': dout[ss]['Config'].append(multi.to_Config(Name=Name, occ=occ, indDescription=indDescription, plot=False)) - elif out[ii] == 'Plasma2D': + elif returnas[ii] == 'Plasma2D': dout[ss]['Plasma2D'].append(multi.to_Plasma2D(Name=Name, occ=occ, tlim=tlim, dsig=dsig, t0=t0, plot=False, plot_sig=plot_sig, dextra=dextra, plot_X=plot_X, config=config, bck=bck)) - elif out[ii] == 'Cam': + elif returnas[ii] == 'Cam': dout[ss]['Cam'].append(multi.to_Cam(Name=Name, occ=occ, ids=lids[ii], indch=indch, config=config, plot=False)) - elif out[ii] == "Data": + elif returnas[ii] == "Data": dout[ss]['Data'].append(multi.to_Data(Name=Name, occ=occ, ids=lids[ii], tlim=tlim, dsig=dsig, config=config, data=data, X=X, indch=indch, @@ -990,7 +992,7 @@ def load_from_imas(shot=None, run=None, user=None, tokamak=None, version=None, # Config & Cam for ss in shot: - for k0 in set(['Config','Cam']).intersection(out): + for k0 in set(['Config', 'Cam']).intersection(returnas): for ii in range(0, len(dout[ss][k0])): dout[ss][k0][ii].plot() @@ -1020,7 +1022,7 @@ def load_from_imas(shot=None, run=None, user=None, tokamak=None, version=None, dout = dout[shot[0]]['Data'][0] elif nshot == 1 and nPla == 1: dout = dout[shot[0]]['Plasma2D'][0] - return out + return dout diff --git a/tofu/version.py b/tofu/version.py index c6cbd36f8..ec35551ce 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.2-a5-38-gb2beda9' +__version__ = '1.4.2-a5-39-gc751117' From e6b26ccf08658b2f24cadc40889145bb281c768e Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Mon, 16 Dec 2019 11:34:27 +0100 Subject: [PATCH 077/168] [Issue202] save(mode='mat') default to sep='_' --- tofu/utils.py | 10 +++++++++- tofu/version.py | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/tofu/utils.py b/tofu/utils.py index 4eddd4a23..58bf191e0 100644 --- a/tofu/utils.py +++ b/tofu/utils.py @@ -320,7 +320,15 @@ def save(obj, path=None, name=None, sep=None, deep=False, mode='npz', # Get stripped dictionnary deep = 'dict' if deep else 'ref' if sep is None: - sep = _SEP + if mode == 'mat': + sep = '_' + else: + sep = _SEP + if mode == 'mat' and sep == '.': + msg = ("sep='.' cannot be used when mode='mat' (incompatible)\n" + + "Matlab would interpret variables as structures") + raise Exception(msg) + dd = obj.to_dict(strip=strip, sep=sep, deep=deep) pathfileext = os.path.join(path,name+'.'+mode) diff --git a/tofu/version.py b/tofu/version.py index ec35551ce..22a278f5f 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.2-a5-39-gc751117' +__version__ = '1.4.2-a5-40-gb0dac67' From e1f9f11b602e12f9ce8d956cb8cacb03297bfd27 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Mon, 16 Dec 2019 18:17:29 +0100 Subject: [PATCH 078/168] [Issue202] Advanced calc_from_pts (phibragg, line projection...), TBF --- tofu/geom/_comp_optics.py | 90 +++++++++++++++++++++++++-------------- tofu/geom/_core_optics.py | 88 ++++++++++++++++++++++++++++---------- tofu/version.py | 2 +- 3 files changed, 125 insertions(+), 55 deletions(-) diff --git a/tofu/geom/_comp_optics.py b/tofu/geom/_comp_optics.py index 2d4d38169..a5fa988e2 100644 --- a/tofu/geom/_comp_optics.py +++ b/tofu/geom/_comp_optics.py @@ -213,24 +213,28 @@ def calc_xixj_from_braggphi(summit, det_cent, det_nout, det_ei, det_ej, return xi, xj def calc_braggphi_from_xixj(xi, xj, det_cent, det_ei, det_ej, - summit, nin, e1, e2): - - xi = xi[None, ...] - xj = xj[None, ...] - if xi.ndim == 1: - summit = summit[:, None] - det_cent = det_cent[:, None] - det_ei, det_ej = det_ei[:, None], det_ej[:, None] - nin, e1, e2 = nin[:, None], e1[:, None], e2[:, None] + summit, nin, e1, e2, pts=None): + + if pts is None: + xi = xi[None, ...] + xj = xj[None, ...] + if xi.ndim == 1: + summit = summit[:, None] + det_cent = det_cent[:, None] + det_ei, det_ej = det_ei[:, None], det_ej[:, None] + nin, e1, e2 = nin[:, None], e1[:, None], e2[:, None] + else: + summit = summit[:, None, None] + det_cent = det_cent[:, None, None] + det_ei, det_ej = det_ei[:, None, None], det_ej[:, None, None] + nin, e1, e2 = nin[:, None, None], e1[:, None, None], e2[:, None, None] + pts = det_cent + xi*det_ei + xj*det_ej else: + assert pts.ndim == 2 + pts = pts[:, :, None] summit = summit[:, None, None] - det_cent = det_cent[:, None, None] - det_ei, det_ej = det_ei[:, None, None], det_ej[:, None, None] nin, e1, e2 = nin[:, None, None], e1[:, None, None], e2[:, None, None] - - pts = det_cent + xi*det_ei + xj*det_ej - vect = pts - summit vect = vect / np.sqrt(np.sum(vect**2, axis=0))[None, ...] bragg = np.arcsin(np.sum(vect*nin, axis=0)) @@ -250,28 +254,34 @@ def get_lambphifit(lamb, phi, nxi, nxj): # From plasma pts # ############################################### -def calc_psidthetaphi_from_pts_lamb(pts, bragg, nlamb, npts, ntheta): +def calc_psidthetaphi_from_pts_lamb(pts, center, rcurve, + bragg, nlamb, npts, + nout, e1, e2, extenthalf, ntheta=None): + + if ntheta is None: + ntheta = 100 scaPCem = np.full((nlamb, npts), np.nan) - psi = np.full((nlamb, npts, ntheta), np.nan) dtheta = np.full((nlamb, npts, ntheta), np.nan) - phi = np.full((nlamb, npts, ntheta), np.nan) + psi = np.full((nlamb, npts, ntheta), np.nan) # Get to scalar product - PC = C[:, None] - pts - PCnorm2 = np.sum(PC**2, axis=0)**2 + PC = center[:, None] - pts + PCnorm2 = np.sum(PC**2, axis=0) cos2 = np.cos(bragg)**2 - deltaon4 = (R**2*cos2[:, None]**2 - - (R**2*cos2[:, None] + deltaon4 = (rcurve**2*cos2[:, None]**2 + - (rcurve**2*cos2[:, None] - PCnorm2[None, :]*np.sin(bragg)[:, None]**2)) # Get two relevant solutions ind = deltaon4 >= 0. + cos2 = np.repeat(cos2[:, None], npts, axis=1)[ind] PCnorm = np.tile(np.sqrt(PCnorm2), (nlamb, 1))[ind] - sol1 = -R*cos2 - np.sqrt(deltaon4[ind]) - sol2 = -R*cos2 + np.sqrt(deltaon4[ind]) - ind1 = (np.abs(sol1) <= PCnorm) & (sol1 >= -R) - ind2 = (np.abs(sol2) <= PCnorm) & (sol2 >= -R) + sol1 = -rcurve*cos2 - np.sqrt(deltaon4[ind]) + sol2 = -rcurve*cos2 + np.sqrt(deltaon4[ind]) + # em is a unit vector and ... + ind1 = (np.abs(sol1) <= PCnorm) & (sol1 >= -rcurve) + ind2 = (np.abs(sol2) <= PCnorm) & (sol2 >= -rcurve) assert not np.any(ind1 & ind2) sol1 = sol1[ind1] sol2 = sol2[ind2] @@ -286,11 +296,27 @@ def calc_psidthetaphi_from_pts_lamb(pts, bragg, nlamb, npts, ntheta): X = np.sum(PC*nout[:, None], axis=0) Y = np.sum(PC*e1[:, None], axis=0) Z = np.sum(PC*e2[:, None], axis=0) - XYnorm = np.sqrt(X**2 + Y**2) - psi = (np.arccos(XYnorm * (scaPCem[ind] - Z*np.sin(dtheta))/np.cos(dtheta)) - + np.arctan2(Y, X)) - psi = np.arctan2(np.sin(psi), np.cos(psi)) - - dtheta = extenthalf[1]*np.linspace(-1, 1, ntheta) - return dtheta, psi, phi + scaPCem = np.repeat(scaPCem[..., None], ntheta, axis=-1) + ind = ~np.isnan(scaPCem) + XYnorm = np.repeat(np.repeat(np.sqrt(X**2 + Y**2)[None, :], + nlamb, axis=0)[..., None], + ntheta, axis=-1)[ind] + Z = np.repeat(np.repeat(Z[None, :], nlamb, axis=0)[..., None], + ntheta, axis=-1)[ind] + angextra = np.repeat( + np.repeat(np.arctan2(Y, X)[None, :], nlamb, axis=0)[..., None], + ntheta, axis=-1)[ind] + dtheta[ind] = np.repeat( + np.repeat(extenthalf[1]*np.linspace(-1, 1, ntheta)[None, :], + npts, axis=0)[None, ...], + nlamb, axis=0)[ind] + + psi[ind] = (np.arccos((scaPCem[ind] + - Z*np.sin(dtheta[ind]))/(XYnorm*np.cos(dtheta[ind]))) + + angextra) + psi[ind] = np.arctan2(np.sin(psi[ind]), np.cos(psi[ind])) + indnan = (~ind) | (np.abs(psi) > extenthalf[0]) + psi[indnan] = np.nan + dtheta[indnan] = np.nan + return dtheta, psi, indnan diff --git a/tofu/geom/_core_optics.py b/tofu/geom/_core_optics.py index 11a0a4ebf..0ebe2a2ad 100644 --- a/tofu/geom/_core_optics.py +++ b/tofu/geom/_core_optics.py @@ -1160,6 +1160,18 @@ def calc_xixj_from_phibragg(self, phi=None, ax = func(bragg, xi, xj, data, ax) return xi, xj + @staticmethod + def _checkformat_pts(pts): + pts = np.atleast_1d(pts) + if pts.ndim == 1: + pts = pts.reshape((3, 1)) + if 3 not in pts.shape or pts.ndim != 2: + msg = "pts must be a (3, npts) array of (X, Y, Z) coordinates!" + raise Exception(msg) + if pts.shape[0] != 3: + pts = pts.T + return pts + @staticmethod def _checkformat_xixj(xi, xj): xi = np.atleast_1d(xi) @@ -1170,9 +1182,22 @@ def _checkformat_xixj(xi, xj): else: return xi, xj, np.meshgrid(xi, xj) + @staticmethod + def _checkformat_psidtheta(psi=None, dtheta=None, + psi_def=0., dtheta_def=0.): + if psi is None: + psi = psi_def + if dtheta is None: + dtheta = dtheta_def + psi = np.r_[psi] + dtheta = np.r_[dtheta] + if psi.size != dtheta.size: + msg = "psi and dtheta must be 1d arrays fo same size!" + raise Exception(msg) + def calc_phibragg_from_xixj(self, xi, xj, n=None, det_cent=None, det_ei=None, det_ej=None, - theta=None, psi=None, + dtheta=None, psi=None, plot=True, ax=None, **kwdargs): # Check / format inputs @@ -1185,11 +1210,8 @@ def calc_phibragg_from_xixj(self, xi, xj, n=None, lamb=self._DEFLAMB) # Get local summit nout, e1, e2 if non-centered - if theta is None: - theta = np.pi/2. - if psi is None: - psi = 0. - summit, nout, e1, e2 = self.get_local_noute1e2(theta, psi) + psi, dtheta = self._checkformat_psidtheta(psi=psi, dtheta=dtheta) + summit, nout, e1, e2 = self.get_local_noute1e2(dtheta, psi) # Compute bragg, phi = _comp_optics.calc_braggphi_from_xixj( @@ -1205,7 +1227,7 @@ def calc_phibragg_from_xixj(self, xi, xj, n=None, braggunits='deg', angunits='deg', **kwdargs) return bragg, phi - def calc_phibragg_from_pts(self, pts, n=None): + def calc_phibragg_from_pts_on_summit(self, pts, n=None): """ Return the bragg angle and phi of pts from crystal summit The pts are provided as a (x, y, z) coordinates array @@ -1213,13 +1235,7 @@ def calc_phibragg_from_pts(self, pts, n=None): """ # Check / format inputs - pts = np.asarray(pts) - assert pts.ndim in [1, 2] - assert 3 in pts.shape - if pts.ndim == 1: - pts = pts[:, None] - if pts.shape[0] != 3: - pts = pts.T + pts = self._checkformat_pts(pts) # Compute vect = pts - self._dgeom['summit'][:, None] @@ -1366,23 +1382,51 @@ def calc_johannerror(self, xi=None, xj=None, err=None, cmap=cmap, vmin=vmin, vmax=vmax, fs=fs, tit=tit, wintit=wintit) return err_lamb, err_phi - def calc_braggphi_from_pts(self, pts): + def calc_phibragg_from_pts(self, pts, dtheta=None, dpsi=None): + + # Check / format pts + pts = self._checkformat_pts(pts) + + # Get local summit nout, e1, e2 if non-centered + psi, dtheta = self._checkformat_psidtheta(psi=psi, dtheta=dtheta) + summit, nout, e1, e2 = self.get_local_noute1e2(dtheta, psi) + + # Compute + bragg, phi = _comp_optics.calc_braggphi_from_xixj( + xii, xjj, det_cent, det_ei, det_ej, + summit, -nout, e1, e2) + + + def get_lamb_avail_from_pts(self, pts): pass - def calc_thetapsi_from_lambpts(self, lamb=None, pts=None): + + def calc_thetapsi_from_lambpts(self, pts=None, lamb=None, n=None, + ntheta=None): # Check / Format inputs - pts = np.atleast_1d(pts) - if pts.ndim == 1: - pts = pts.reshape((3, 1)) + pts = self._checkformat_pts(pts) npts = pts.shape[1] + if lamb is None: + lamb = self._DEFLAMB lamb = np.r_[lamb] nlamb = lamb.size - bragg = self + bragg = self.get_bragg_from_lamb(lamb, n=n) - - dtheta, psi = _comp_optics.calc_psidthetaphi_from_pts_lamb() + dtheta, psi, indnan = _comp_optics.calc_psidthetaphi_from_pts_lamb( + pts, self._dgeom['center'], self._dgeom['rcurve'], + bragg, nlamb, npts, + self._dgeom['nout'], self._dgeom['e1'], self._dgeom['e2'], + self._dgeom['extenthalf'], ntheta=ntheta) + + import ipdb; ipdb.set_trace() # DB + bragg = np.repeat(np.repeat(bragg[:, None], npts, axis=-1)[..., None], + ntheta, axis=-1) + bragg[indnan] = np.nan + phi[ind] = self.calc_braggphi_from_pts(pts, + dtheta=dtheta[ind], + dpsi=dpsi[ind]) return dtheta, psi, phi, bragg diff --git a/tofu/version.py b/tofu/version.py index 22a278f5f..2055b7bbd 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.2-a5-40-gb0dac67' +__version__ = '1.4.2-a5-41-ge6b26cc' From 202c2cf9959c23a45daf5b75cd42c1fe8f4955ef Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Tue, 17 Dec 2019 08:23:23 +0100 Subject: [PATCH 079/168] [Issue202] Continued calc_phibragg_from_pts(), updating related methods, TBF --- tofu/geom/_comp_optics.py | 5 +++-- tofu/geom/_core_optics.py | 18 ++++++++---------- tofu/version.py | 2 +- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/tofu/geom/_comp_optics.py b/tofu/geom/_comp_optics.py index a5fa988e2..fe31d141a 100644 --- a/tofu/geom/_comp_optics.py +++ b/tofu/geom/_comp_optics.py @@ -212,8 +212,9 @@ def calc_xixj_from_braggphi(summit, det_cent, det_nout, det_ei, det_ej, xj = np.sum((pts - det_cent[:, None])*det_ej[:, None], axis=0) return xi, xj -def calc_braggphi_from_xixj(xi, xj, det_cent, det_ei, det_ej, - summit, nin, e1, e2, pts=None): +def calc_braggphi_from_xixjpts(det_cent, det_ei, det_ej, + summit, nin, e1, e2, + xi=None, xj=None, pts=None): if pts is None: xi = xi[None, ...] diff --git a/tofu/geom/_core_optics.py b/tofu/geom/_core_optics.py index 0ebe2a2ad..f7e4adfcd 100644 --- a/tofu/geom/_core_optics.py +++ b/tofu/geom/_core_optics.py @@ -1195,6 +1195,7 @@ def _checkformat_psidtheta(psi=None, dtheta=None, msg = "psi and dtheta must be 1d arrays fo same size!" raise Exception(msg) + def calc_phibragg_from_xixj(self, xi, xj, n=None, det_cent=None, det_ei=None, det_ej=None, dtheta=None, psi=None, @@ -1210,13 +1211,7 @@ def calc_phibragg_from_xixj(self, xi, xj, n=None, lamb=self._DEFLAMB) # Get local summit nout, e1, e2 if non-centered - psi, dtheta = self._checkformat_psidtheta(psi=psi, dtheta=dtheta) - summit, nout, e1, e2 = self.get_local_noute1e2(dtheta, psi) - - # Compute - bragg, phi = _comp_optics.calc_braggphi_from_xixj( - xii, xjj, det_cent, det_ei, det_ej, - summit, -nout, e1, e2) + bragg, phi = self.calc_phibragg_from_pts(pts) if plot != False: lax = _plot_optics.CrystalBragg_plot_braggangle_from_xixj( @@ -1227,6 +1222,8 @@ def calc_phibragg_from_xixj(self, xi, xj, n=None, braggunits='deg', angunits='deg', **kwdargs) return bragg, phi + + # DEPRECATED ??? def calc_phibragg_from_pts_on_summit(self, pts, n=None): """ Return the bragg angle and phi of pts from crystal summit @@ -1392,9 +1389,10 @@ def calc_phibragg_from_pts(self, pts, dtheta=None, dpsi=None): summit, nout, e1, e2 = self.get_local_noute1e2(dtheta, psi) # Compute - bragg, phi = _comp_optics.calc_braggphi_from_xixj( - xii, xjj, det_cent, det_ei, det_ej, - summit, -nout, e1, e2) + bragg, phi = _comp_optics.calc_braggphi_from_xixjpts( + det_cent, det_ei, det_ej, + summit, -nout, e1, e2, pts=pts) + return phi, bragg def get_lamb_avail_from_pts(self, pts): diff --git a/tofu/version.py b/tofu/version.py index 2055b7bbd..25373e617 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.2-a5-41-ge6b26cc' +__version__ = '1.4.2-a5-42-ge1f9f11' From 6ffce17966f494bde5f8c6b4c97a61e5a650fb8d Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Wed, 18 Dec 2019 11:46:39 +0100 Subject: [PATCH 080/168] [Issue202] Minor changes for better robustness in tofu/geom/_core.py and tofu/imas2tofu/_core.py --- tofu/geom/_core.py | 8 +++++--- tofu/imas2tofu/_core.py | 10 +++++----- tofu/version.py | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/tofu/geom/_core.py b/tofu/geom/_core.py index 4e4021a11..f1384dc2e 100644 --- a/tofu/geom/_core.py +++ b/tofu/geom/_core.py @@ -4141,6 +4141,11 @@ def _complete_dX12(self, dgeom): pinhole = dgeom['D'][:, 0] + k[0]*u[:, 0] dgeom['pinhole'] = pinhole + if np.any(np.isnan(dgeom['D'])): + msg = ("Some LOS have nan as starting point !\n" + + "The geometry may not be provided !") + raise Exception(msg) + # Test if all D are on a common plane or line va = dgeom["D"] - dgeom["D"][:, 0:1] @@ -4209,9 +4214,6 @@ def _complete_dX12(self, dgeom): dgeom["dX12"] = {} dgeom["dX12"].update({"nIn": nIn, "e1": e1, "e2": e2}) - if not self._is2D(): - return dgeom - # Test binning if dgeom["pinhole"] is not None: k1ref = -np.sum( diff --git a/tofu/imas2tofu/_core.py b/tofu/imas2tofu/_core.py index 1145db24c..612a17b67 100644 --- a/tofu/imas2tofu/_core.py +++ b/tofu/imas2tofu/_core.py @@ -1508,10 +1508,10 @@ def add_ids_base(self, occ=None, idd=None, user=user, tokamak=tokamak, version=version, ref=ref, isget=isget, get=get) - def add_ids_for_synthdiag(self, ids=None, occ=None, idd=None, - shot=None, run=None, refshot=None, refrun=None, - user=None, tokamak=None, version=None, - ref=None, isget=None, get=None): + def add_ids_synthdiag(self, ids=None, occ=None, idd=None, + shot=None, run=None, refshot=None, refrun=None, + user=None, tokamak=None, version=None, + ref=None, isget=None, get=None): """ Add pre-tabulated input ids necessary for calculating synth. signal The necessary input ids are given by self.get_inputs_for_synthsignal() @@ -2222,7 +2222,7 @@ def _get_t0(self, t0=None): def to_Config(self, Name=None, occ=None, indDescription=None, plot=True): lidsok = ['wall'] if indDescription is None: - indDescription = 2 + indDescription = 0 # --------------------------- # Preliminary checks on data source consistency diff --git a/tofu/version.py b/tofu/version.py index 25373e617..913701f10 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.2-a5-42-ge1f9f11' +__version__ = '1.4.2-a5-43-g202c2cf' From 39b1a00fd86379b8cc6afdaed7a74419d33afe24 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Wed, 18 Dec 2019 12:19:47 +0100 Subject: [PATCH 081/168] [Issue202] PEP8 Compliance 1 --- tofu/geom/_comp_optics.py | 14 ++++++++++---- tofu/version.py | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/tofu/geom/_comp_optics.py b/tofu/geom/_comp_optics.py index fe31d141a..3f31e95d1 100644 --- a/tofu/geom/_comp_optics.py +++ b/tofu/geom/_comp_optics.py @@ -125,6 +125,7 @@ def get_approx_detector_rel(rcurve, bragg, tangent_to_rowland=None): det_ei_rel = np.r_[np.cos(bragg), np.sin(bragg), 0] return det_dist, n_crystdet_rel, det_nout_rel, det_ei_rel + def get_det_abs_from_rel(det_dist, n_crystdet_rel, det_nout_rel, det_ei_rel, summit, nout, e1, e2, ddist=None, di=None, dj=None, @@ -188,6 +189,7 @@ def checkformat_vectang(Z, nn, frame_cent, frame_ang): return Z, nn, frame_cent, frame_ang + def get_e1e2_detectorplane(nn, nIn): e1 = np.cross(nn, nIn) e1n = np.linalg.norm(e1) @@ -199,6 +201,7 @@ def get_e1e2_detectorplane(nn, nIn): e2 = e2 / np.linalg.norm(e2) return e1, e2 + def calc_xixj_from_braggphi(summit, det_cent, det_nout, det_ei, det_ej, nout, e1, e2, bragg, phi): sp = (det_cent - summit) @@ -212,6 +215,7 @@ def calc_xixj_from_braggphi(summit, det_cent, det_nout, det_ei, det_ej, xj = np.sum((pts - det_cent[:, None])*det_ej[:, None], axis=0) return xi, xj + def calc_braggphi_from_xixjpts(det_cent, det_ei, det_ej, summit, nin, e1, e2, xi=None, xj=None, pts=None): @@ -228,7 +232,8 @@ def calc_braggphi_from_xixjpts(det_cent, det_ei, det_ej, summit = summit[:, None, None] det_cent = det_cent[:, None, None] det_ei, det_ej = det_ei[:, None, None], det_ej[:, None, None] - nin, e1, e2 = nin[:, None, None], e1[:, None, None], e2[:, None, None] + nin, e1, e2 = (nin[:, None, None], + e1[:, None, None], e2[:, None, None]) pts = det_cent + xi*det_ei + xj*det_ej else: assert pts.ndim == 2 @@ -243,6 +248,7 @@ def calc_braggphi_from_xixjpts(det_cent, det_ei, det_ej, phi = np.arctan2(np.sum(vect*e2, axis=0), np.sum(vect*e1, axis=0)) return bragg, phi + def get_lambphifit(lamb, phi, nxi, nxj): lambD = lamb.max()-lamb.min() lambfit = lamb.min() +lambD*np.linspace(0, 1, nxi) @@ -310,11 +316,11 @@ def calc_psidthetaphi_from_pts_lamb(pts, center, rcurve, ntheta, axis=-1)[ind] dtheta[ind] = np.repeat( np.repeat(extenthalf[1]*np.linspace(-1, 1, ntheta)[None, :], - npts, axis=0)[None, ...], + npts, axis=0)[None, ...], nlamb, axis=0)[ind] - psi[ind] = (np.arccos((scaPCem[ind] - - Z*np.sin(dtheta[ind]))/(XYnorm*np.cos(dtheta[ind]))) + psi[ind] = (np.arccos( + (scaPCem[ind] - Z*np.sin(dtheta[ind]))/(XYnorm*np.cos(dtheta[ind]))) + angextra) psi[ind] = np.arctan2(np.sin(psi[ind]), np.cos(psi[ind])) indnan = (~ind) | (np.abs(psi) > extenthalf[0]) diff --git a/tofu/version.py b/tofu/version.py index 913701f10..128bbf124 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.2-a5-43-g202c2cf' +__version__ = '1.4.2-a5-44-g6ffce17' From 29de9d5e14654870778eabaa7b48dc4026cbf221 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Wed, 18 Dec 2019 12:27:28 +0100 Subject: [PATCH 082/168] [Issue202] PEP8 Compliance 2 --- tofu/geom/_core_optics.py | 57 +++++++++++++++++++++------------------ tofu/version.py | 2 +- 2 files changed, 32 insertions(+), 27 deletions(-) diff --git a/tofu/geom/_core_optics.py b/tofu/geom/_core_optics.py index f7e4adfcd..8762194d9 100644 --- a/tofu/geom/_core_optics.py +++ b/tofu/geom/_core_optics.py @@ -332,8 +332,10 @@ def _checkformat_dbragg(cls, dbragg=None): try: if drock.get('sigma') is not None: dbragg['rockingcurve']['sigma'] = float(drock['sigma']) - dbragg['rockingcurve']['deltad'] = float(drock.get('deltad', 0.)) - dbragg['rockingcurve']['Rmax'] = float(drock.get('Rmax', 1.)) + dbragg['rockingcurve']['deltad'] = float( + drock.get('deltad', 0.)) + dbragg['rockingcurve']['Rmax'] = float( + drock.get('Rmax', 1.)) dbragg['rockingcurve']['type'] = 'lorentz-log' elif drock.get('dangle') is not None: c2d = (drock.get('lamb') is not None @@ -344,17 +346,19 @@ def _checkformat_dbragg(cls, dbragg=None): msg = ("Tabulated 2d rocking curve should be:\n" + "\tshape = (dangle.size, lamb.size)") raise Exception(msg) - dbragg['rockingcurve']['dangle'] = np.r_[drock['dangle']] + dbragg['rockingcurve']['dangle'] = np.r_[ + drock['dangle']] dbragg['rockingcurve']['lamb'] = np.r_[drock['lamb']] dbragg['rockingcurve']['value'] = drock['value'] dbragg['rockingcurve']['type'] = 'tabulated-2d' else: if drock.get('lamb') is None: - msg = ("Please also specify the lamb for which the " - + "rocking curve was tabulated!") + msg = ("Please also specify the lamb for which " + + "the rocking curve was tabulated!") raise Exception(msg) dbragg['rockingcurve']['lamb'] = float(drock['lamb']) - dbragg['rockingcurve']['dangle'] = np.r_[drock['dangle']] + dbragg['rockingcurve']['dangle'] = np.r_[ + drock['dangle']] dbragg['rockingcurve']['value'] = np.r_[drock['value']] dbragg['rockingcurve']['type'] = 'tabulated-1d' if drock.get('source') is None: @@ -652,7 +656,8 @@ def get_summary(self, sep=' ', line='-', just='l', # ----------------------- # Build material col0 = ['formula', 'symmetry', 'cut', 'density', - 'd (A)', 'bragg(%s A) (deg)'%str(self._DEFLAMB), 'rocking curve'] + 'd (A)', 'bragg({:7.4} A) (deg)'.format(self._DEFLAMB*1e10), + 'rocking curve'] ar0 = [self._dmat['formula'], self._dmat['symmetry'], str(self._dmat['cut']), str(self._dmat['density']), '{0:5.3f}'.format(self._dmat['d']*1.e10), @@ -783,11 +788,13 @@ def get_rockingcurve_func(self, lamb=None, n=None): + " => Please set lamb accordingly") raise Exception(msg) bragg = self._checkformat_bragglamb(lamb=lamb, n=n) + def func(angle, lamb=lamb, bragg=bragg, drock=drock): return scpinterp.interp2d(drock['dangle']+bragg, drock['lamb'], drock['value'], kind='linear', bounds_error=False, fill_value=0, assume_sorted=True)(angle, lamb) + else: def func(angle, d=d, delta_bragg=delta_bragg, Rmax=drock['Rmax'], sigma=drock['sigma']): @@ -1222,7 +1229,6 @@ def calc_phibragg_from_xixj(self, xi, xj, n=None, braggunits='deg', angunits='deg', **kwdargs) return bragg, phi - # DEPRECATED ??? def calc_phibragg_from_pts_on_summit(self, pts, n=None): """ Return the bragg angle and phi of pts from crystal summit @@ -1237,7 +1243,8 @@ def calc_phibragg_from_pts_on_summit(self, pts, n=None): # Compute vect = pts - self._dgeom['summit'][:, None] vect = vect / np.sqrt(np.sum(vect**2, axis=0)) - bragg = np.pi/2 - np.arccos(np.sum(vect*self._dgeom['nin'][:, None], axis=0)) + bragg = np.pi/2 - np.arccos(np.sum(vect*self._dgeom['nin'][:, None], + axis=0)) v1 = np.sum(vect*self._dgeom['e1'][:, None], axis=0) v2 = np.sum(vect*self._dgeom['e2'][:, None], axis=0) phi = np.arctan2(v2, v1) @@ -1287,7 +1294,7 @@ def plot_line_tracing_on_det(self, lamb=None, n=None, det_ei=det_ei, det_ej=det_ej, plot=False) # Get johann-error raytracing (multiple positions on crystal) - xi_err, xj_err = None, None + xi_er, xj_er = None, None if johann and not rocking: if lpsi is None or ltheta is None: lpsi = np.linspace(-1., 1., 15) @@ -1300,12 +1307,12 @@ def plot_line_tracing_on_det(self, lamb=None, n=None, npsi = lpsi.size assert npsi == ltheta.size - xi_err = np.full((nlamb, npsi*nphi), np.nan) - xj_err = np.full((nlamb, npsi*nphi), np.nan) + xi_er = np.full((nlamb, npsi*nphi), np.nan) + xj_er = np.full((nlamb, npsi*nphi), np.nan) for l in range(nlamb): for ii in range(npsi): i0 = np.arange(ii*nphi, (ii+1)*nphi) - xi_err[l, i0], xj_err[l, i0] = self.calc_xixj_from_phibragg( + xi_er[l, i0], xj_er[l, i0] = self.calc_xixj_from_phibragg( phi=phi, bragg=bragg[l], lamb=None, n=n, theta=ltheta[ii], psi=lpsi[ii], det_cent=det_cent, det_nout=det_nout, @@ -1317,7 +1324,7 @@ def plot_line_tracing_on_det(self, lamb=None, n=None, # Plot ax = _plot_optics.CrystalBragg_plot_line_tracing_on_det( - lamb, xi, xj, xi_err, xj_err, det=det, + lamb, xi, xj, xi_er, xj_er, det=det, johann=johann, rocking=rocking, fs=fs, dmargin=dmargin, wintit=wintit, tit=tit) @@ -1341,7 +1348,6 @@ def calc_johannerror(self, xi=None, xj=None, err=None, """ - # Check / format inputs xi, xj, (xii, xjj) = self._checkformat_xixj(xi, xj) nxi = xi.size if xi is not None else np.unique(xii).size @@ -1394,11 +1400,9 @@ def calc_phibragg_from_pts(self, pts, dtheta=None, dpsi=None): summit, -nout, e1, e2, pts=pts) return phi, bragg - def get_lamb_avail_from_pts(self, pts): pass - def calc_thetapsi_from_lambpts(self, pts=None, lamb=None, n=None, ntheta=None): @@ -1418,7 +1422,7 @@ def calc_thetapsi_from_lambpts(self, pts=None, lamb=None, n=None, self._dgeom['nout'], self._dgeom['e1'], self._dgeom['e2'], self._dgeom['extenthalf'], ntheta=ntheta) - import ipdb; ipdb.set_trace() # DB + # import ipdb; ipdb.set_trace() # DB bragg = np.repeat(np.repeat(bragg[:, None], npts, axis=-1)[..., None], ntheta, axis=-1) bragg[indnan] = np.nan @@ -1428,7 +1432,6 @@ def calc_thetapsi_from_lambpts(self, pts=None, lamb=None, n=None, return dtheta, psi, phi, bragg - def plot_line_from_pts_on_det(self, lamb=None, pts=None, xi_bounds=None, xj_bounds=None, nphi=None, det_cent=None, det_nout=None, @@ -1473,7 +1476,7 @@ def plot_line_from_pts_on_det(self, lamb=None, pts=None, det_ei=det_ei, det_ej=det_ej, plot=False) # Get johann-error raytracing (multiple positions on crystal) - xi_err, xj_err = None, None + xi_er, xj_er = None, None if johann and not rocking: if lpsi is None or ltheta is None: lpsi = np.linspace(-1., 1., 15) @@ -1486,12 +1489,12 @@ def plot_line_from_pts_on_det(self, lamb=None, pts=None, npsi = lpsi.size assert npsi == ltheta.size - xi_err = np.full((nlamb, npsi*nphi), np.nan) - xj_err = np.full((nlamb, npsi*nphi), np.nan) + xi_er = np.full((nlamb, npsi*nphi), np.nan) + xj_er = np.full((nlamb, npsi*nphi), np.nan) for l in range(nlamb): for ii in range(npsi): i0 = np.arange(ii*nphi, (ii+1)*nphi) - xi_err[l, i0], xj_err[l, i0] = self.calc_xixj_from_phibragg( + xi_er[l, i0], xj_er[l, i0] = self.calc_xixj_from_phibragg( phi=phi, bragg=bragg[l], lamb=None, n=n, theta=ltheta[ii], psi=lpsi[ii], det_cent=det_cent, det_nout=det_nout, @@ -1503,7 +1506,7 @@ def plot_line_from_pts_on_det(self, lamb=None, pts=None, # Plot ax = _plot_optics.CrystalBragg_plot_line_tracing_on_det( - lamb, xi, xj, xi_err, xj_err, det=det, + lamb, xi, xj, xi_er, xj_er, det=det, johann=johann, rocking=rocking, fs=fs, dmargin=dmargin, wintit=wintit, tit=tit) @@ -1539,10 +1542,12 @@ def plot_data_vs_lambphi(self, xi=None, xj=None, data=None, mask=None, nlambfit, nphifit) lambfitbins = 0.5*(lambfit[1:] + lambfit[:-1]) ind = np.digitize(lamb, lambfitbins) - spect1d = np.array([np.nanmean(data[ind==ii]) for ii in np.unique(ind)]) + spect1d = np.array([np.nanmean(data[ind == ii]) + for ii in np.unique(ind)]) phifitbins = 0.5*(phifit[1:] + phifit[:-1]) ind = np.digitize(phi, phifitbins) - vertsum1d = np.array([np.nanmean(data[ind==ii]) for ii in np.unique(ind)]) + vertsum1d = np.array([np.nanmean(data[ind == ii]) + for ii in np.unique(ind)]) # Get phiref from mag axis lambax, phiax = None, None diff --git a/tofu/version.py b/tofu/version.py index 128bbf124..088b54876 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.2-a5-44-g6ffce17' +__version__ = '1.4.2-a5-45-g39b1a00' From b5d91931952e15c9fb4528915e6b6f5170d8a170 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Wed, 18 Dec 2019 12:30:56 +0100 Subject: [PATCH 083/168] [Issue202] PEP8 Compliance 3 --- tofu/geom/_plot_optics.py | 42 +++++++++++++++++++-------------------- tofu/version.py | 2 +- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/tofu/geom/_plot_optics.py b/tofu/geom/_plot_optics.py index e166d6a55..9c35ad098 100644 --- a/tofu/geom/_plot_optics.py +++ b/tofu/geom/_plot_optics.py @@ -142,6 +142,7 @@ def CrystalBragg_plot(cryst, lax=None, proj=None, res=None, element=None, ax0.figure.canvas.draw() return dax + def _CrystalBragg_plot_crosshor(cryst, proj=None, dax=None, element=None, res=None, det_cent=None, det_nout=None, @@ -238,16 +239,16 @@ def _CrystalBragg_plot_crosshor(cryst, proj=None, dax=None, p0 = np.repeat(summ[:,None], 3, axis=1) v = np.concatenate((nin[:, None], e1[:, None], e2[:, None]), axis=1) if dax['cross'] is not None: - pr = np.hypot(p0[0,:], p0[1,:]) - vr = np.hypot(p0[0,:]+v[0,:], p0[1,:]+v[1,:]) - pr - dax['cross'].quiver(pr, p0[2,:], - vr, v[2,:], + pr = np.hypot(p0[0, :], p0[1, :]) + vr = np.hypot(p0[0, :]+v[0, :], p0[1, :]+v[1, :]) - pr + dax['cross'].quiver(pr, p0[2, :], + vr, v[2, :], np.r_[0., 0.5, 1.], cmap=quiver_cmap, angles='xy', scale_units='xy', label=cryst.Id.NameLTX+" unit vect", **Vdict) if dax['hor'] is not None: - dax['hor'].quiver(p0[0,:], p0[1,:], - v[0,:], v[1,:], + dax['hor'].quiver(p0[0, :], p0[1, :], + v[0, :], v[1, :], np.r_[0., 0.5, 1.], cmap=quiver_cmap, angles='xy', scale_units='xy', label=cryst.Id.NameLTX+" unit vect", **Vdict) @@ -268,16 +269,16 @@ def _CrystalBragg_plot_crosshor(cryst, proj=None, dax=None, v = np.concatenate((det_nout[:, None], det_ei[:, None], det_ej[:, None]), axis=1) if dax['cross'] is not None: - pr = np.hypot(p0[0,:], p0[1,:]) - vr = np.hypot(p0[0,:]+v[0,:], p0[1,:]+v[1,:]) - pr - dax['cross'].quiver(pr, p0[2,:], - vr, v[2,:], + pr = np.hypot(p0[0, :], p0[1, :]) + vr = np.hypot(p0[0, :]+v[0, :], p0[1, :]+v[1, :]) - pr + dax['cross'].quiver(pr, p0[2, :], + vr, v[2, :], np.r_[0., 0.5, 1.], cmap=quiver_cmap, angles='xy', scale_units='xy', label="det unit vect", **Vdict) if dax['hor'] is not None: - dax['hor'].quiver(p0[0,:], p0[1,:], - v[0,:], v[1,:], + dax['hor'].quiver(p0[0, :], p0[1, :], + v[0, :], v[1, :], np.r_[0., 0.5, 1.], cmap=quiver_cmap, angles='xy', scale_units='xy', label="det unit vect", **Vdict) @@ -407,7 +408,8 @@ def CrystalBragg_plot_braggangle_from_xixj(xi=None, xj=None, def CrystalBragg_plot_line_tracing_on_det(lamb, xi, xj, xi_err, xj_err, det=None, johann=None, rocking=None, - fs=None, dmargin=None, wintit=None, tit=None): + fs=None, dmargin=None, + wintit=None, tit=None): # Check inputs # ------------ @@ -415,9 +417,9 @@ def CrystalBragg_plot_line_tracing_on_det(lamb, xi, xj, xi_err, xj_err, if fs is None: fs = (6, 8) if dmargin is None: - dmargin = {'left':0.05, 'right':0.99, - 'bottom':0.06, 'top':0.92, - 'wspace':None, 'hspace':0.4} + dmargin = {'left': 0.05, 'right': 0.99, + 'bottom': 0.06, 'top': 0.92, + 'wspace': None, 'hspace': 0.4} if wintit is None: wintit = _WINTIT @@ -455,8 +457,6 @@ def CrystalBragg_plot_line_tracing_on_det(lamb, xi, xj, xi_err, xj_err, return [ax0] - - def CrystalBragg_plot_johannerror(xi, xj, lamb, phi, err_lamb, err_phi, cmap=None, vmin=None, vmax=None, fs=None, dmargin=None, wintit=None, tit=None, @@ -470,9 +470,9 @@ def CrystalBragg_plot_johannerror(xi, xj, lamb, phi, err_lamb, err_phi, if cmap is None: cmap = plt.cm.viridis if dmargin is None: - dmargin = {'left':0.05, 'right':0.99, - 'bottom':0.06, 'top':0.92, - 'wspace':None, 'hspace':0.4} + dmargin = {'left': 0.05, 'right': 0.99, + 'bottom': 0.06, 'top': 0.92, + 'wspace': None, 'hspace': 0.4} assert angunits in ['deg', 'rad'] if angunits == 'deg': # bragg = bragg*180./np.pi diff --git a/tofu/version.py b/tofu/version.py index 088b54876..f08e97218 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.2-a5-45-g39b1a00' +__version__ = '1.4.2-a5-46-g29de9d5' From ac0016bdcba1e1f4704f97474883c3b5ea50d011 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Wed, 18 Dec 2019 12:35:15 +0100 Subject: [PATCH 084/168] [Issue202] PEP8 Compliance 4 --- tofu/utils.py | 23 ++++++++++++----------- tofu/version.py | 2 +- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/tofu/utils.py b/tofu/utils.py index 58bf191e0..d47b5494a 100644 --- a/tofu/utils.py +++ b/tofu/utils.py @@ -667,7 +667,7 @@ def load_from_imas(shot=None, run=None, user=None, tokamak=None, version=None, lok = ['Config', 'Plasma2D', 'Cam', 'Data'] c0 = returnas is None or returnas in lok if not c0: - msg = "Arg returnas must be in %s"%str(lok) + msg = "Arg returnas must be in {}".format(str(lok)) raise Exception(msg) # ------------------- @@ -862,15 +862,15 @@ def load_from_imas(shot=None, run=None, user=None, tokamak=None, version=None, # Config if ids[ii] == 'wall': - assert returnas[ii] in [None,'Config'] + assert returnas[ii] in [None, 'Config'] returnas[ii] = 'Config' if returnas[ii] == 'Config': - assert ids[ii] in [None,'wall'] + assert ids[ii] in [None, 'wall'] # Plasma2D lids = imas2tofu.MultiIDSLoader._lidsplasma if ids[ii] in lids: - assert returnas[ii] in [None,'Plasma2D'] + assert returnas[ii] in [None, 'Plasma2D'] returnas[ii] = 'Plasma2D' if returnas[ii] == 'Plasma2D': assert ids[ii] in lids @@ -878,19 +878,20 @@ def load_from_imas(shot=None, run=None, user=None, tokamak=None, version=None, # Cam or Data lids = imas2tofu.MultiIDSLoader._lidsdiag if ids[ii] in lids: - assert returnas[ii] in [None,'Cam','Data'] + assert returnas[ii] in [None, 'Cam', 'Data'] if returnas[ii] is None: returnas[ii] = 'Data' - if returnas[ii] in ['Cam','Data']: + if returnas[ii] in ['Cam', 'Data']: assert ids[ii] in lids - dout = {shot[jj]: {oo:[] for oo in set(returnas)} for jj in range(0,nshot)} + dout = {shot[jj]: {oo:[] for oo in set(returnas)} + for jj in range(0, nshot)} # ------------------- # Prepare plot_ and complement ids - lPla = [ii for ii in range(0,nids) if returnas[ii] == 'Plasma2D'] - lCam = [ii for ii in range(0,nids) if returnas[ii] == 'Cam'] - lDat = [ii for ii in range(0,nids) if returnas[ii] == 'Data'] + lPla = [ii for ii in range(0, nids) if returnas[ii] == 'Plasma2D'] + lCam = [ii for ii in range(0, nids) if returnas[ii] == 'Cam'] + lDat = [ii for ii in range(0, nids) if returnas[ii] == 'Data'] nPla, nCam, nDat = len(lPla), len(lCam), len(lDat) if nDat > 1: plot_ = False @@ -1886,7 +1887,7 @@ def Id(self): return self._Id def _get_dId(self, sep=None): - return {'dict':self.Id.to_dict(sep=sep)} + return {'dict': self.Id.to_dict(sep=sep)} def _reset(self): if hasattr(self,'_Id'): diff --git a/tofu/version.py b/tofu/version.py index f08e97218..a444f573d 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.2-a5-46-g29de9d5' +__version__ = '1.4.2-a5-47-gb5d9193' From c31f86b1f838856955686dc16e5a11ad8824f60c Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Wed, 18 Dec 2019 12:39:16 +0100 Subject: [PATCH 085/168] [Issue202] PEP8 Compliance 5 --- tofu/utils.py | 2 +- tofu/version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tofu/utils.py b/tofu/utils.py index d47b5494a..4b6289428 100644 --- a/tofu/utils.py +++ b/tofu/utils.py @@ -884,7 +884,7 @@ def load_from_imas(shot=None, run=None, user=None, tokamak=None, version=None, if returnas[ii] in ['Cam', 'Data']: assert ids[ii] in lids - dout = {shot[jj]: {oo:[] for oo in set(returnas)} + dout = {shot[jj]: {oo: [] for oo in set(returnas)} for jj in range(0, nshot)} # ------------------- diff --git a/tofu/version.py b/tofu/version.py index a444f573d..4fc937bc2 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.2-a5-47-gb5d9193' +__version__ = '1.4.2-a5-48-gac0016b' From 1ce295f3dd7532cd6ddcb680ef3b7421818b5b4a Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Wed, 18 Dec 2019 15:00:41 +0100 Subject: [PATCH 086/168] [Issue321] Added 2dmeshR and 2dmeshZ to default equilibirium shortcuts --- tofu/imas2tofu/_core.py | 4 +++- tofu/version.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tofu/imas2tofu/_core.py b/tofu/imas2tofu/_core.py index 2a73d5be6..f5b8b16d7 100644 --- a/tofu/imas2tofu/_core.py +++ b/tofu/imas2tofu/_core.py @@ -155,7 +155,9 @@ class MultiIDSLoader(object): '2dBZ':{'str':'time_slice[time].ggd[0].b_field_z[0].values', 'dim':'B', 'quant':'BZ', 'units':'T'}, '2dmeshNodes':{'str':'grids_ggd[0].grid[0].space[0].objects_per_dimension[0].object[].geometry'}, - '2dmeshFaces':{'str':'grids_ggd[0].grid[0].space[0].objects_per_dimension[2].object[].nodes'}}, + '2dmeshFaces':{'str':'grids_ggd[0].grid[0].space[0].objects_per_dimension[2].object[].nodes'}, + '2dmeshR':{'str':'grids_ggd[0].grid[0].space[0].objects_per_dimension[0].object[].geometry'}, + '2dmeshZ':{'str':'grids_ggd[0].grid[0].space[1].objects_per_dimension[0].object[].geometry'}}, 'core_profiles': {'t':{'str':'time'}, diff --git a/tofu/version.py b/tofu/version.py index 52ca3f491..82d0774d0 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.2-a5-15-g231dacd' +__version__ = '1.4.2-a5-20-gad51d41' From 8b7b95e6b2c21b1c68054ea99e6b9922e2d80d02 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Thu, 19 Dec 2019 18:18:07 +0100 Subject: [PATCH 087/168] [Issue321] Almost all synthdiag working, finish testing --- tofu/data/_core.py | 6 ++- tofu/data/_plot.py | 4 +- tofu/geom/_core.py | 3 ++ tofu/imas2tofu/_core.py | 96 ++++++++++++++++++++++++----------------- tofu/version.py | 2 +- 5 files changed, 68 insertions(+), 43 deletions(-) diff --git a/tofu/data/_core.py b/tofu/data/_core.py index 8913c41cd..ea2e534c8 100644 --- a/tofu/data/_core.py +++ b/tofu/data/_core.py @@ -2026,7 +2026,11 @@ def _extract_common_params(obj0, obj1=None): @staticmethod def _recreatefromoperator(d0, other, opfunc): - if type(other) in [int,float,np.int64,np.float64]: + if type(other) in [int, float, np.int64, np.float64]: + data = opfunc(d0.data, other) + dcom = d0._extract_common_params(d0) + + elif isinstance(other, np.ndarray): data = opfunc(d0.data, other) dcom = d0._extract_common_params(d0) diff --git a/tofu/data/_plot.py b/tofu/data/_plot.py index d99cb0abe..17eb6e486 100644 --- a/tofu/data/_plot.py +++ b/tofu/data/_plot.py @@ -364,9 +364,9 @@ def _DataCam12D_plot(lData, key=None, nchMax=_nchMax, ntMax=_ntMax, c0 = [all([dd.dlabels[kk] == lData[0].dlabels[kk] for dd in lData[1:]]) for kk in ['t','X','data']] if not all(c0): - msg = "All Data objects must have the same:\n" + msg = "All Data objects do not have the same:\n" msg += " dlabels['t'], dlabels['X'] and dlabels['data'] !" - raise Exception(msg) + warnings.warn(msg) # --------- diff --git a/tofu/geom/_core.py b/tofu/geom/_core.py index f1384dc2e..22d70698e 100644 --- a/tofu/geom/_core.py +++ b/tofu/geom/_core.py @@ -5968,6 +5968,9 @@ def _calc_signal_postformat( if Brightness is False: if dataname is None: dataname = r"LOS-integral x Etendue" + if E is None or np.all(np.isnan(E)): + msg = "Cannot use etendue, it was not set properly !" + raise Exception(msg) if t is None or len(t) == 1 or E.size == 1: sig = sig * E else: diff --git a/tofu/imas2tofu/_core.py b/tofu/imas2tofu/_core.py index b1a704093..5407deb10 100644 --- a/tofu/imas2tofu/_core.py +++ b/tofu/imas2tofu/_core.py @@ -156,8 +156,8 @@ class MultiIDSLoader(object): 'dim':'B', 'quant':'BZ', 'units':'T'}, '2dmeshNodes':{'str':'grids_ggd[0].grid[0].space[0].objects_per_dimension[0].object[].geometry'}, '2dmeshFaces':{'str':'grids_ggd[0].grid[0].space[0].objects_per_dimension[2].object[].nodes'}, - '2dmeshR':{'str':'grids_ggd[0].grid[0].space[0].objects_per_dimension[0].object[].geometry'}, - '2dmeshZ':{'str':'grids_ggd[0].grid[0].space[1].objects_per_dimension[0].object[].geometry'}}, + '2dmeshR':{'str':'time_slice[0].profiles_2d[0].r'}, + '2dmeshZ':{'str':'time_slice[0].profiles_2d[0].z'}}, 'core_profiles': {'t':{'str':'time'}, @@ -304,7 +304,8 @@ class MultiIDSLoader(object): {'t':{'str':'time', 'quant':'t', 'units':'s'}, 'ne_integ':{'str':'channel[chan].n_e_line.data', - 'dim':'ne_integ', 'quant':'ne_integ', 'units':'/m2'}}, + 'dim':'ne_integ', 'quant':'ne_integ', + 'units':'/m2', 'Brightness': True}}, 'polarimeter': {'t':{'str':'time', @@ -312,13 +313,15 @@ class MultiIDSLoader(object): 'lamb':{'str':'channel[chan].wavelength', 'dim':'distance', 'quant':'wavelength', 'units':'m'}, 'fangle':{'str':'channel[chan].faraday_angle.data', - 'dim':'angle', 'quant':'faraday angle', 'units':'rad'}}, + 'dim':'angle', 'quant':'faraday angle', + 'units':'rad', 'Brightness': True}}, 'bolometer': {'t':{'str':'channel[chan].power.time', 'quant':'t', 'units':'s'}, 'power':{'str':'channel[chan].power.data', - 'dim':'power', 'quant':'power radiative', 'units':'W'}, + 'dim':'power', 'quant':'power radiative', 'units':'W', + 'Brightness': False}, 'etendue':{'str':'channel[chan].etendue', 'dim':'etendue', 'quant':'etendue', 'units':'m2.sr'}, @@ -333,9 +336,11 @@ class MultiIDSLoader(object): {'t':{'str':'time', 'quant':'t', 'units':'s'}, 'power':{'str':'channel[chan].power.data', - 'dim':'power', 'quant':'power radiative', 'units':'W'}, + 'dim':'power', 'quant':'power radiative', 'units':'W', + 'Brightness': False}, 'brightness':{'str':'channel[chan].brightness.data', - 'dim':'brightness', 'quant':'brightness', 'units':'W/(m2.sr)'}, + 'dim':'brightness', 'quant':'brightness', + 'units':'W/(m2.sr)', 'Brightness': True}, 'etendue':{'str':'channel[chan].etendue', 'dim':'etendue', 'quant':'etendue', 'units':'m2.sr'}}, @@ -343,7 +348,8 @@ class MultiIDSLoader(object): {'t':{'str':'channel[chan].grating_spectrometer.radiance_spectral.time', 'quant':'t', 'units':'s'}, 'spectra':{'str':'channel[chan].grating_spectrometer.radiance_spectral.data', - 'dim':'radiance_spectral', 'quant':'radiance_spectral', 'units':'ph/s/(m2.sr)/m'}, + 'dim':'radiance_spectral', 'quant':'radiance_spectral', + 'units':'ph/s/(m2.sr)/m', 'Brightness': True}, 'lamb':{'str':'channel[chan].grating_spectrometer.wavelengths', 'dim':'wavelength', 'quant':'wavelength', 'units':'m'}}, @@ -352,7 +358,7 @@ class MultiIDSLoader(object): 'quant':'t', 'units':'s'}, 'radiance':{'str':'channel[chan].radiance_spectral.data', 'dim':'radiance_spectral', 'quant':'radiance_spectral', - 'units':'ph/s/(m2.sr)/m'}, + 'units':'ph/s/(m2.sr)/m', 'Brightness': True}, 'lamb_up': {'str':'channel[chan].filter.wavelength_upper'}, 'lamb_lo': {'str':'channel[chan].filter.wavelength_lower'}}, } @@ -485,7 +491,7 @@ def _rhopn1d(psi): def _rhopn2d(psi, psi0, psisep): return np.sqrt( (psi - psi0[:,None]) / (psisep[:,None] - psi0[:,None]) ) def _rhotn2d(phi): - return np.sqrt(phi / np.nanmax(phi, axis=1)[:,None]) + return np.sqrt(np.abs(phi) / np.nanmax(np.abs(phi), axis=1)[:,None]) def _eqSep(sepR, sepZ, npts=100): nt = len(sepR) @@ -2302,7 +2308,8 @@ def _checkformat_Plasma2D_dsig(self, dsig=None): lidsok = set(self._lidsplasma).intersection(self._dids.keys()) lscom = ['t'] - lsmesh = ['2dmeshNodes','2dmeshFaces'] + lsmesh = ['2dmeshNodes', '2dmeshFaces', + '2dmeshR', '2dmeshZ'] lc = [dsig is None, type(dsig) is str, @@ -2491,7 +2498,8 @@ def _checkformat_mesh_Rect(R, Z, datashape=None, assert R.ndim in [1, 2] assert Z.ndim in [1, 2] shapeu = np.unique(np.r_[R.shape, Z.shape]) - shapeRZ = [None, None] + if shapeRZ is None: + shapeRZ = [None, None] if R.ndim == 1: assert np.all(np.diff(R) > 0.) else: @@ -2528,37 +2536,25 @@ def _checkformat_mesh_Rect(R, Z, datashape=None, if datashape is not None: if None in shapeRZ: pass + shapeRZ = tuple(shapeRZ) - if shapeRZ == ['R', 'Z']: + if shapeRZ == ('R', 'Z'): assert datashape == (R.size, Z.size) - elif shapeRZ == ['Z', 'R']: + elif shapeRZ == ('Z', 'R'): assert datashape == (Z.size, R.size) else: msg = "Inconsistent data shape !" raise Exception(msg) - shapeRZ = tuple(shapeRZ) - assert shapeRZ in [('R', 'Z'), ('Z', 'R')] + if None not in shapeRZ: + shapeRZ = tuple(shapeRZ) + assert shapeRZ in [('R', 'Z'), ('Z', 'R')] return R, Z, shapeRZ, 0 - - - - - - - - - # TBF def get_mesh_from_ggd(path_to_ggd, ggdindex=0): pass - - - - - def _get_dextra(self, dextra=None, fordata=False, nan=True, pos=None): lc = [dextra == False, dextra is None, type(dextra) is str, type(dextra) is list, type(dextra) is dict] @@ -2843,7 +2839,7 @@ def to_Plasma2D(self, tlim=None, dsig=None, t0=None, npts, datashape = None, None keym = '{}.mesh'.format(ids) if cmesh else None for ss in set(out_.keys()).difference(lsigmesh): - assert out_[ss].ndim in [1,2] + assert out_[ss].ndim in [1, 2, 3] if out_[ss].ndim == 1: out_[ss] = np.atleast_2d(out_[ss]) shape = out_[ss].shape @@ -2866,10 +2862,10 @@ def to_Plasma2D(self, tlim=None, dsig=None, t0=None, shape = out_[ss].shape if len(shape) == 3: assert nt == shape[0] - datashape = tuple(shape[1], shape[2]) + datashape = (shape[1], shape[2]) if shapeRZ is None: - msg = ("Please provide shapeRZ" - + "indexing is ambiguous") + msg = ("Please provide shapeRZ," + + " indexing is ambiguous") raise Exception(msg) size = shape[1]*shape[2] if shapeRZ == ('R', 'Z'): @@ -3384,7 +3380,6 @@ def to_Data(self, ids=None, dsig=None, data=None, X=None, tlim=None, fallback_X = 1.1*np.nanmax(dins['X']) dins['X'][np.isnan(dins['X'])] = fallback_X - # Apply indt if was not done in get_data for kk,vv in dins.items(): if (vv.ndim == 2 or kk == 't') and vv.shape[0] > indt.size: @@ -3594,10 +3589,31 @@ def calc_signal(self, ids=None, dsig=None, tlim=None, t=None, res=None, sig._dextra = plasma.get_dextra(dextra) if ids == 'interferometer': - sig = 2.*sig + pass + i#sig = 2.*sig elif ids == 'polarimeter': sig = 2.*sig + # Safety check regarding Brightness + _, _, dsig_exp = self._checkformat_Data_dsig(ids) + kdata = dsig_exp['data'] + B_exp = self._dshort[ids][kdata].get('Brightness', None) + err_comp = False + if Brightness != B_exp: + u_exp = self._dshort[ids][kdata].get('units') + msg = ("\nCalculated synthetic and chosen experimental data " + + "do not seem directly comparable !\n" + + "\t- chosen experimental data: " + + "{}, ({}), Brightness = {}\n".format(kdata, + u_exp, B_exp) + + "\t- calculated synthetic data: " + + "int({}), ({}), Brightness = {}\n".format(dq['quant'], + units, + Brightness) + + "\n => Consider changing data or Brigthness value") + err_comp = True + warnings.warn(msg) + # plot if plot: if plot_compare is None: @@ -3605,6 +3621,8 @@ def calc_signal(self, ids=None, dsig=None, tlim=None, t=None, res=None, if plot_plasma is None: plot_plasma = True if plot_compare: + if err_comp: + raise Exception(msg) data = self.to_Data(ids, indch=indch, t0=t0, plot=False) sig._dlabels = data.dlabels data.plot_compare(sig) @@ -3980,11 +3998,11 @@ def _save_to_imas_Config( obj, idd=None, shotfile=None, raise Exception(msg) if description_2d is None: - if nS == 1 and lcls[0] in ['Ves', 'PlasmaDomain']: + if nS == 1 and lcls[0] in ['Ves','PlasmaDomain']: description_2d = 0 else: - description_2d = 2 - assert description_2d in [0, 2] + descrption_2d = 2 + assert description_2d in [0,2] # Make sure StructIn is last (IMAS requirement) ind = lcls.index(lclsIn[0]) diff --git a/tofu/version.py b/tofu/version.py index 218608ae8..da96dc8cb 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.2-a5-21-g1ce295f' +__version__ = '1.4.2-a5-51-gbc47291' From ccc8ff32e0e60576702064f43047e3c8184c4290 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Mon, 6 Jan 2020 15:25:18 +0100 Subject: [PATCH 088/168] [Issue321] Warning more explicit for missing subpackages (print()) --- tofu/__init__.py | 2 +- tofu/version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tofu/__init__.py b/tofu/__init__.py index b2defb789..4ef97c747 100644 --- a/tofu/__init__.py +++ b/tofu/__init__.py @@ -91,7 +91,7 @@ lsubout = ['tofu.{0}'.format(ss) for ss in lsubout] msg = "\nThe following subpackages are not available:" msg += "\n - " + "\n - ".join(lsubout) - msg += "\n => see tofu.dsub[] for details." + msg += "\n => see print(tofu.dsub[]) for details." warnings.warn(msg) # ------------------------------------- diff --git a/tofu/version.py b/tofu/version.py index da96dc8cb..ac7bac2ee 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.2-a5-51-gbc47291' +__version__ = '1.4.2-a5-52-g8b7b95e' From 57ccad42190a78ff0b19029b22c3b02b01491424 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Mon, 6 Jan 2020 15:26:02 +0100 Subject: [PATCH 089/168] [Issue321] Harmonized variable name indDescription -> description_2d for loading config from imas --- tofu/utils.py | 6 +++--- tofu/version.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tofu/utils.py b/tofu/utils.py index 4b6289428..a6b285d25 100644 --- a/tofu/utils.py +++ b/tofu/utils.py @@ -648,7 +648,7 @@ def _get_exception(q, ids, qtype='quantity'): def load_from_imas(shot=None, run=None, user=None, tokamak=None, version=None, ids=None, Name=None, returnas=None, tlim=None, config=None, - occ=None, indch=None, indDescription=None, equilibrium=None, + occ=None, indch=None, description_2d=None, equilibrium=None, dsig=None, data=None, X=None, t0=None, dextra=None, plot=True, plot_sig=None, plot_X=None, sharex=False, invertx=None, @@ -973,7 +973,7 @@ def load_from_imas(shot=None, run=None, user=None, tokamak=None, version=None, for ii in range(0,nids): if returnas[ii] == 'Config': dout[ss]['Config'].append(multi.to_Config(Name=Name, occ=occ, - indDescription=indDescription, + description_2d=description_2d, plot=False)) elif returnas[ii] == 'Plasma2D': @@ -1037,7 +1037,7 @@ def load_from_imas(shot=None, run=None, user=None, tokamak=None, version=None, def calc_from_imas(shot=None, run=None, user=None, tokamak=None, version=None, ids=None, Name=None, out=None, tlim=None, config=None, - occ=None, indch=None, indDescription=None, equilibrium=None, + occ=None, indch=None, description_2d=None, equilibrium=None, dsig=None, data=None, X=None, t0=None, dextra=None, Brightness=None, res=None, interp_t=None, plot=True, plot_compare=True, sharex=False, diff --git a/tofu/version.py b/tofu/version.py index ac7bac2ee..8e6941766 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.2-a5-52-g8b7b95e' +__version__ = '1.4.2-a5-53-gccc8ff3' From af693deb2eb2dbb746d704c0059e1b9e8f49d38f Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Mon, 6 Jan 2020 15:27:21 +0100 Subject: [PATCH 090/168] [Issue321] imas2tofu._save_to_imas_Config() now complying with new strategy : vessel in vessel, PFC in limiter or mobile units if any mobile, and more descriptions written --- tofu/imas2tofu/_core.py | 233 ++++++++++++++++++++++++++++++---------- tofu/version.py | 2 +- 2 files changed, 175 insertions(+), 60 deletions(-) diff --git a/tofu/imas2tofu/_core.py b/tofu/imas2tofu/_core.py index 5407deb10..3513cc717 100644 --- a/tofu/imas2tofu/_core.py +++ b/tofu/imas2tofu/_core.py @@ -650,7 +650,9 @@ def __init__(self, preset=None, dids=None, ids=None, occ=None, idd=None, idd = lidd[0] if len(lidd) > 0 else None self.add_ids(preset=preset, ids=ids, occ=occ, idd=idd, get=False) if ids_base is None: - ids_base = True + if not all([iids in self._IDS_BASE + for iids in self._dids.keys()]): + ids_base = True if ids_base is True: self.add_ids_base(get=False) if synthdiag is None: @@ -2227,10 +2229,11 @@ def _get_t0(self, t0=None): return t0 - def to_Config(self, Name=None, occ=None, indDescription=None, plot=True): + def to_Config(self, Name=None, occ=None, + description_2d=None, mobile=None, plot=True): lidsok = ['wall'] - if indDescription is None: - indDescription = 0 + if description_2d is None: + description_2d = 0 # --------------------------- # Preliminary checks on data source consistency @@ -2251,52 +2254,105 @@ def to_Config(self, Name=None, occ=None, indDescription=None, plot=True): occ = occ[0] indoc = np.nonzero(self._dids[ids]['occ'] == occ)[0][0] - wall = self._dids[ids]['ids'][indoc] - units = wall.description_2d[indDescription].limiter.unit + wall = self._dids[ids]['ids'][indoc].description_2d[description_2d] + kwargs = dict(Exp=Exp, Type='Tor') + + import tofu.geom as mod + + # Get vessel + if len(wall.vessel.unit) != 1: + msg = "There is no / several vessel.unit!" + raise Exception(msg) + if len(wall.vessel.unit[0].element) != 1: + msg = "There is no / several vessel.unit[0].element!" + raise Exception(msg) + name = wall.vessel.unit[0].element[0].name + cls = None + if name == '': + name = 'ImasVessel' + if '_' in name: + ln = name.split('_') + if len(ln) == 2: + cls, name = ln + else: + name = name.replace('_', '') + if cls is None: + cls = 'Ves' + assert cls in ['Ves', 'PlasmaDomain'] + poly = np.array([wall.vessel.unit[0].element[0].outline.r, + wall.vessel.unit[0].element[0].outline.z]) + ves = getattr(mod, cls)(Poly=poly, Name=name, **kwargs) + + # Determine if mobile or not + if mobile is None: + nlim = len(wall.limiter.unit) + nmob = len(wall.mobile.unit) + if nlim == 0 and nmob > 0: + mobile = True + elif nmob == 0 and nlim > 0: + mobile = False + else: + msg = ("Can't decide automatically whether to choose" + + " limiter or mobile!") + raise Exception(msg) + assert isinstance(mobile, bool) + + # Get PFC + if mobile is True: + units = wall.mobile.unit + else: + units = wall.limiter.unit nunits = len(units) if nunits == 0: - msg = "There is no limiter unit stored !\n" + msg = "There is no unit stored !\n" msg += "The required 2d description is empty:\n" - ms = "len(idd.%s[occ=%s].description_2d"%(ids,str(occ)) - msg += "%s[%s].limiter.unit) = 0"%(ms,str(indDescription)) + ms = "len(idd.%s[occ=%s].description_2d"%(ids, str(occ)) + msg += "%s[%s].limiter.unit) = 0"%(ms, str(description_2d)) raise Exception(msg) if Name is None: - Name = wall.description_2d[indDescription].type.name + Name = wall.type.name if Name == '': Name = 'imas wall' - import tofu.geom as mod - lS = [None for _ in units] - kwargs = dict(Exp=Exp, Type='Tor') - for ii in range(0,nunits): - poly = np.array([units[ii].outline.r, units[ii].outline.z]) - - if units[ii].phi_extensions.size > 0: - pos, extent = units[ii].phi_extensions.T - else: - pos, extent = None, None - name = units[ii].name - cls = None - if name == '': - name = 'unit{:02.0f}'.format(ii) - if '_' in name: - ln = name.split('_') - if len(ln) == 2: - cls, name = ln + for ii in range(0, nunits): + try: + if mobile is True: + outline = units[ii].outline[0] else: - name = name.replace('_','') - if cls is None: - if ii == nunits-1: - cls = 'Ves' + outline = units[ii].outline + poly = np.array([outline.r, outline.z]) + + if units[ii].phi_extensions.size > 0: + pos, extent = units[ii].phi_extensions.T else: - cls = 'PFC' - lS[ii] = getattr(mod,cls)(Poly=poly, pos=pos, extent=extent, - Name=name, **kwargs) + pos, extent = None, None + name = units[ii].name + cls = None + if name == '': + name = 'unit{:02.0f}'.format(ii) + if '_' in name: + ln = name.split('_') + if len(ln) == 2: + cls, name = ln + else: + name = name.replace('_','') + if cls is None: + if ii == nunits-1: + cls = 'Ves' + else: + cls = 'PFC' + lS[ii] = getattr(mod, cls)(Poly=poly, pos=pos, extent=extent, + Name=name, **kwargs) + except Exception as err: + msg = ("PFC unit[{}] named {} ".format(ii, name) + + "could not be loaded!\n" + + str(err)) + raise Exception(msg) - config = mod.Config(lStruct=lS, Name=Name, **kwargs) + config = mod.Config(lStruct=[ves] + lS, Name=Name, **kwargs) # Output if plot: @@ -3644,7 +3700,7 @@ def calc_signal(self, ids=None, dsig=None, tlim=None, t=None, res=None, def load_Config(shot=None, run=None, user=None, tokamak=None, version=None, - Name=None, occ=0, indDescription=0, plot=True): + Name=None, occ=0, description_2d=0, plot=True): didd = MultiIDSLoader() didd.add_idd(shot=shot, run=run, @@ -3652,7 +3708,7 @@ def load_Config(shot=None, run=None, user=None, tokamak=None, version=None, didd.add_ids('wall', get=True) return didd.to_Config(Name=Name, occ=occ, - indDescription=indDescription, plot=plot) + description_2d=description_2d, plot=plot) # occ ? @@ -3921,10 +3977,19 @@ def _save_to_imas_Struct( obj, shot=None, run=None, refshot=None, refrun=None, occ=None, user=None, tokamak=None, version=None, dryrun=False, tfversion=None, verb=True, - description_2d=0, unit=0): + description_2d=None, description_typeindex=None, + unit=None): if occ is None: occ = 0 + if description_2d is None: + description_2d = 0 + if description_typeindex is None: + description_typeindex = 2 + description_typeindex = int(description_typeindex) + if unit is None: + unit = 0 + # Create or open IDS # ------------------ idd, shotfile = _open_create_idd(shot=shot, run=run, @@ -3938,8 +4003,19 @@ def _save_to_imas_Struct( obj, # data # -------- idd.wall.description_2d.resize( description_2d + 1 ) - idd.wall.description_2d[description_2d].limiter.unit.resize(1) - node = idd.wall.description_2d[description_2d].limiter.unit[0] + idd.wall.description_2d[description_2d].type.index = ( + description_typeindex) + idd.wall.description_2d[description_2d].type.name = ( + '%s_%s'%(obj.__class__.__name__, obj.Id.Name)) + idd.wall.description_2d[description_2d].type.description = ( + "tofu-generated wall. Each PFC is represented independently as a" + + " closed polygon in tofu, which saves them as disjoint PFCs") + if obj._dgeom['mobile'] is True: + idd.wall.description_2d[description_2d].mobile.unit.resize(unit+1) + node = idd.wall.description_2d[description_2d].mobile.unit[unit] + else: + idd.wall.description_2d[description_2d].limiter.unit.resize(unit+1) + node = idd.wall.description_2d[description_2d].limiter.unit[unit] node.outline.r = obj._dgeom['Poly'][0,:] node.outline.z = obj._dgeom['Poly'][1,:] if obj.noccur > 0: @@ -3973,10 +4049,13 @@ def _save_to_imas_Config( obj, idd=None, shotfile=None, shot=None, run=None, refshot=None, refrun=None, occ=None, user=None, tokamak=None, version=None, dryrun=False, tfversion=None, close=True, verb=True, - description_2d=None): + description_2d=None, description_typeindex=None): if occ is None: occ = 0 + if description_2d is None: + description_2d = 0 + # Create or open IDS # ------------------ if idd is None: @@ -3994,20 +4073,22 @@ def _save_to_imas_Config( obj, idd=None, shotfile=None, nS = len(lS) if len(lclsIn) != 1: - msg = "One StructIn subclass is allowed / necessary !" + msg = "One (and only one) StructIn subclass is allowed / necessary !" raise Exception(msg) - if description_2d is None: + if description_typeindex is None: if nS == 1 and lcls[0] in ['Ves','PlasmaDomain']: - description_2d = 0 + description_typeindex = 0 else: - descrption_2d = 2 - assert description_2d in [0,2] + description_typeindex = 2 + assert description_typeindex in [0, 2] - # Make sure StructIn is last (IMAS requirement) - ind = lcls.index(lclsIn[0]) - lS[-1], lS[ind] = lS[ind], lS[-1] + # Check whether there is any mobile element + ismobile = any([ss._dgeom['mobile'] for ss in lS]) + # Isolate StructIn and take out from lS + ves = lS.pop( lcls.index(lclsIn[0]) ) + nS = len(lS) # Fill in data # ------------------ @@ -4016,16 +4097,50 @@ def _save_to_imas_Config( obj, idd=None, shotfile=None, # -------- idd.wall.description_2d.resize( description_2d + 1 ) idd.wall.description_2d[description_2d].type.name = obj.Id.Name - idd.wall.description_2d[description_2d].limiter.unit.resize(nS) - for ii in range(0,nS): - node = idd.wall.description_2d[description_2d].limiter.unit[ii] - node.outline.r = lS[ii].Poly_closed[0,:] - node.outline.z = lS[ii].Poly_closed[1,:] - if lS[ii].noccur > 0: - node.phi_extensions = np.array([lS[ii].pos, lS[ii].extent]).T - node.closed = True - node.name = '%s_%s'%(lS[ii].__class__.__name__, lS[ii].Id.Name) + idd.wall.description_2d[description_2d].type.index = ( + description_typeindex) + idd.wall.description_2d[description_2d].type.description = ( + "tofu-generated wall. Each PFC is represented independently as a" + + " closed polygon in tofu, which saves them as disjoint PFCs") + + # Fill limiter / mobile + if ismobile: + idd.wall.description_2d[description_2d].mobile.unit.resize(nS) + units = idd.wall.description_2d[description_2d].mobile.unit + for ii in range(0, nS): + units[ii].outline.resize(1) + units[ii].outline[0].r = lS[ii].Poly[0, :] + units[ii].outline[0].z = lS[ii].Poly[1, :] + if lS[ii].noccur > 0: + units[ii].phi_extensions = np.array([lS[ii].pos, lS[ii].extent]).T + units[ii].closed = True + units[ii].name = '%s_%s'%(lS[ii].__class__.__name__, lS[ii].Id.Name) + else: + idd.wall.description_2d[description_2d].limiter.unit.resize(nS) + units = idd.wall.description_2d[description_2d].limiter.unit + for ii in range(0, nS): + units[ii].outline.r = lS[ii].Poly[0, :] + units[ii].outline.z = lS[ii].Poly[1, :] + if lS[ii].noccur > 0: + units[ii].phi_extensions = np.array([lS[ii].pos, lS[ii].extent]).T + units[ii].closed = True + units[ii].name = '%s_%s'%(lS[ii].__class__.__name__, lS[ii].Id.Name) + + + # Fill vessel + vesname = '%s_%s'%(ves.__class__.__name__, ves.Id.Name) + idd.wall.description_2d[description_2d].vessel.name = vesname + idd.wall.description_2d[description_2d].vessel.index = 1 + idd.wall.description_2d[description_2d].vessel.description = ( + "tofu-generated vessel outline, with a unique unit / element") + + idd.wall.description_2d[description_2d].vessel.unit.resize(1) + idd.wall.description_2d[description_2d].vessel.unit[0].element.resize(1) + element = idd.wall.description_2d[description_2d].vessel.unit[0].element[0] + element.name = vesname + element.outline.r = ves.Poly[0, :] + element.outline.z = ves.Poly[1, :] # IDS properties # -------------- diff --git a/tofu/version.py b/tofu/version.py index 8e6941766..bef5e00fd 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.2-a5-53-gccc8ff3' +__version__ = '1.4.2-a5-54-g57ccad4' From 3940393e81cbe578ed0283cacec78b43dd87cde9 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Mon, 6 Jan 2020 15:36:36 +0100 Subject: [PATCH 091/168] [Issue321] info about whether Struct is mobile now stored in name of mobile.unit, to avoid loss of info --- tofu/imas2tofu/_core.py | 18 ++++++++++++++---- tofu/version.py | 2 +- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/tofu/imas2tofu/_core.py b/tofu/imas2tofu/_core.py index 3513cc717..a1f2dbd99 100644 --- a/tofu/imas2tofu/_core.py +++ b/tofu/imas2tofu/_core.py @@ -2330,13 +2330,15 @@ def to_Config(self, Name=None, occ=None, else: pos, extent = None, None name = units[ii].name - cls = None + cls, mobi = None, None if name == '': name = 'unit{:02.0f}'.format(ii) if '_' in name: ln = name.split('_') if len(ln) == 2: cls, name = ln + elif len(ln) == 3: + cls, name, mobi = ln else: name = name.replace('_','') if cls is None: @@ -2344,8 +2346,9 @@ def to_Config(self, Name=None, occ=None, cls = 'Ves' else: cls = 'PFC' + mobi = mobi == 'mobile' lS[ii] = getattr(mod, cls)(Poly=poly, pos=pos, extent=extent, - Name=name, **kwargs) + Name=name, mobile=mobi, **kwargs) except Exception as err: msg = ("PFC unit[{}] named {} ".format(ii, name) + "could not be loaded!\n" @@ -4114,7 +4117,11 @@ def _save_to_imas_Config( obj, idd=None, shotfile=None, if lS[ii].noccur > 0: units[ii].phi_extensions = np.array([lS[ii].pos, lS[ii].extent]).T units[ii].closed = True - units[ii].name = '%s_%s'%(lS[ii].__class__.__name__, lS[ii].Id.Name) + name = '%s_%s'%(lS[ii].__class__.__name__, lS[ii].Id.Name) + if lS[ii]._dgeom['mobile'] is True: + name = name + '_mobile' + units[ii].name = name + else: idd.wall.description_2d[description_2d].limiter.unit.resize(nS) @@ -4125,7 +4132,10 @@ def _save_to_imas_Config( obj, idd=None, shotfile=None, if lS[ii].noccur > 0: units[ii].phi_extensions = np.array([lS[ii].pos, lS[ii].extent]).T units[ii].closed = True - units[ii].name = '%s_%s'%(lS[ii].__class__.__name__, lS[ii].Id.Name) + name = '%s_%s'%(lS[ii].__class__.__name__, lS[ii].Id.Name) + if lS[ii]._dgeom['mobile'] is True: + name = name + '_mobile' + units[ii].name = name # Fill vessel diff --git a/tofu/version.py b/tofu/version.py index bef5e00fd..4134bb98e 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.2-a5-54-g57ccad4' +__version__ = '1.4.2-a5-55-gaf693de' From d1f438e17faa343991349b28de59a3064113f510 Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Mon, 6 Jan 2020 18:02:49 +0100 Subject: [PATCH 092/168] speeding up new calc --- tofu/geom/_GG.pyx | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/tofu/geom/_GG.pyx b/tofu/geom/_GG.pyx index 7143e078f..7f3919bea 100644 --- a/tofu/geom/_GG.pyx +++ b/tofu/geom/_GG.pyx @@ -2988,13 +2988,18 @@ def LOS_calc_signal(func, double[:,::1] ray_orig, double[:,::1] ray_vdir, res, # Integrate if n_imode == 0: # "sum" integration mode # .. integrating function .......................................... - for ii in range(nlos): - if ii > 0: - sig[:,ii] = np.sum(val_2d[:, ind_arr[ii-1]:ind_arr[ii]], - axis=-1) * reseff_arr[ii] - else: - sig[:,0] = np.sum(val_2d[:, 0:ind_arr[0]], - axis=-1) * reseff_arr[0] + #reseff = np.copy(np.asarray(reseff_arr[0])) + reseff_mv = reseff + indices = np.copy(np.asarray(ind_arr).astype(int)) + sig = np.add.reduceat(val_2d, np.r_[0, indices], + axis=-1)*reseff_mv[None, :] + # for ii in range(nlos): + # if ii > 0: + # sig[:,ii] = np.sum(val_2d[:, ind_arr[ii-1]:ind_arr[ii]], + # axis=-1) * reseff_arr[ii] + # else: + # sig[:,0] = np.sum(val_2d[:, 0:ind_arr[0]], + # axis=-1) * reseff_arr[0] # Cleaning up... free(coeff_ptr[0]) free(coeff_ptr) From 70e63e0394ab80744386d0a431b194cff2702f96 Mon Sep 17 00:00:00 2001 From: "Laura S. Mendoza" Date: Mon, 6 Jan 2020 19:02:15 +0100 Subject: [PATCH 093/168] [enhacement] defined res and indices the right way, erased old code --- tofu/geom/_GG.pyx | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/tofu/geom/_GG.pyx b/tofu/geom/_GG.pyx index 7f3919bea..6ed2f1a10 100644 --- a/tofu/geom/_GG.pyx +++ b/tofu/geom/_GG.pyx @@ -2988,18 +2988,10 @@ def LOS_calc_signal(func, double[:,::1] ray_orig, double[:,::1] ray_vdir, res, # Integrate if n_imode == 0: # "sum" integration mode # .. integrating function .......................................... - #reseff = np.copy(np.asarray(reseff_arr[0])) - reseff_mv = reseff - indices = np.copy(np.asarray(ind_arr).astype(int)) + reseffs = np.copy(np.asarray(reseff_arr)) + indices = np.copy(np.asarray(ind_arr).astype(int)) sig = np.add.reduceat(val_2d, np.r_[0, indices], - axis=-1)*reseff_mv[None, :] - # for ii in range(nlos): - # if ii > 0: - # sig[:,ii] = np.sum(val_2d[:, ind_arr[ii-1]:ind_arr[ii]], - # axis=-1) * reseff_arr[ii] - # else: - # sig[:,0] = np.sum(val_2d[:, 0:ind_arr[0]], - # axis=-1) * reseff_arr[0] + axis=-1)*reseffs[None, :] # Cleaning up... free(coeff_ptr[0]) free(coeff_ptr) From ac2a365bc8ff566946f5b8b7105c4da758d75008 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Tue, 7 Jan 2020 10:31:05 +0100 Subject: [PATCH 094/168] [Issue321] MultiIDSLoader.to_Config() now operational again from velle and limiter --- tofu/imas2tofu/_core.py | 160 ++++++++++++++++++++++------------------ tofu/version.py | 2 +- 2 files changed, 90 insertions(+), 72 deletions(-) diff --git a/tofu/imas2tofu/_core.py b/tofu/imas2tofu/_core.py index a1f2dbd99..597e5f4e5 100644 --- a/tofu/imas2tofu/_core.py +++ b/tofu/imas2tofu/_core.py @@ -2260,13 +2260,33 @@ def to_Config(self, Name=None, occ=None, import tofu.geom as mod # Get vessel - if len(wall.vessel.unit) != 1: - msg = "There is no / several vessel.unit!" - raise Exception(msg) - if len(wall.vessel.unit[0].element) != 1: - msg = "There is no / several vessel.unit[0].element!" - raise Exception(msg) - name = wall.vessel.unit[0].element[0].name + nlim = len(wall.limiter.unit) + nmob = len(wall.mobile.unit) + onelimonly = False + try: + if len(wall.vessel.unit) != 1: + msg = "There is no / several vessel.unit!" + raise Exception(msg) + if len(wall.vessel.unit[0].element) != 1: + msg = "There is no / several vessel.unit[0].element!" + raise Exception(msg) + if len(wall.vessel.unit[0].element[0].outline.r) < 3: + msg = "wall.vessel polygon has less than 3 points!" + raise Exception(msg) + name = wall.vessel.unit[0].element[0].name + poly = np.array([wall.vessel.unit[0].element[0].outline.r, + wall.vessel.unit[0].element[0].outline.z]) + except Exception as err: + # If vessel not in vessel, sometimes stored a a single limiter + if nlim == 1: + name = wall.limiter.unit[0].name + poly = np.array([wall.limiter.unit[0].outline.r, + wall.limiter.unit[0].outline.z]) + onelimonly = True + else: + msg = ("There does not seem to be any vessel, " + + "not in wall.vessel nor in wall.limiter!") + raise Exception(msg) cls = None if name == '': name = 'ImasVessel' @@ -2279,82 +2299,80 @@ def to_Config(self, Name=None, occ=None, if cls is None: cls = 'Ves' assert cls in ['Ves', 'PlasmaDomain'] - poly = np.array([wall.vessel.unit[0].element[0].outline.r, - wall.vessel.unit[0].element[0].outline.z]) ves = getattr(mod, cls)(Poly=poly, Name=name, **kwargs) # Determine if mobile or not - if mobile is None: - nlim = len(wall.limiter.unit) - nmob = len(wall.mobile.unit) - if nlim == 0 and nmob > 0: - mobile = True - elif nmob == 0 and nlim > 0: - mobile = False + lS = [] + if onelimonly is False: + if mobile is None: + if nlim == 0 and nmob > 0: + mobile = True + elif nmob == 0 and nlim > 0: + mobile = False + else: + msg = ("Can't decide automatically whether to choose" + + " limiter or mobile!") + raise Exception(msg) + assert isinstance(mobile, bool) + + # Get PFC + if mobile is True: + units = wall.mobile.unit else: - msg = ("Can't decide automatically whether to choose" - + " limiter or mobile!") + units = wall.limiter.unit + nunits = len(units) + + if nunits == 0: + msg = "There is no unit stored !\n" + msg += "The required 2d description is empty:\n" + ms = "len(idd.%s[occ=%s].description_2d"%(ids, str(occ)) + msg += "%s[%s].limiter.unit) = 0"%(ms, str(description_2d)) raise Exception(msg) - assert isinstance(mobile, bool) - # Get PFC - if mobile is True: - units = wall.mobile.unit - else: - units = wall.limiter.unit - nunits = len(units) - - if nunits == 0: - msg = "There is no unit stored !\n" - msg += "The required 2d description is empty:\n" - ms = "len(idd.%s[occ=%s].description_2d"%(ids, str(occ)) - msg += "%s[%s].limiter.unit) = 0"%(ms, str(description_2d)) - raise Exception(msg) + lS = [None for _ in units] + for ii in range(0, nunits): + try: + if mobile is True: + outline = units[ii].outline[0] + else: + outline = units[ii].outline + poly = np.array([outline.r, outline.z]) + + if units[ii].phi_extensions.size > 0: + pos, extent = units[ii].phi_extensions.T + else: + pos, extent = None, None + name = units[ii].name + cls, mobi = None, None + if name == '': + name = 'unit{:02.0f}'.format(ii) + if '_' in name: + ln = name.split('_') + if len(ln) == 2: + cls, name = ln + elif len(ln) == 3: + cls, name, mobi = ln + else: + name = name.replace('_','') + if cls is None: + if ii == nunits-1: + cls = 'Ves' + else: + cls = 'PFC' + mobi = mobi == 'mobile' + lS[ii] = getattr(mod, cls)(Poly=poly, pos=pos, extent=extent, + Name=name, mobile=mobi, **kwargs) + except Exception as err: + msg = ("PFC unit[{}] named {} ".format(ii, name) + + "could not be loaded!\n" + + str(err)) + raise Exception(msg) if Name is None: Name = wall.type.name if Name == '': Name = 'imas wall' - lS = [None for _ in units] - for ii in range(0, nunits): - try: - if mobile is True: - outline = units[ii].outline[0] - else: - outline = units[ii].outline - poly = np.array([outline.r, outline.z]) - - if units[ii].phi_extensions.size > 0: - pos, extent = units[ii].phi_extensions.T - else: - pos, extent = None, None - name = units[ii].name - cls, mobi = None, None - if name == '': - name = 'unit{:02.0f}'.format(ii) - if '_' in name: - ln = name.split('_') - if len(ln) == 2: - cls, name = ln - elif len(ln) == 3: - cls, name, mobi = ln - else: - name = name.replace('_','') - if cls is None: - if ii == nunits-1: - cls = 'Ves' - else: - cls = 'PFC' - mobi = mobi == 'mobile' - lS[ii] = getattr(mod, cls)(Poly=poly, pos=pos, extent=extent, - Name=name, mobile=mobi, **kwargs) - except Exception as err: - msg = ("PFC unit[{}] named {} ".format(ii, name) - + "could not be loaded!\n" - + str(err)) - raise Exception(msg) - config = mod.Config(lStruct=[ves] + lS, Name=Name, **kwargs) # Output diff --git a/tofu/version.py b/tofu/version.py index 4134bb98e..452e34f2f 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.2-a5-55-gaf693de' +__version__ = '1.4.2-a5-62-g7b1cc0f' From e332b2a4ec1c6f0414b8e88626a8d8268c596640 Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Tue, 7 Jan 2020 15:17:32 +0100 Subject: [PATCH 095/168] fixed f-contiguous error --- tofu/geom/_GG.pyx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tofu/geom/_GG.pyx b/tofu/geom/_GG.pyx index 6ed2f1a10..ea918a178 100644 --- a/tofu/geom/_GG.pyx +++ b/tofu/geom/_GG.pyx @@ -2982,16 +2982,19 @@ def LOS_calc_signal(func, double[:,::1] ray_orig, double[:,::1] ray_vdir, res, num_threads) # .................................................................. if ani: - val_2d = func(pts, t=t, vect=-usbis, **fkwdargs) + val_arr = func(pts, t=t, vect=-usbis, **fkwdargs) else: - val_2d = func(pts, t=t, **fkwdargs) + val_arr = func(pts, t=t, **fkwdargs) + val_2d = val_arr # Integrate if n_imode == 0: # "sum" integration mode # .. integrating function .......................................... reseffs = np.copy(np.asarray(reseff_arr)) indices = np.copy(np.asarray(ind_arr).astype(int)) - sig = np.add.reduceat(val_2d, np.r_[0, indices], - axis=-1)*reseffs[None, :] + sig = np.asfortranarray(np.add.reduceat(val_arr, + np.r_[0, indices], + axis=-1) + * reseffs[None, :]) # Cleaning up... free(coeff_ptr[0]) free(coeff_ptr) From f7d47d5425f0e03b9f4330d419a14cbaaaa7b8ed Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Tue, 7 Jan 2020 16:53:20 +0100 Subject: [PATCH 096/168] [Issue321] Added 'names' to default data extracted when exporting Multi.to_Cam() and Multi.to_Data(), hence 'names' field also added to all diag default shortcuts --- tofu/imas2tofu/_core.py | 43 +++++++++++++++++++++++++++-------------- tofu/version.py | 2 +- 2 files changed, 30 insertions(+), 15 deletions(-) diff --git a/tofu/imas2tofu/_core.py b/tofu/imas2tofu/_core.py index 597e5f4e5..2a9fd755a 100644 --- a/tofu/imas2tofu/_core.py +++ b/tofu/imas2tofu/_core.py @@ -259,9 +259,10 @@ class MultiIDSLoader(object): 'dim':'distance', 'quant':'Z', 'units':'m'}}, 'barometry': - {'t':{'str':'gauge[chan].pressure.time'}, - 'p':{'str':'gauge[chan].pressure.data', - 'dim':'pressure', 'quant':'p', 'units':'Pa?'}}, + {'t':{'str': 'gauge[chan].pressure.time'}, + 'names': {'str': 'gauge[chan].name'}, + 'p':{'str': 'gauge[chan].pressure.data', + 'dim': 'pressure', 'quant': 'p', 'units': 'Pa?'}}, 'neutron_diagnostic': {'t':{'str':'time', 'units':'s'}, @@ -284,6 +285,7 @@ class MultiIDSLoader(object): 'tau1keV':{'str':'channel[chan].optical_depth.data', 'dim':'optical_depth', 'quant':'tau', 'units':'adim.'}, 'validity_timed': {'str':'channel[chan].t_e.validity_timed'}, + 'names': {'str': 'channel[chan].name'}, 'Te0': {'str':'t_e_central.data', 'dim':'temperature', 'quant':'Te', 'units':'eV'}}, @@ -297,12 +299,14 @@ class MultiIDSLoader(object): 'dim':'distance', 'quant':'Z', 'units':'m'}, 'phi':{'str':'channel[chan].position.phi.data', 'dim':'angle', 'quant':'phi', 'units':'rad'}, + 'names': {'str': 'channel[chan].name'}, 'mode':{'str':'mode'}, 'sweep':{'str':'sweep_time'}}, 'interferometer': {'t':{'str':'time', 'quant':'t', 'units':'s'}, + 'names': {'str': 'channel[chan].name'}, 'ne_integ':{'str':'channel[chan].n_e_line.data', 'dim':'ne_integ', 'quant':'ne_integ', 'units':'/m2', 'Brightness': True}}, @@ -314,7 +318,8 @@ class MultiIDSLoader(object): 'dim':'distance', 'quant':'wavelength', 'units':'m'}, 'fangle':{'str':'channel[chan].faraday_angle.data', 'dim':'angle', 'quant':'faraday angle', - 'units':'rad', 'Brightness': True}}, + 'units':'rad', 'Brightness': True}, + 'names': {'str': 'channel[chan].name'}}, 'bolometer': {'t':{'str':'channel[chan].power.time', @@ -325,6 +330,7 @@ class MultiIDSLoader(object): 'etendue':{'str':'channel[chan].etendue', 'dim':'etendue', 'quant':'etendue', 'units':'m2.sr'}, + 'names': {'str': 'channel[chan].name'}, 'tpower':{'str':'time','quant':'t', 'units':'s'}, 'prad':{'str':'power_radiated_total', 'dim':'power', 'quant':'power radiative', 'units':'W'}, @@ -341,6 +347,7 @@ class MultiIDSLoader(object): 'brightness':{'str':'channel[chan].brightness.data', 'dim':'brightness', 'quant':'brightness', 'units':'W/(m2.sr)', 'Brightness': True}, + 'names': {'str': 'channel[chan].name'}, 'etendue':{'str':'channel[chan].etendue', 'dim':'etendue', 'quant':'etendue', 'units':'m2.sr'}}, @@ -350,6 +357,7 @@ class MultiIDSLoader(object): 'spectra':{'str':'channel[chan].grating_spectrometer.radiance_spectral.data', 'dim':'radiance_spectral', 'quant':'radiance_spectral', 'units':'ph/s/(m2.sr)/m', 'Brightness': True}, + 'names': {'str': 'channel[chan].name'}, 'lamb':{'str':'channel[chan].grating_spectrometer.wavelengths', 'dim':'wavelength', 'quant':'wavelength', 'units':'m'}}, @@ -359,6 +367,7 @@ class MultiIDSLoader(object): 'radiance':{'str':'channel[chan].radiance_spectral.data', 'dim':'radiance_spectral', 'quant':'radiance_spectral', 'units':'ph/s/(m2.sr)/m', 'Brightness': True}, + 'names': {'str': 'channel[chan].name'}, 'lamb_up': {'str':'channel[chan].filter.wavelength_upper'}, 'lamb_lo': {'str':'channel[chan].filter.wavelength_lower'}}, } @@ -3069,7 +3078,7 @@ def _checkformat_Cam_geom(self, ids=None, geomcls=None, indch=None): return geomcls def _to_Cam_Du(self, ids, lk, indch, nan=None, pos=None): - Etendues, Surfaces = None, None + Etendues, Surfaces, names = None, None, None out = self.get_data(ids, sig=list(lk), indch=indch, nan=nan, pos=pos) if 'los_ptsRZPhi' in out.keys() and out['los_ptsRZPhi'].size > 0: @@ -3094,7 +3103,9 @@ def _to_Cam_Du(self, ids, lk, indch, nan=None, pos=None): Etendues = out['etendue'] if 'surface' in out.keys() and len(out['surface']) > 0: Surfaces = out['surface'] - return dgeom, Etendues, Surfaces + if 'names' in out.keys() and len(out['names']) > 0: + names = out['names'] + return dgeom, Etendues, Surfaces, names @@ -3118,10 +3129,9 @@ def to_Cam(self, ids=None, indch=None, indch_auto=False, config = self.to_Config(Name=Name, occ=occ, plot=False) # dchans + dchans = {} if indch is not None: - dchans = {'ind':indch} - else: - dchans = None + dchans['ind'] = indch # cam cam = None @@ -3132,12 +3142,12 @@ def to_Cam(self, ids=None, indch=None, indch_auto=False, raise Exception(msg) if 'LOS' in geom: - lk = ['los_ptsRZPhi','etendue','surface'] + lk = ['los_ptsRZPhi','etendue','surface', 'names'] lkok = set(self._dshort[ids].keys()) lkok = lkok.union(self._dcomp[ids].keys()) lk = list(set(lk).intersection(lkok)) - dgeom, Etendues, Surfaces = self._to_Cam_Du(ids, lk, indch, - nan=nan, pos=pos) + dgeom, Etendues, Surfaces, names = self._to_Cam_Du(ids, lk, indch, + nan=nan, pos=pos) indnan = np.logical_or(np.any(np.isnan(dgeom[0]),axis=0), np.any(np.isnan(dgeom[1]),axis=0)) @@ -3162,6 +3172,9 @@ def to_Cam(self, ids=None, indch=None, indch_auto=False, msg += " %s"%str(indch) warnings.warn(msg) + if names is not None: + dchans['names'] = names + import tofu.geom as tfg cam = getattr(tfg, geom)(dgeom=dgeom, config=config, Etendues=Etendues, Surfaces=Surfaces, @@ -3285,8 +3298,8 @@ def to_Data(self, ids=None, dsig=None, data=None, X=None, tlim=None, lkok = set(self._dshort[ids].keys()) lkok = lkok.union(self._dcomp[ids].keys()) lk = list(set(lk).intersection(lkok)) - dgeom, Etendues, Surfaces = self._to_Cam_Du(ids, lk, indch, - nan=nan, pos=pos) + dgeom, Etendues, Surfaces, names = self._to_Cam_Du(ids, lk, indch, + nan=nan, pos=pos) indnan = np.logical_or(np.any(np.isnan(dgeom[0]),axis=0), np.any(np.isnan(dgeom[1]),axis=0)) @@ -3313,6 +3326,8 @@ def to_Data(self, ids=None, dsig=None, data=None, X=None, tlim=None, msg += " => indch automatically set to:\n" msg += " %s"%str(indch) warnings.warn(msg) + if names is not None: + dchans['names'] = names if dgeom is not None: import tofu.geom as tfg diff --git a/tofu/version.py b/tofu/version.py index 452e34f2f..21679b58a 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.2-a5-62-g7b1cc0f' +__version__ = '1.4.2-a5-63-gac2a365' From e1f483816b360c9c0b55d767418aba2a22f05bd8 Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Tue, 7 Jan 2020 16:56:45 +0100 Subject: [PATCH 097/168] only keeping memory view --- tofu/geom/_GG.pyx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tofu/geom/_GG.pyx b/tofu/geom/_GG.pyx index ea918a178..e2ce85d88 100644 --- a/tofu/geom/_GG.pyx +++ b/tofu/geom/_GG.pyx @@ -2982,16 +2982,16 @@ def LOS_calc_signal(func, double[:,::1] ray_orig, double[:,::1] ray_vdir, res, num_threads) # .................................................................. if ani: - val_arr = func(pts, t=t, vect=-usbis, **fkwdargs) + val_2d = func(pts, t=t, vect=-usbis, **fkwdargs) else: - val_arr = func(pts, t=t, **fkwdargs) - val_2d = val_arr + val_2d = func(pts, t=t, **fkwdargs) + # Integrate if n_imode == 0: # "sum" integration mode # .. integrating function .......................................... reseffs = np.copy(np.asarray(reseff_arr)) indices = np.copy(np.asarray(ind_arr).astype(int)) - sig = np.asfortranarray(np.add.reduceat(val_arr, + sig = np.asfortranarray(np.add.reduceat(val_2d, np.r_[0, indices], axis=-1) * reseffs[None, :]) From 583cb9bb502dfb8484d9ef3e8eb99a44826869c6 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Wed, 8 Jan 2020 15:42:48 +0100 Subject: [PATCH 098/168] [Issue321] Interferometer and polarimeter synth diag now operational with METIS rectangular meshes --- tofu/data/_comp.py | 8 +- tofu/data/_core.py | 20 +++- tofu/data/_plot.py | 5 +- tofu/imas2tofu/_core.py | 202 +++++++++++++++++++++++++--------------- tofu/version.py | 2 +- 5 files changed, 154 insertions(+), 83 deletions(-) diff --git a/tofu/data/_comp.py b/tofu/data/_comp.py index 2bbe96d4e..1314d1f44 100644 --- a/tofu/data/_comp.py +++ b/tofu/data/_comp.py @@ -525,7 +525,6 @@ def func(pts, vect=None, t=None, ntall=ntall, fill_value=fill_value )(np.asarray(vii)) val[np.isnan(val)] = fill_value - return val, t else: @@ -677,7 +676,7 @@ def func(pts, vect=None, t=None, ntall=ntall, # Deduce vect in (r,z,phi) vR = np.cos(phi)*vect[0,:] + np.sin(phi)*vect[1,:] - vphi = -np.sin(phi)*vect[0,:] + np.cos(phi)*vect[1,:] + vPhi = -np.sin(phi)*vect[0,:] + np.cos(phi)*vect[1,:] vZ = vect[2,:] # Prepare output @@ -689,6 +688,7 @@ def func(pts, vect=None, t=None, ntall=ntall, # Interpolate indpts = trifind(r, z) + indok = indpts > -1 if t is None: for ii in range(0,ntall): valR[ii, ...] = vq2dR[indtq[ii], indpts] @@ -697,9 +697,7 @@ def func(pts, vect=None, t=None, ntall=ntall, t = tall else: ntall, indt, indtu = plasma._get_indtu(t=t, tall=tall, - tbinall=tbinall, - idref1d=idref1d, - idref2d=idref2d)[1:] + tbinall=tbinall)[1:-2] for ii in range(0, ntall): ind = indt == indtu[ii] valR[ind, ...] = vq2dR[indtq[indtu[ii]], indpts] diff --git a/tofu/data/_core.py b/tofu/data/_core.py index ba45cd932..c80bcc579 100644 --- a/tofu/data/_core.py +++ b/tofu/data/_core.py @@ -2519,6 +2519,9 @@ def trifind(r, z, indpts = indR*nZ + indZ else: indpts = indZ*nR + indR + indout = ((r < R[0]) | (r > R[-1]) + | (z < Z[0]) | (z > Z[-1])) + indpts[indout] = -1 return indpts dd[dk][k0]['R'] = R @@ -3915,8 +3918,21 @@ def interp_pts2profile(self, pts=None, vect=None, t=None, else: idmesh = [id_ for id_ in self._ddata[idref2d]['depend'] if self._dindref[id_]['group'] == 'mesh'][0] - pts = self.dmesh[idmesh]['data']['nodes'] - pts = np.array([pts[:,0], np.zeros((pts.shape[0],)), pts[:,1]]) + if self.dmesh[idmesh]['data']['type'] == 'rect': + if self.dmesh[idmesh]['data']['shapeRZ'] == ('R', 'Z'): + R = np.repeat(self.dmesh[idmesh]['data']['R'], + self.dmesh[idmesh]['data']['nZ']) + Z = np.tile(self.dmesh[idmesh]['data']['Z'], + self.dmesh[idmesh]['data']['nR']) + else: + R = np.tile(self.dmesh[idmesh]['data']['R'], + self.dmesh[idmesh]['data']['nZ']) + Z = np.repeat(self.dmesh[idmesh]['data']['Z'], + self.dmesh[idmesh]['data']['nR']) + pts = np.array([R, np.zeros((self.dmesh[idmesh]['data']['size'],)), Z]) + else: + pts = self.dmesh[idmesh]['data']['nodes'] + pts = np.array([pts[:,0], np.zeros((pts.shape[0],)), pts[:,1]]) pts = np.atleast_2d(pts) if pts.shape[0] != 3: diff --git a/tofu/data/_plot.py b/tofu/data/_plot.py index 17eb6e486..0949197d2 100644 --- a/tofu/data/_plot.py +++ b/tofu/data/_plot.py @@ -387,8 +387,9 @@ def _DataCam12D_plot(lData, key=None, nchMax=_nchMax, ntMax=_ntMax, # Check nch and X c0 = [dd.nch == lData[0].nch for dd in lData[1:]] if not all(c0): - msg = "All Data objects must have the same number of channels (self.nch)" - msg += "\nYou can set the indices of the channels with self.set_indch()" + msg = ("All Data objects must have the same nb. of channels\n" + + "\t- self.nch: {}\n".format([dd.nch for dd in lData]) + + "\n => use self.set_indch()") raise Exception(msg) nch = lData[0].nch diff --git a/tofu/imas2tofu/_core.py b/tofu/imas2tofu/_core.py index 2a9fd755a..cfa8245b6 100644 --- a/tofu/imas2tofu/_core.py +++ b/tofu/imas2tofu/_core.py @@ -3077,6 +3077,61 @@ def _checkformat_Cam_geom(self, ids=None, geomcls=None, indch=None): return geomcls + def _get_indch_geomtdata(self, indch=None, indch_auto=None, + dgeom=None, t=None, out=None, sig=None): + nch = 0 if indch is None else len(indch) + # Get from geometry of LOS consistency + if dgeom is not None: + indnan = np.logical_or(np.any(np.isnan(dgeom[0]), axis=0), + np.any(np.isnan(dgeom[1]), axis=0)) + if np.any(indnan) and not np.all(indnan): + if indch_auto != True: + ls = ['index %s los %s'%(ii, dmsg[indnan[ii]]) + for ii in range(0,dgeom[0].shape[1])] + dmsg = {True: 'not available', False:'ok'} + msg = ("The geometry of all channels is not available !\n" + + "Please choose indch to get all channels geomery !\n" + + "Currently:\n" + + "\n ".join(ls) + + "\n\n => Solution: choose indch accordingly !") + raise Exception(msg) + else: + msg = ("Geometry missing for some los !\n" + + " => indch automatically set to:\n" + + " %s"%str(indch)) + warnings.warn(msg) + if indch is None: + indch = (~indnan).nonzero()[0] + else: + indch = set(indch).intersection((~indnan).nonzero()[0]) + indch = np.array(indch, dtype=int) + + # Get from time vectors consistency + if t is not None: + ls = [t[ii].shape for ii in range(0,len(t))] + lsu = list(set([ssu for ssu in ls if 0 not in ssu])) + su = lsu[np.argmax([ls.count(ssu) for ssu in lsu])] + if indch is None: + indch = [ii for ii in range(0,len(t)) if ls[ii] == su] + else: + indch = [indch[ii] for ii in range(0,len(t)) if ls[ii] == su] + + # Get from data array consistency + if all([ss is not None for ss in [out, sig]]): + ls = [out[sig][ii].shape + for ii in range(0,len(out[sig]))] + lsu = list(set([ssu for ssu in ls if 0 not in ssu])) + su = lsu[np.argmax([ls.count(ssu) for ssu in lsu])] + if indch is None: + indch = [ii for ii in range(0,len(out[sig])) + if ls[ii] == su] + else: + indch = [indch[ii] for ii in range(0,len(out[sig])) + if ls[ii] == su] + + nchout = 0 if indch is None else len(indch) + return indch, nchout != nch + def _to_Cam_Du(self, ids, lk, indch, nan=None, pos=None): Etendues, Surfaces, names = None, None, None out = self.get_data(ids, sig=list(lk), indch=indch, @@ -3149,28 +3204,13 @@ def to_Cam(self, ids=None, indch=None, indch_auto=False, dgeom, Etendues, Surfaces, names = self._to_Cam_Du(ids, lk, indch, nan=nan, pos=pos) - indnan = np.logical_or(np.any(np.isnan(dgeom[0]),axis=0), - np.any(np.isnan(dgeom[1]),axis=0)) - if np.any(indnan) and not np.all(indnan): - indch_sug = (~indnan).nonzero()[0] - if indch_auto != True: - dmsg = {True: 'not available', False:'ok'} - msg = "The geometry of all channels is not available !\n" - msg += "Please choose indch to get all channels geomery !\n" - msg += "Currently:\n" - ls = ['index %s los %s'%(ii,dmsg[indnan[ii]]) - for ii in range(0,dgeom[0].shape[1])] - msg += "\n ".join(ls) - msg += "\n\n => Solution: choose indch accordingly !" - raise Exception(msg) - else: - indch = indch_sug - dgeom, Etendues, Surfaces = self._to_Cam_Du(ids, lk, indch, - nan=nan, pos=pos) - msg = "Geometry missing for some los !\n" - msg += " => indch automatically set to:\n" - msg += " %s"%str(indch) - warnings.warn(msg) + # Check all channels can be used, reset indch if necessary + indch, modif = self._get_indch_geomtdata(indch=indch, + indch_auto=indch_auto, + dgeom=dgeom) + if modif is True: + dgeom, Etendues, Surfaces = self._to_Cam_Du(ids, lk, indch, + nan=nan, pos=pos) if names is not None: dchans['names'] = names @@ -3301,41 +3341,48 @@ def to_Data(self, ids=None, dsig=None, data=None, X=None, tlim=None, dgeom, Etendues, Surfaces, names = self._to_Cam_Du(ids, lk, indch, nan=nan, pos=pos) - indnan = np.logical_or(np.any(np.isnan(dgeom[0]),axis=0), - np.any(np.isnan(dgeom[1]),axis=0)) - if np.any(indnan) and not np.all(indnan): - indch_sug = (~indnan).nonzero()[0] - if indch_auto != True: - dmsg = {True: 'not available', False:'ok'} - msg = "The geometry of all channels is not available !\n" - msg += "Please de-activate geometry loading (geomcls=False)\n" - msg += " or choose indch to get all channels geometry !\n" - msg += "Currently:\n" - ls = ['index %s los %s'%(ii,dmsg[indnan[ii]]) - for ii in range(0,dgeom[0].shape[1])] - msg += "\n ".join(ls) - msg += "\n\n => Solution: choose indch accordingly !" - msg += " Suggested indch (los %s):\n"%dmsg[True] - msg += " %s"%str(indch_sug) - raise Exception(msg) - else: - indch = indch_sug - dgeom, Etendues, Surfaces = self._to_Cam_Du(ids, lk, indch, - nan=nan, pos=pos) - msg = "Geometry missing for some los !\n" - msg += " => indch automatically set to:\n" - msg += " %s"%str(indch) - warnings.warn(msg) + # Check all channels can be used, reset indch if necessary + indch, modif = self._get_indch_geomtdata(indch=indch, + indch_auto=indch_auto, + dgeom=dgeom) + if modif is True: + dgeom, Etendues, Surfaces = self._to_Cam_Du(ids, lk, indch, + nan=nan, pos=pos) + # indnan = np.logical_or(np.any(np.isnan(dgeom[0]),axis=0), + # np.any(np.isnan(dgeom[1]),axis=0)) + # if np.any(indnan) and not np.all(indnan): + # indch_sug = (~indnan).nonzero()[0] + # if indch_auto != True: + # dmsg = {True: 'not available', False:'ok'} + # msg = "The geometry of all channels is not available !\n" + # msg += "Please de-activate geometry loading (geomcls=False)\n" + # msg += " or choose indch to get all channels geometry !\n" + # msg += "Currently:\n" + # ls = ['index %s los %s'%(ii,dmsg[indnan[ii]]) + # for ii in range(0,dgeom[0].shape[1])] + # msg += "\n ".join(ls) + # msg += "\n\n => Solution: choose indch accordingly !" + # msg += " Suggested indch (los %s):\n"%dmsg[True] + # msg += " %s"%str(indch_sug) + # raise Exception(msg) + # else: + # indch = indch_sug + # dgeom, Etendues, Surfaces = self._to_Cam_Du(ids, lk, indch, + # nan=nan, pos=pos) + # msg = "Geometry missing for some los !\n" + # msg += " => indch automatically set to:\n" + # msg += " %s"%str(indch) + # warnings.warn(msg) if names is not None: dchans['names'] = names - if dgeom is not None: - import tofu.geom as tfg - cam = getattr(tfg, geomcls)(dgeom=dgeom, config=config, - Etendues=Etendues, Surfaces=Surfaces, - Name=Name, Diag=ids, Exp=Exp, - dchans=dchans) - cam.Id.set_dUSR( {'imas-nchMax': nchMax} ) + # if dgeom is not None: + # import tofu.geom as tfg + # cam = getattr(tfg, geomcls)(dgeom=dgeom, config=config, + # Etendues=Etendues, Surfaces=Surfaces, + # Name=Name, Diag=ids, Exp=Exp, + # dchans=dchans) + # cam.Id.set_dUSR( {'imas-nchMax': nchMax} ) # ----------------------- @@ -3409,28 +3456,28 @@ def to_Data(self, ids=None, dsig=None, data=None, X=None, tlim=None, pos=pos) if cam is not None: cam = cam.get_subset(indch=indch) - msg = "indch set automatically for %s\n"%ids - msg += " (due to inhomogeneous data shapes)\n" - msg += " - main shape: %s\n"%str(su) - msg += " - nb. chan. selected: %s\n"%len(indch) - msg += " - indch: %s"%str(indch) + msg = ("indch set automatically for %s\n"%ids + + " (due to inhomogeneous data shapes)\n" + + " - main shape: %s\n"%str(su) + + " - nb. chan. selected: %s\n"%len(indch) + + " - indch: %s"%str(indch)) warnings.warn(msg) else: - msg = "The following is supposed to be a np.ndarray:\n" - msg += " - diag: %s\n"%ids - msg += " - shortcut: %s\n"%dsig[kk] - msg += " - used as: %s input\n"%kk - msg += " Observed type: %s\n"%str(type(out[dsig[kk]])) - msg += " Probable cause: non-uniform shape (vs channels)\n" - msg += " => shapes :\n " if indch is None: ls = ['index %s %s.shape %s'%(ii,kk,str(out[dsig[kk]][ii].shape)) for ii in range(0,len(out[dsig[kk]]))] else: ls = ['index %s %s.shape %s'%(indch[ii],kk,str(out[dsig[kk]][ii].shape)) for ii in range(0,len(out[dsig[kk]]))] - msg += "\n ".join(ls) - msg += "\n => Solution: choose indch accordingly !" + msg = ("The following is supposed to be a np.ndarray:\n" + + " - diag: %s\n"%ids + + " - shortcut: %s\n"%dsig[kk] + + " - used as: %s input\n"%kk + + " Observed type: %s\n"%str(type(out[dsig[kk]])) + + " Probable cause: non-uniform shape (vs channels)\n" + + " => shapes :\n " + + "\n ".join(ls) + + "\n => Solution: choose indch accordingly !") raise Exception(msg) # Arrange depending on shape and field @@ -3440,7 +3487,7 @@ def to_Data(self, ids=None, dsig=None, data=None, X=None, tlim=None, ipdb.set_trace() raise Exception(msg) - assert out[dsig[kk]].ndim in [1,2,3] + assert out[dsig[kk]].ndim in [1, 2, 3] if out[dsig[kk]].ndim == 1: out[dsig[kk]] = np.atleast_2d(out[dsig[kk]]) @@ -3497,12 +3544,21 @@ def to_Data(self, ids=None, dsig=None, data=None, X=None, tlim=None, for tt in dextra.keys(): dextra[tt]['t'] = dextra[tt]['t'] - t0 + # Create objects + # -------------- + if geomcls != False and dgeom is not None: + import tofu.geom as tfg + cam = getattr(tfg, geomcls)(dgeom=dgeom, config=config, + Etendues=Etendues, Surfaces=Surfaces, + Name=Name, Diag=ids, Exp=Exp, + dchans=dchans) + cam.Id.set_dUSR( {'imas-nchMax': nchMax} ) + import tofu.data as tfd conf = None if cam is not None else config Data = getattr(tfd, datacls)(Name=Name, Diag=ids, Exp=Exp, shot=shot, lCam=cam, config=conf, dextra=dextra, dchans=dchans, **dins) - Data.Id.set_dUSR( {'imas-nchMax': nchMax} ) if plot: @@ -3681,8 +3737,7 @@ def calc_signal(self, ids=None, dsig=None, tlim=None, t=None, res=None, sig._dextra = plasma.get_dextra(dextra) if ids == 'interferometer': - pass - i#sig = 2.*sig + sig = 2.*sig elif ids == 'polarimeter': sig = 2.*sig @@ -3715,7 +3770,8 @@ def calc_signal(self, ids=None, dsig=None, tlim=None, t=None, res=None, if plot_compare: if err_comp: raise Exception(msg) - data = self.to_Data(ids, indch=indch, t0=t0, plot=False) + data = self.to_Data(ids, indch=indch, + indch_auto=indch_auto, t0=t0, plot=False) sig._dlabels = data.dlabels data.plot_compare(sig) else: diff --git a/tofu/version.py b/tofu/version.py index 21679b58a..a58163c08 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.2-a5-63-gac2a365' +__version__ = '1.4.2-a5-64-gf7d47d5' From 3ce09a598e305d64e79674e56076caf7314c47d7 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Wed, 8 Jan 2020 18:17:19 +0100 Subject: [PATCH 099/168] [Issue321] Started refurbishing Multi.to_Data(indch, indch_auto), almost done up to data --- tofu/imas2tofu/_core.py | 155 +++++++++++++++------------------------- tofu/version.py | 2 +- 2 files changed, 58 insertions(+), 99 deletions(-) diff --git a/tofu/imas2tofu/_core.py b/tofu/imas2tofu/_core.py index cfa8245b6..7f2901f62 100644 --- a/tofu/imas2tofu/_core.py +++ b/tofu/imas2tofu/_core.py @@ -3108,6 +3108,33 @@ def _get_indch_geomtdata(self, indch=None, indch_auto=None, # Get from time vectors consistency if t is not None: + if indch_auto != True: + if indch is None: + ls = ['index {} {}.shape {}'.format(ii, kk, + str(out[dsig[kk]][ii].shape)) + for ii in range(0, len(out[dsig[kk]]))] + else: + ls = ['index {} {}.shape {}'.format(indch[ii], kk, + str(out[dsig[kk]][ii].shape)) + for ii in range(0, len(out[dsig[kk]]))] + msg = ("The following is supposed to be a np.ndarray:\n" + + " - diag: {}\n".format(ids) + + " - shortcut: {}\n".format(dsig[kk]) + + " - used as: {} input\n".format(kk) + + " Observed type: {}\n".format(type(out[dsig[kk]])) + + " Probable cause: non-uniform shape (vs channels)\n" + + " => shapes :\n " + + "\n ".join(ls) + + "\n => Solution: choose indch accordingly !") + raise Exception(msg) + else: + msg = ("indch set automatically for {}\n".format(ids) + + " (due to inhomogenous time shapes)\n" + + " - main shape: {}\n".format(su) + + " - nb. chan. selected: {}\n".format(len(indch)) + + " - indch: {}".format(indch)) + warnings.warn(msg) + ls = [t[ii].shape for ii in range(0,len(t))] lsu = list(set([ssu for ssu in ls if 0 not in ssu])) su = lsu[np.argmax([ls.count(ssu) for ssu in lsu])] @@ -3116,19 +3143,6 @@ def _get_indch_geomtdata(self, indch=None, indch_auto=None, else: indch = [indch[ii] for ii in range(0,len(t)) if ls[ii] == su] - # Get from data array consistency - if all([ss is not None for ss in [out, sig]]): - ls = [out[sig][ii].shape - for ii in range(0,len(out[sig]))] - lsu = list(set([ssu for ssu in ls if 0 not in ssu])) - su = lsu[np.argmax([ls.count(ssu) for ssu in lsu])] - if indch is None: - indch = [ii for ii in range(0,len(out[sig])) - if ls[ii] == su] - else: - indch = [indch[ii] for ii in range(0,len(out[sig])) - if ls[ii] == su] - nchout = 0 if indch is None else len(indch) return indch, nchout != nch @@ -3209,8 +3223,8 @@ def to_Cam(self, ids=None, indch=None, indch_auto=False, indch_auto=indch_auto, dgeom=dgeom) if modif is True: - dgeom, Etendues, Surfaces = self._to_Cam_Du(ids, lk, indch, - nan=nan, pos=pos) + dgeom, Etendues, Surfaces, names = self._to_Cam_Du(ids, lk, indch, + nan=nan, pos=pos) if names is not None: dchans['names'] = names @@ -3321,18 +3335,19 @@ def to_Data(self, ids=None, dsig=None, data=None, X=None, tlim=None, else: dchans = None - # cam + # ----------- + # Get geom cam = None indchanstr = self._dshort[ids][dsig['data']]['str'].index('[chan]') chanstr = self._dshort[ids][dsig['data']]['str'][:indchanstr] nchMax = len(getattr(self._dids[ids]['ids'][0], chanstr)) + dgeom = None if geomcls != False: Etendues, Surfaces = None, None if config is None: msg = "A config must be provided to compute the geometry !" raise Exception(msg) - dgeom = None if 'LOS' in geomcls: lk = ['los_ptsRZPhi','etendue','surface'] lkok = set(self._dshort[ids].keys()) @@ -3341,52 +3356,8 @@ def to_Data(self, ids=None, dsig=None, data=None, X=None, tlim=None, dgeom, Etendues, Surfaces, names = self._to_Cam_Du(ids, lk, indch, nan=nan, pos=pos) - # Check all channels can be used, reset indch if necessary - indch, modif = self._get_indch_geomtdata(indch=indch, - indch_auto=indch_auto, - dgeom=dgeom) - if modif is True: - dgeom, Etendues, Surfaces = self._to_Cam_Du(ids, lk, indch, - nan=nan, pos=pos) - # indnan = np.logical_or(np.any(np.isnan(dgeom[0]),axis=0), - # np.any(np.isnan(dgeom[1]),axis=0)) - # if np.any(indnan) and not np.all(indnan): - # indch_sug = (~indnan).nonzero()[0] - # if indch_auto != True: - # dmsg = {True: 'not available', False:'ok'} - # msg = "The geometry of all channels is not available !\n" - # msg += "Please de-activate geometry loading (geomcls=False)\n" - # msg += " or choose indch to get all channels geometry !\n" - # msg += "Currently:\n" - # ls = ['index %s los %s'%(ii,dmsg[indnan[ii]]) - # for ii in range(0,dgeom[0].shape[1])] - # msg += "\n ".join(ls) - # msg += "\n\n => Solution: choose indch accordingly !" - # msg += " Suggested indch (los %s):\n"%dmsg[True] - # msg += " %s"%str(indch_sug) - # raise Exception(msg) - # else: - # indch = indch_sug - # dgeom, Etendues, Surfaces = self._to_Cam_Du(ids, lk, indch, - # nan=nan, pos=pos) - # msg = "Geometry missing for some los !\n" - # msg += " => indch automatically set to:\n" - # msg += " %s"%str(indch) - # warnings.warn(msg) - if names is not None: - dchans['names'] = names - - # if dgeom is not None: - # import tofu.geom as tfg - # cam = getattr(tfg, geomcls)(dgeom=dgeom, config=config, - # Etendues=Etendues, Surfaces=Surfaces, - # Name=Name, Diag=ids, Exp=Exp, - # dchans=dchans) - # cam.Id.set_dUSR( {'imas-nchMax': nchMax} ) - - - # ----------------------- - # data + # ---------- + # Get time lk = sorted(dsig.keys()) dins = dict.fromkeys(lk) t = self.get_data(ids, sig=dsig.get('t', 't'), indch=indch)['t'] @@ -3396,46 +3367,30 @@ def to_Data(self, ids=None, dsig=None, data=None, X=None, tlim=None, msg += " - 't' = %s"%str(t) raise Exception(msg) + # ----------- + # Check indch if type(t) is list: - if indch_auto == True: - ls = [t[ii].shape for ii in range(0,len(t))] - lsu = list(set([ssu for ssu in ls if 0 not in ssu])) - su = lsu[np.argmax([ls.count(ssu) for ssu in lsu])] - if indch is None: - indch = [ii for ii in range(0,len(t)) if ls[ii] == su] - else: - indchcam = [ii for ii in range(0,len(t)) if ls[ii] == su] - indch = [indch[ii] for ii in range(0,len(t)) if ls[ii] == su] - t = self.get_data(ids, sig='t', indch=indch)['t'] - if cam is not None: - cam = cam.get_subset(indch=indchcam) - msg = "indch set automatically for %s\n"%ids - msg += " (due to inhomogenous time shapes)\n" - msg += " - main shape: %s\n"%str(su) - msg += " - nb. chan. selected: %s\n"%len(indch) - msg += " - indch: %s"%str(indch) - warnings.warn(msg) - - else: - msg = "The time vector does not seem to be homogeneous !\n" - msg += "Please choose indch such that all channels have same t !\n" - msg += "Currently:\n" - if indch is None: - ls = ['index %s t.shape %s'%(ii,str(t[ii].shape)) - for ii in range(0,len(t))] - else: - ls = ['index %s t.shape %s'%(indch[ii],str(t[ii].shape)) - for ii in range(0,len(t))] - msg += "\n ".join(ls) - msg += "\n => Solution: choose indch accordingly !" - raise Exception(msg) + indch, modif = self._get_indch_geomtdata(indch=indch, + indch_auto=indch_auto, + dgeom=dgeom, t=t) + else: + indch, modif = self._get_indch_geomtdata(indch=indch, + indch_auto=indch_auto, + dgeom=dgeom) + if modif is True: + dgeom, Etendues, Surfaces, names = self._to_Cam_Du(ids, lk, indch, + nan=nan, pos=pos) + if names is not None: + dchans['names'] = names if t.ndim == 2: - assert np.all(np.isclose(t, t[0:1,:])) - t = t[0,:] + assert np.all(np.isclose(t, t[0:1, :])) + t = t[0, :] dins['t'] = t indt = self._checkformat_tlim(t, tlim=tlim)['indt'] + # ----------- + # Get data out = self.get_data(ids, sig=[dsig[k] for k in lk], indt=indt, indch=indch, nan=nan, pos=pos) for kk in set(lk).difference('t'): @@ -3454,6 +3409,8 @@ def to_Data(self, ids=None, dsig=None, data=None, X=None, tlim=None, out = self.get_data(ids, sig=[dsig[k] for k in lk], indt=indt, indch=indch, nan=nan, pos=pos) + + # Remove ? put in function ? if cam is not None: cam = cam.get_subset(indch=indch) msg = ("indch set automatically for %s\n"%ids @@ -3505,6 +3462,8 @@ def to_Data(self, ids=None, dsig=None, data=None, X=None, tlim=None, assert kk == 'data' dins[kk] = np.swapaxes(out[dsig[kk]].T, 1,2) + # -------------------------- + # Format special ids cases if ids == 'reflectometer_profile': dins['X'] = np.fliplr(dins['X']) dins['data'] = np.fliplr(dins['data']) @@ -3544,8 +3503,8 @@ def to_Data(self, ids=None, dsig=None, data=None, X=None, tlim=None, for tt in dextra.keys(): dextra[tt]['t'] = dextra[tt]['t'] - t0 - # Create objects # -------------- + # Create objects if geomcls != False and dgeom is not None: import tofu.geom as tfg cam = getattr(tfg, geomcls)(dgeom=dgeom, config=config, diff --git a/tofu/version.py b/tofu/version.py index a58163c08..4b800b3d2 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.2-a5-64-gf7d47d5' +__version__ = '1.4.2-a5-65-g583cb9b' From 276568945b9ee8db7ca8c02e8abdbb2e1cadb676 Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Thu, 9 Jan 2020 14:56:48 +0100 Subject: [PATCH 100/168] [#314] fixed bug on mac coming from modulo with negative values with c division flag --- tofu/geom/_GG.pyx | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/tofu/geom/_GG.pyx b/tofu/geom/_GG.pyx index e2ce85d88..24dbd4dc2 100644 --- a/tofu/geom/_GG.pyx +++ b/tofu/geom/_GG.pyx @@ -186,9 +186,6 @@ def CoordShift(Pts, In='(X,Y,Z)', Out='(R,Z)', CrossRef=None): ######################################################## -@cython.cdivision(True) -@cython.wraparound(False) -@cython.boundscheck(False) def Poly_isClockwise(np.ndarray[double,ndim=2] Poly): """ Assuming 2D closed Poly ! TODO @LM : @@ -208,8 +205,10 @@ def Poly_isClockwise(np.ndarray[double,ndim=2] Poly): cdef double[::1] mvx = mv_poly[0,:] cdef double[::1] mvy = mv_poly[1,:] cdef int idmin = _bgt.find_ind_lowerright_corner(mvx, mvy, npts) - cdef int idm1 = (idmin - 1) % npts - cdef int idp1 = (idmin + 1) % npts + cdef int idm1 = idmin - 1 + cdef int idp1 = (idmin + 1)%npts + if idmin == 0 : + idm1 = npts - 1 res = mvx[idm1] * (mvy[idmin] - mvy[idp1]) + \ mvx[idmin] * (mvy[idp1] - mvy[idm1]) + \ mvx[idp1] * (mvy[idm1] - mvy[idmin]) @@ -281,10 +280,6 @@ def Poly_Order(np.ndarray[double,ndim=2] Poly, str order='C', Clock=False, poly = poly[:,:-1] if layout.lower()=='(n,cc)': poly = poly.T - # TODO : @LM @DV > seems strange to me that we order all polys - # in order "(cc,n)" and just last minute we look at what's actually - # asked - # >> ok poly = np.ascontiguousarray(poly) if order.lower()=='c' \ else np.asfortranarray(poly) return poly From 91700849c37530764c3cbd2bccde99de36aee08b Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Thu, 9 Jan 2020 16:44:33 +0100 Subject: [PATCH 101/168] put back right project name --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 2e7deb6a2..f3fabc8e4 100644 --- a/setup.py +++ b/setup.py @@ -282,7 +282,7 @@ def get_version_tofu(path=_HERE): setup( - name="tofuproject", # to switch back to tofu + name="tofu", version="{ver}".format(ver=version_tofu), # Use scm to get code version from git tags # cf. https://pypi.python.org/pypi/setuptools_scm From f12b758496943ee8c5d3187cb9966267464c9956 Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Thu, 9 Jan 2020 17:11:31 +0100 Subject: [PATCH 102/168] [travis] adding branch specification and tag flag --- .travis.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2d5960481..6fb3b7bf9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -80,7 +80,8 @@ before_deploy: deploy: - provider: pypi on: - branch: deploy-test + branch: master + tags: on skip_existing: true user: __token__ password: @@ -90,6 +91,9 @@ deploy: distributions: "sdist" user: __token__ skip_existing: true + on: + tags: true + all_branches: true server: https://test.pypi.org/legacy/ password: secure: o63EC+U+EtdAgUSV3plrLfZ7QZ6Aflp0quV5jJQxD9w47Ds5i4k5GjEHogV8x8l5NGwxbXPKp/1eKEfYgFH/i+WUnj1n9reiYZBd0lkr2Ih9nExNEIrziMhPbqjDEYAB672bjkXseS6mF44boqDUEP3jyDaamLB+aR75RCMM1j6aha/54Ko88ZJKXBW5FuNSraBGzgvjVG0P63jG5epS85hX09dEcKNR0XO0kbiGfNnYIp78QBohO0Pdv99x2ryp/QaoWD4m7cMUOts2xIcI2KCJNMhZNdIS8C0TVvk2tgumb+G2px7PsOxA8yZgxLefs+A14IAjg6uKe/jmwrihN1V6R6FF3WCcxM6kdzt9bpr+QKBoXjkF8BdxVbgmdnxkr+Ah5WIxmw2boQoW/SIMy9GVPrgtkSvocN6NwOExsO4pagiOwTLIvjIe+/0+OJt/Pud+mwF/94HD+B7j/XxsK7QehLCd9v5NTrdNgpS/TiWOyCDP1DLnpl1V9/vZ56x9NSQhN4Wr6hRrTxjWNAYLxsMxZf6uR+WWg1TqyicVlGrSf0to2asNIPWTTeGq3tB0/7WNslRQzP7QD67p5SuX0Z3Sv0WnQx+rZH77EN6FPCbv8Xn+D4ff06VKHaXXOkiFdK+6pTQ1VmFVPH/ablbWODhhcja/O3Xn3d/zTIyM+oQ= @@ -100,5 +104,7 @@ deploy: server: https://test.pypi.org/legacy/ on: condition: $OS = osx-64 + tags: true + all_branches: true password: secure: o63EC+U+EtdAgUSV3plrLfZ7QZ6Aflp0quV5jJQxD9w47Ds5i4k5GjEHogV8x8l5NGwxbXPKp/1eKEfYgFH/i+WUnj1n9reiYZBd0lkr2Ih9nExNEIrziMhPbqjDEYAB672bjkXseS6mF44boqDUEP3jyDaamLB+aR75RCMM1j6aha/54Ko88ZJKXBW5FuNSraBGzgvjVG0P63jG5epS85hX09dEcKNR0XO0kbiGfNnYIp78QBohO0Pdv99x2ryp/QaoWD4m7cMUOts2xIcI2KCJNMhZNdIS8C0TVvk2tgumb+G2px7PsOxA8yZgxLefs+A14IAjg6uKe/jmwrihN1V6R6FF3WCcxM6kdzt9bpr+QKBoXjkF8BdxVbgmdnxkr+Ah5WIxmw2boQoW/SIMy9GVPrgtkSvocN6NwOExsO4pagiOwTLIvjIe+/0+OJt/Pud+mwF/94HD+B7j/XxsK7QehLCd9v5NTrdNgpS/TiWOyCDP1DLnpl1V9/vZ56x9NSQhN4Wr6hRrTxjWNAYLxsMxZf6uR+WWg1TqyicVlGrSf0to2asNIPWTTeGq3tB0/7WNslRQzP7QD67p5SuX0Z3Sv0WnQx+rZH77EN6FPCbv8Xn+D4ff06VKHaXXOkiFdK+6pTQ1VmFVPH/ablbWODhhcja/O3Xn3d/zTIyM+oQ= From 4c7765606a509ca55740bd0f4562da4198f80281 Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Thu, 9 Jan 2020 17:18:00 +0100 Subject: [PATCH 103/168] [travis] correct travis file --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6fb3b7bf9..44fa7124e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -80,8 +80,8 @@ before_deploy: deploy: - provider: pypi on: + tags: true branch: master - tags: on skip_existing: true user: __token__ password: @@ -92,8 +92,8 @@ deploy: user: __token__ skip_existing: true on: - tags: true - all_branches: true + tags: true + all_branches: true server: https://test.pypi.org/legacy/ password: secure: o63EC+U+EtdAgUSV3plrLfZ7QZ6Aflp0quV5jJQxD9w47Ds5i4k5GjEHogV8x8l5NGwxbXPKp/1eKEfYgFH/i+WUnj1n9reiYZBd0lkr2Ih9nExNEIrziMhPbqjDEYAB672bjkXseS6mF44boqDUEP3jyDaamLB+aR75RCMM1j6aha/54Ko88ZJKXBW5FuNSraBGzgvjVG0P63jG5epS85hX09dEcKNR0XO0kbiGfNnYIp78QBohO0Pdv99x2ryp/QaoWD4m7cMUOts2xIcI2KCJNMhZNdIS8C0TVvk2tgumb+G2px7PsOxA8yZgxLefs+A14IAjg6uKe/jmwrihN1V6R6FF3WCcxM6kdzt9bpr+QKBoXjkF8BdxVbgmdnxkr+Ah5WIxmw2boQoW/SIMy9GVPrgtkSvocN6NwOExsO4pagiOwTLIvjIe+/0+OJt/Pud+mwF/94HD+B7j/XxsK7QehLCd9v5NTrdNgpS/TiWOyCDP1DLnpl1V9/vZ56x9NSQhN4Wr6hRrTxjWNAYLxsMxZf6uR+WWg1TqyicVlGrSf0to2asNIPWTTeGq3tB0/7WNslRQzP7QD67p5SuX0Z3Sv0WnQx+rZH77EN6FPCbv8Xn+D4ff06VKHaXXOkiFdK+6pTQ1VmFVPH/ablbWODhhcja/O3Xn3d/zTIyM+oQ= From 6d750a889e25ac0a6568c7f6c9e121bac33ae3ad Mon Sep 17 00:00:00 2001 From: "Laura S. Mendoza" Date: Thu, 9 Jan 2020 17:41:11 +0100 Subject: [PATCH 104/168] Delete TFG_CrystalBragg_ExpWEST_DgXICS_ArXVII_sh00000_Vers1.4.1-174-g453d6a3.npz Commiting directly to devel, since this file shouldn't have been added --- ...CS_ArXVII_sh00000_Vers1.4.1-174-g453d6a3.npz | Bin 47307 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 TFG_CrystalBragg_ExpWEST_DgXICS_ArXVII_sh00000_Vers1.4.1-174-g453d6a3.npz diff --git a/TFG_CrystalBragg_ExpWEST_DgXICS_ArXVII_sh00000_Vers1.4.1-174-g453d6a3.npz b/TFG_CrystalBragg_ExpWEST_DgXICS_ArXVII_sh00000_Vers1.4.1-174-g453d6a3.npz deleted file mode 100644 index 1620a6b6c4e939677de17363b5d1e0f1304fd571..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 47307 zcmdsg2|N}3_rIl72q8-mvhPdU>z>_`P_!p4^o6lu3Gp_r1o}Rxy-|2N4cV<5CIp=fE`Rt!Fma};KiF36b3S93@9?nk0 zejpOU$Yq(UueZ*;5IPz>h zJNY>H(p_B9^=VFC3|H(r!_CRh75lBGucfXfA1?nJ2R{Sj$PXhoj4VlfUn|pimV{kJ zG!&x_zI_Ayz1)2`v2WN@?9(yETrqOS$R8uJ2=^Vf2&G|H5s6^bCITbC+uPm0>&#y| zu3OxX`u)r=8~mkJ?`$2cE>-cY+O2T9xWA}4oc98<6xmTVV>(OW?CRt1O79I)e7VkJ zzWVDIP^oY|yNV`#TJY+km)jnNQ=~ZZNlySbC*&M$x^NBl$K-Hx@>=@ak{JBHKK{5X z@#Izymg~7;8Cq-Cg+equ$)JHjU6cNyBJmvJFLqoa#xfxCk9Z zs1H^S^&%Nc+hr(im!XvG#Z`A(-{3L`{!)Xhes7SVNqP5>GA#GMUgW>`$GW?vudk}- zy<*OzNFe1?WX?tcgWe#4W$=4*w|-M$T~Xb(MJHFvHujZJzpGQQJL9*l$UsYe)bBNi_~%HfZ;m_k5cKW_7nDC& zIPE_Eriu6PqSA(A7U9vtBTF5tOZE!Abt=7(d+$R_C+qU?UvdGru8sy%yM#W=I4P^= z>IfmVGT#utEfmK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(g%?(w6YUFuzD4NkjL0K0TH>8$5F6zB=>p`G7#Pgyu*%~ZA2BI1@QP0$vvLI2J7GIfXAN-#%6UrmA9^SaE%SzzturX zKxfu|M+Z)UZ1B4624o$m2eHBGz77;|ZDQw0?)Ox%jxj$@oJ9}? z+>jeL_OS#Qe8j4|9Fd`v<0w$nmHM2xBIopLA{1q{JSP-#7Ujni7^1FNr@|1ekPNeY z6#<62YMcr~T+m3C$q-xJ@XH1%E4QgAL>nYK7ylXp3Y(SEoRG-;+$17V7L8I-h*FU= zCpm$@4|T Date: Thu, 9 Jan 2020 17:59:03 +0100 Subject: [PATCH 105/168] correct version number --- tofu/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tofu/version.py b/tofu/version.py index 4fc937bc2..731faebff 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.2-a5-48-gac0016b' +__version__ = '1.4.2-betatest3' From 2b9cb550c2180433d0cda481378ce28c2fcc3d9b Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Thu, 9 Jan 2020 18:21:07 +0100 Subject: [PATCH 106/168] trying to correct version number --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index f3fabc8e4..a698dc694 100644 --- a/setup.py +++ b/setup.py @@ -200,7 +200,7 @@ def get_version_tofu(path=_HERE): with open(version_tofu, "r") as fh: version_tofu = fh.read().strip().split("=")[-1].replace("'", "") - version_tofu = version_tofu.lower().replace("v", "") + version_tofu = version_tofu.lower().replace("v", "").replace(" ", "") return version_tofu From 5bff9e5595f34dba5c1a22f5bdac73c286ce0023 Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Thu, 9 Jan 2020 18:22:42 +0100 Subject: [PATCH 107/168] updated version number --- tofu/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tofu/version.py b/tofu/version.py index 731faebff..dcb376c5e 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.2-betatest3' +__version__ = '1.4.2-betatest5' From 2918fdb4b90ebb3735812534699254327eaeb2ed Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Thu, 9 Jan 2020 19:56:50 +0100 Subject: [PATCH 108/168] updated version number --- setup.py | 2 +- tofu/version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index a698dc694..e8dd8796e 100644 --- a/setup.py +++ b/setup.py @@ -179,7 +179,6 @@ def get_version_tofu(path=_HERE): [ "git", "rev-parse", - "--symbolic-full-name", "--abbrev-ref", "HEAD", ] @@ -209,6 +208,7 @@ def get_version_tofu(path=_HERE): print("") print("Version for setup.py : ", version_tofu) print("") + # ============================================================================= # ============================================================================= diff --git a/tofu/version.py b/tofu/version.py index dcb376c5e..651c0c4f9 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.2-betatest5' +__version__ = '1.4.2-betatest6' From b44ea318b68097b5b192206aadddc185b1f214f3 Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Fri, 10 Jan 2020 11:59:19 +0100 Subject: [PATCH 109/168] updated version number --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 44fa7124e..5defdf5a1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -93,7 +93,7 @@ deploy: skip_existing: true on: tags: true - all_branches: true + branch: deploy-test server: https://test.pypi.org/legacy/ password: secure: o63EC+U+EtdAgUSV3plrLfZ7QZ6Aflp0quV5jJQxD9w47Ds5i4k5GjEHogV8x8l5NGwxbXPKp/1eKEfYgFH/i+WUnj1n9reiYZBd0lkr2Ih9nExNEIrziMhPbqjDEYAB672bjkXseS6mF44boqDUEP3jyDaamLB+aR75RCMM1j6aha/54Ko88ZJKXBW5FuNSraBGzgvjVG0P63jG5epS85hX09dEcKNR0XO0kbiGfNnYIp78QBohO0Pdv99x2ryp/QaoWD4m7cMUOts2xIcI2KCJNMhZNdIS8C0TVvk2tgumb+G2px7PsOxA8yZgxLefs+A14IAjg6uKe/jmwrihN1V6R6FF3WCcxM6kdzt9bpr+QKBoXjkF8BdxVbgmdnxkr+Ah5WIxmw2boQoW/SIMy9GVPrgtkSvocN6NwOExsO4pagiOwTLIvjIe+/0+OJt/Pud+mwF/94HD+B7j/XxsK7QehLCd9v5NTrdNgpS/TiWOyCDP1DLnpl1V9/vZ56x9NSQhN4Wr6hRrTxjWNAYLxsMxZf6uR+WWg1TqyicVlGrSf0to2asNIPWTTeGq3tB0/7WNslRQzP7QD67p5SuX0Z3Sv0WnQx+rZH77EN6FPCbv8Xn+D4ff06VKHaXXOkiFdK+6pTQ1VmFVPH/ablbWODhhcja/O3Xn3d/zTIyM+oQ= From 6f7b944d3d723c990be125fd672f162288e2095f Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Fri, 10 Jan 2020 12:00:48 +0100 Subject: [PATCH 110/168] updated version number --- tofu/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tofu/version.py b/tofu/version.py index 651c0c4f9..29baf584f 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.2-betatest6' +__version__ = '1.4.2b8' From 75d20eafddf93c1cbc2f3a5301eaee93d3258f7a Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Fri, 10 Jan 2020 13:35:11 +0100 Subject: [PATCH 111/168] [Issue321] Synth. diag operational for all (tofu-side) and indch_auto now available for Multi.calc_signal() --- tofu/imas2tofu/_core.py | 163 ++++++++++++++++++++++++---------------- tofu/version.py | 2 +- 2 files changed, 99 insertions(+), 66 deletions(-) diff --git a/tofu/imas2tofu/_core.py b/tofu/imas2tofu/_core.py index 7f2901f62..744e59be0 100644 --- a/tofu/imas2tofu/_core.py +++ b/tofu/imas2tofu/_core.py @@ -3078,7 +3078,8 @@ def _checkformat_Cam_geom(self, ids=None, geomcls=None, indch=None): return geomcls def _get_indch_geomtdata(self, indch=None, indch_auto=None, - dgeom=None, t=None, out=None, sig=None): + dgeom=None, t=None, + ids=None, out=None, dsig=None, kk=None): nch = 0 if indch is None else len(indch) # Get from geometry of LOS consistency if dgeom is not None: @@ -3086,9 +3087,9 @@ def _get_indch_geomtdata(self, indch=None, indch_auto=None, np.any(np.isnan(dgeom[1]), axis=0)) if np.any(indnan) and not np.all(indnan): if indch_auto != True: - ls = ['index %s los %s'%(ii, dmsg[indnan[ii]]) - for ii in range(0,dgeom[0].shape[1])] dmsg = {True: 'not available', False:'ok'} + ls = ['index %s los %s'%(ii, dmsg[indnan[ii]]) + for ii in range(0, dgeom[0].shape[1])] msg = ("The geometry of all channels is not available !\n" + "Please choose indch to get all channels geomery !\n" + "Currently:\n" @@ -3127,22 +3128,60 @@ def _get_indch_geomtdata(self, indch=None, indch_auto=None, + "\n ".join(ls) + "\n => Solution: choose indch accordingly !") raise Exception(msg) + ls = [t[ii].shape for ii in range(0, len(t))] + lsu = list(set([ssu for ssu in ls if 0 not in ssu])) + su = lsu[np.argmax([ls.count(ssu) for ssu in lsu])] + msg = ("indch set automatically for {}\n".format(ids) + + " (due to inhomogenous time shapes)\n" + + " - main shape: {}\n".format(su) + + " - nb. chan. selected: {}\n".format(len(indch)) + + " - indch: {}".format(indch)) + warnings.warn(msg) + + if indch is None: + indch = [ii for ii in range(0, len(t)) if ls[ii] == su] else: + indch = [indch[ii] for ii in range(0, len(indch)) + if ls[indch[ii]] == su] + + # Get from data consistency + if all([ss is not None for ss in [out, kk, dsig]]): + if indch_auto: + ls = [out[dsig[kk]][ii].shape + for ii in range(0, len(out[dsig[kk]]))] + lsu = list(set([ssu for ssu in ls if 0 not in ssu])) + su = lsu[np.argmax([ls.count(ssu) for ssu in lsu])] + if indch is None: + indch = [ii for ii in range(0, len(out[dsig[kk]])) + if ls[ii] == su] + else: + indch = [indch[ii] for ii in range(0, len(out[dsig[kk]])) + if ls[ii] == su] msg = ("indch set automatically for {}\n".format(ids) - + " (due to inhomogenous time shapes)\n" + + " (due to inhomogeneous data shapes)\n" + " - main shape: {}\n".format(su) + " - nb. chan. selected: {}\n".format(len(indch)) + " - indch: {}".format(indch)) warnings.warn(msg) - - ls = [t[ii].shape for ii in range(0,len(t))] - lsu = list(set([ssu for ssu in ls if 0 not in ssu])) - su = lsu[np.argmax([ls.count(ssu) for ssu in lsu])] - if indch is None: - indch = [ii for ii in range(0,len(t)) if ls[ii] == su] else: - indch = [indch[ii] for ii in range(0,len(t)) if ls[ii] == su] - + if indch is None: + ls = ['index {} {}.shape {}'.format(ii, kk, + out[dsig[kk]][ii].shape) + for ii in range(0, len(out[dsig[kk]]))] + else: + ls = ['index {} {}.shape {}'.format(indch[ii], kk, + out[dsig[kk]][ii].shape) + for ii in range(0, len(out[dsig[kk]]))] + msg = ("The following is supposed to be a np.ndarray:\n" + + " - diag: {}\n".format(ids) + + " - shortcut: {}\n".format(dsig[kk]) + + " - used as: {} input\n".format(kk) + + " Observed type: {}\n".format(type(out[dsig[kk]])) + + " Probable cause: non-uniform shape (vs channels)\n" + + " => shapes :\n " + + "\n ".join(ls) + + "\n => Solution: choose indch accordingly !") + raise Exception(msg) nchout = 0 if indch is None else len(indch) return indch, nchout != nch @@ -3308,7 +3347,8 @@ def _checkformat_Data_dsig(self, ids=None, dsig=None, data=None, X=None, def to_Data(self, ids=None, dsig=None, data=None, X=None, tlim=None, indch=None, indch_auto=False, Name=None, occ=None, config=None, dextra=None, t0=None, datacls=None, geomcls=None, - plot=True, bck=True, fallback_X=None, nan=True, pos=None): + plot=True, bck=True, fallback_X=None, nan=True, pos=None, + return_indch=False): # dsig datacls, geomcls, dsig = self._checkformat_Data_dsig(ids, dsig, @@ -3349,11 +3389,11 @@ def to_Data(self, ids=None, dsig=None, data=None, X=None, tlim=None, raise Exception(msg) if 'LOS' in geomcls: - lk = ['los_ptsRZPhi','etendue','surface'] + lk_geom = ['los_ptsRZPhi','etendue','surface'] lkok = set(self._dshort[ids].keys()) lkok = lkok.union(self._dcomp[ids].keys()) - lk = list(set(lk).intersection(lkok)) - dgeom, Etendues, Surfaces, names = self._to_Cam_Du(ids, lk, indch, + lk_geom = list(set(lk_geom).intersection(lkok)) + dgeom, Etendues, Surfaces, names = self._to_Cam_Du(ids, lk_geom, indch, nan=nan, pos=pos) # ---------- @@ -3373,13 +3413,18 @@ def to_Data(self, ids=None, dsig=None, data=None, X=None, tlim=None, indch, modif = self._get_indch_geomtdata(indch=indch, indch_auto=indch_auto, dgeom=dgeom, t=t) + assert modif is True else: indch, modif = self._get_indch_geomtdata(indch=indch, indch_auto=indch_auto, dgeom=dgeom) if modif is True: - dgeom, Etendues, Surfaces, names = self._to_Cam_Du(ids, lk, indch, - nan=nan, pos=pos) + if geomcls != False: + dgeom, Etendues, Surfaces, names = self._to_Cam_Du( + ids, lk_geom, indch, nan=nan, pos=pos) + t = self.get_data(ids, sig='t', indch=indch)['t'] + modif = False + if names is not None: dchans['names'] = names @@ -3395,47 +3440,14 @@ def to_Data(self, ids=None, dsig=None, data=None, X=None, tlim=None, indt=indt, indch=indch, nan=nan, pos=pos) for kk in set(lk).difference('t'): if not isinstance(out[dsig[kk]], np.ndarray): - if indch_auto: - ls = [out[dsig[kk]][ii].shape - for ii in range(0,len(out[dsig[kk]]))] - lsu = list(set([ssu for ssu in ls if 0 not in ssu])) - su = lsu[np.argmax([ls.count(ssu) for ssu in lsu])] - if indch is None: - indch = [ii for ii in range(0,len(out[dsig[kk]])) - if ls[ii] == su] - else: - indch = [indch[ii] for ii in range(0,len(out[dsig[kk]])) - if ls[ii] == su] + indch, modifk = self._get_indch_geomtdata(indch=indch, + indch_auto=indch_auto, + out=out, dsig=dsig, + kk=kk) + if modifk is True: out = self.get_data(ids, sig=[dsig[k] for k in lk], - indt=indt, indch=indch, nan=nan, - pos=pos) - - # Remove ? put in function ? - if cam is not None: - cam = cam.get_subset(indch=indch) - msg = ("indch set automatically for %s\n"%ids - + " (due to inhomogeneous data shapes)\n" - + " - main shape: %s\n"%str(su) - + " - nb. chan. selected: %s\n"%len(indch) - + " - indch: %s"%str(indch)) - warnings.warn(msg) - else: - if indch is None: - ls = ['index %s %s.shape %s'%(ii,kk,str(out[dsig[kk]][ii].shape)) - for ii in range(0,len(out[dsig[kk]]))] - else: - ls = ['index %s %s.shape %s'%(indch[ii],kk,str(out[dsig[kk]][ii].shape)) - for ii in range(0,len(out[dsig[kk]]))] - msg = ("The following is supposed to be a np.ndarray:\n" - + " - diag: %s\n"%ids - + " - shortcut: %s\n"%dsig[kk] - + " - used as: %s input\n"%kk - + " Observed type: %s\n"%str(type(out[dsig[kk]])) - + " Probable cause: non-uniform shape (vs channels)\n" - + " => shapes :\n " - + "\n ".join(ls) - + "\n => Solution: choose indch accordingly !") - raise Exception(msg) + indt=indt, indch=indch, nan=nan, pos=pos) + modif = True # Arrange depending on shape and field if type(out[dsig[kk]]) is not np.ndarray: @@ -3462,6 +3474,13 @@ def to_Data(self, ids=None, dsig=None, data=None, X=None, tlim=None, assert kk == 'data' dins[kk] = np.swapaxes(out[dsig[kk]].T, 1,2) + # Update dgeom if necessary + if modif is True and geomcls != False: + dgeom, Etendues, Surfaces, names = self._to_Cam_Du(ids, lk_geom, indch, + nan=nan, pos=pos) + modif = False + + # -------------------------- # Format special ids cases if ids == 'reflectometer_profile': @@ -3522,7 +3541,10 @@ def to_Data(self, ids=None, dsig=None, data=None, X=None, tlim=None, if plot: Data.plot(draw=True, bck=bck) - return Data + if return_indch is True: + return Data, indch + else: + return Data def _get_synth(self, ids, dsig=None, @@ -3599,6 +3621,23 @@ def calc_signal(self, ids=None, dsig=None, tlim=None, t=None, res=None, bck=True, fallback_X=None, nan=True, pos=None, plot=True, plot_compare=None, plot_plasma=None): + # Check / format inputs + if plot is None: + plot = True + + if plot: + if plot_compare is None: + plot_compare = True + if plot_plasma is None: + plot_plasma = True + + # Get experimental data first if relevant + # to get correct indch for comparison + if plot and plot_compare: + data, indch = self.to_Data(ids, indch=indch, + indch_auto=indch_auto, t0=t0, + return_indch=True, plot=False) + # Get camera cam = self.to_Cam(ids=ids, indch=indch, Name=None, occ=occ_cam, config=config, @@ -3722,15 +3761,9 @@ def calc_signal(self, ids=None, dsig=None, tlim=None, t=None, res=None, # plot if plot: - if plot_compare is None: - plot_compare = True - if plot_plasma is None: - plot_plasma = True if plot_compare: if err_comp: raise Exception(msg) - data = self.to_Data(ids, indch=indch, - indch_auto=indch_auto, t0=t0, plot=False) sig._dlabels = data.dlabels data.plot_compare(sig) else: diff --git a/tofu/version.py b/tofu/version.py index 4b800b3d2..a3a505a54 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.2-a5-65-g583cb9b' +__version__ = '1.4.2-a5-72-g320dc7d' From e8560d120a656c8c1f4055c14b4612f7b6b53970 Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Fri, 10 Jan 2020 14:25:59 +0100 Subject: [PATCH 112/168] testing --- .travis.yml | 9 --------- tofu/version.py | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5defdf5a1..735009930 100644 --- a/.travis.yml +++ b/.travis.yml @@ -78,15 +78,6 @@ before_deploy: - export PKG_REAL=$(conda build . --output | tail -1) - echo "BEFORE DEPLOY END.........." deploy: - - provider: pypi - on: - tags: true - branch: master - skip_existing: true - user: __token__ - password: - secure: a4HWH6oCDqnWkaqALeppbs/ud1k/bxlyhjUkMMwV7R55V07n/FSROyGPp+Vo1bOGUi35AnsqUF8PWfxvAhKSUZNFYpIrDGRe960JCGRlMrpkzObY3r+uUeVyyxP5540mUW0oqK+uaAynFWxqNgfRNh+SUS4Kgvx9lPslpnlNDTIBA9TN9cnReBuwcFhbosm9QSSqjJ8+ybP5OawIlL5iYiPot4NFXbTe3vjQrdNKfpNCS98QFBbbTijM0Hw5eU8X2R7/PyReU3TlLJvpUqO4PrOvAW85eIy6vrfKo9dgfFczJf3hUUfjGFSK3brm2HqJDUsxn/hg+GM7vynH63HyCLdQq+HZJUTCzfzts4BljQzrrAn6+0Ze/oMuVKynFZKnm0A08rHdLpcCiE3C+ehcJ9zttYPkiJYpRRQssPes8/ZqVVYAHHgH88Cts8i736rcR1eYyGzNrTRoT1AGCbco98Vaj/6/pEtC84OQIfXLFPeFGBSeAQcJ6RKwlDKeJeyQ23gUFyqRFqs9SR8EE6pfo7zYpWpuW+ZT1ESKghWuel14T4xcVohbX1MTsKEkjR+25SGWCq4KE1ql4H+m8h0A2FvIvRnK74uFfNFv1qbXYrFEYVTW2T19MtcWcYnzhMyOgIbb9I1MEgpEB6WgPC9EZhvSBiOBh5r8i+MlcxaMQZ4= - server: https://test.pypi.org/legacy/ - provider: pypi distributions: "sdist" user: __token__ diff --git a/tofu/version.py b/tofu/version.py index 29baf584f..5621bf6f1 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.2b8' +__version__ = '1.4.2b10' From 1b17fca629f0b5d0e3845aada63e4c1db252e7ba Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Fri, 10 Jan 2020 14:29:09 +0100 Subject: [PATCH 113/168] [Issue321] PEP8 compliance --- tofu/data/_comp.py | 10 +++++----- tofu/data/_core.py | 6 ++++-- tofu/data/_plot.py | 2 +- tofu/version.py | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/tofu/data/_comp.py b/tofu/data/_comp.py index 1314d1f44..4bea536e3 100644 --- a/tofu/data/_comp.py +++ b/tofu/data/_comp.py @@ -671,13 +671,13 @@ def func(pts, vect=None, t=None, ntall=ntall, tall=tall, tbinall=tbinall): # Get pts in (r,z,phi) - r, z = np.hypot(pts[0,:],pts[1,:]), pts[2,:] - phi = np.arctan2(pts[1,:],pts[0,:]) + r, z = np.hypot(pts[0, :],pts[1, :]), pts[2, :] + phi = np.arctan2(pts[1, :],pts[0, :]) # Deduce vect in (r,z,phi) - vR = np.cos(phi)*vect[0,:] + np.sin(phi)*vect[1,:] - vPhi = -np.sin(phi)*vect[0,:] + np.cos(phi)*vect[1,:] - vZ = vect[2,:] + vR = np.cos(phi)*vect[0, :] + np.sin(phi)*vect[1, :] + vPhi = -np.sin(phi)*vect[0, :] + np.cos(phi)*vect[1, :] + vZ = vect[2, :] # Prepare output shapeval = list(pts.shape) diff --git a/tofu/data/_core.py b/tofu/data/_core.py index c80bcc579..e55e57a78 100644 --- a/tofu/data/_core.py +++ b/tofu/data/_core.py @@ -3929,10 +3929,12 @@ def interp_pts2profile(self, pts=None, vect=None, t=None, self.dmesh[idmesh]['data']['nZ']) Z = np.repeat(self.dmesh[idmesh]['data']['Z'], self.dmesh[idmesh]['data']['nR']) - pts = np.array([R, np.zeros((self.dmesh[idmesh]['data']['size'],)), Z]) + pts = np.array( + [R, np.zeros((self.dmesh[idmesh]['data']['size'],)), Z]) else: pts = self.dmesh[idmesh]['data']['nodes'] - pts = np.array([pts[:,0], np.zeros((pts.shape[0],)), pts[:,1]]) + pts = np.array( + [pts[:, 0], np.zeros((pts.shape[0],)), pts[:, 1]]) pts = np.atleast_2d(pts) if pts.shape[0] != 3: diff --git a/tofu/data/_plot.py b/tofu/data/_plot.py index 0949197d2..4101ba8d9 100644 --- a/tofu/data/_plot.py +++ b/tofu/data/_plot.py @@ -389,7 +389,7 @@ def _DataCam12D_plot(lData, key=None, nchMax=_nchMax, ntMax=_ntMax, if not all(c0): msg = ("All Data objects must have the same nb. of channels\n" + "\t- self.nch: {}\n".format([dd.nch for dd in lData]) - + "\n => use self.set_indch()") + + "\n => use self.set_indch()") raise Exception(msg) nch = lData[0].nch diff --git a/tofu/version.py b/tofu/version.py index a3a505a54..8a1afcc5a 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.2-a5-72-g320dc7d' +__version__ = '1.4.2-a5-73-g75d20ea' From 456254d949b3ec23c5ed795336c3c95ab1b4a546 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Fri, 10 Jan 2020 14:35:25 +0100 Subject: [PATCH 114/168] [Issue321] PEP8 compliance 2 --- tofu/data/_comp.py | 4 +-- tofu/imas2tofu/_core.py | 78 ++++++++++++++++++++++------------------- tofu/version.py | 2 +- 3 files changed, 45 insertions(+), 39 deletions(-) diff --git a/tofu/data/_comp.py b/tofu/data/_comp.py index 4bea536e3..bff7f4516 100644 --- a/tofu/data/_comp.py +++ b/tofu/data/_comp.py @@ -671,8 +671,8 @@ def func(pts, vect=None, t=None, ntall=ntall, tall=tall, tbinall=tbinall): # Get pts in (r,z,phi) - r, z = np.hypot(pts[0, :],pts[1, :]), pts[2, :] - phi = np.arctan2(pts[1, :],pts[0, :]) + r, z = np.hypot(pts[0, :], pts[1, :]), pts[2, :] + phi = np.arctan2(pts[1, :], pts[0, :]) # Deduce vect in (r,z,phi) vR = np.cos(phi)*vect[0, :] + np.sin(phi)*vect[1, :] diff --git a/tofu/imas2tofu/_core.py b/tofu/imas2tofu/_core.py index 744e59be0..547bc100c 100644 --- a/tofu/imas2tofu/_core.py +++ b/tofu/imas2tofu/_core.py @@ -154,10 +154,14 @@ class MultiIDSLoader(object): 'dim':'B', 'quant':'BT', 'units':'T'}, '2dBZ':{'str':'time_slice[time].ggd[0].b_field_z[0].values', 'dim':'B', 'quant':'BZ', 'units':'T'}, - '2dmeshNodes':{'str':'grids_ggd[0].grid[0].space[0].objects_per_dimension[0].object[].geometry'}, - '2dmeshFaces':{'str':'grids_ggd[0].grid[0].space[0].objects_per_dimension[2].object[].nodes'}, - '2dmeshR':{'str':'time_slice[0].profiles_2d[0].r'}, - '2dmeshZ':{'str':'time_slice[0].profiles_2d[0].z'}}, + '2dmeshNodes':{'str': ('grids_ggd[0].grid[0].space[0]' + + '.objects_per_dimension[0]' + + '.object[].geometry')}, + '2dmeshFaces':{'str': ('grids_ggd[0].grid[0].space[0]' + + '.objects_per_dimension[2]' + + '.object[].nodes')}, + '2dmeshR':{'str': 'time_slice[0].profiles_2d[0].r'}, + '2dmeshZ':{'str': 'time_slice[0].profiles_2d[0].z'}}, 'core_profiles': {'t':{'str':'time'}, @@ -253,10 +257,10 @@ class MultiIDSLoader(object): 'floop_flux':{'str':'flux_loop[chan].flux.data', 'dim':'B flux', 'quant':'B flux', 'units':'Wb'}, 'floop_name':{'str':'flux_loop[chan].name'}, - 'floop_R':{'str':'flux_loop[chan].position.r', - 'dim':'distance', 'quant':'R', 'units':'m'}, - 'floop_Z':{'str':'flux_loop[chan].position.z', - 'dim':'distance', 'quant':'Z', 'units':'m'}}, + 'floop_R':{'str': 'flux_loop[chan].position.r', + 'dim': 'distance', 'quant': 'R', 'units': 'm'}, + 'floop_Z':{'str': 'flux_loop[chan].position.z', + 'dim': 'distance', 'quant': 'Z', 'units': 'm'}}, 'barometry': {'t':{'str': 'gauge[chan].pressure.time'}, @@ -300,43 +304,45 @@ class MultiIDSLoader(object): 'phi':{'str':'channel[chan].position.phi.data', 'dim':'angle', 'quant':'phi', 'units':'rad'}, 'names': {'str': 'channel[chan].name'}, - 'mode':{'str':'mode'}, - 'sweep':{'str':'sweep_time'}}, + 'mode': {'str': 'mode'}, + 'sweep': {'str': 'sweep_time'}}, 'interferometer': - {'t':{'str':'time', - 'quant':'t', 'units':'s'}, + {'t': {'str': 'time', + 'quant': 't', 'units': 's'}, 'names': {'str': 'channel[chan].name'}, - 'ne_integ':{'str':'channel[chan].n_e_line.data', - 'dim':'ne_integ', 'quant':'ne_integ', - 'units':'/m2', 'Brightness': True}}, + 'ne_integ': {'str': 'channel[chan].n_e_line.data', + 'dim': 'ne_integ', 'quant': 'ne_integ', + 'units': '/m2', 'Brightness': True}}, 'polarimeter': - {'t':{'str':'time', - 'quant':'t', 'units':'s'}, - 'lamb':{'str':'channel[chan].wavelength', - 'dim':'distance', 'quant':'wavelength', 'units':'m'}, - 'fangle':{'str':'channel[chan].faraday_angle.data', - 'dim':'angle', 'quant':'faraday angle', - 'units':'rad', 'Brightness': True}, + {'t': {'str': 'time', + 'quant': 't', 'units': 's'}, + 'lamb': {'str' :'channel[chan].wavelength', + 'dim' :'distance', 'quant' :'wavelength', + 'units': 'm'}, + 'fangle': {'str': 'channel[chan].faraday_angle.data', + 'dim': 'angle', 'quant': 'faraday angle', + 'units': 'rad', 'Brightness': True}, 'names': {'str': 'channel[chan].name'}}, 'bolometer': - {'t':{'str':'channel[chan].power.time', - 'quant':'t', 'units':'s'}, - 'power':{'str':'channel[chan].power.data', - 'dim':'power', 'quant':'power radiative', 'units':'W', - 'Brightness': False}, - 'etendue':{'str':'channel[chan].etendue', - 'dim':'etendue', 'quant':'etendue', - 'units':'m2.sr'}, + {'t': {'str': 'channel[chan].power.time', + 'quant': 't', 'units': 's'}, + 'power': {'str': 'channel[chan].power.data', + 'dim': 'power', 'quant': 'power radiative', + 'units': 'W', 'Brightness': False}, + 'etendue': {'str': 'channel[chan].etendue', + 'dim': 'etendue', 'quant': 'etendue', + 'units': 'm2.sr'}, 'names': {'str': 'channel[chan].name'}, - 'tpower':{'str':'time','quant':'t', 'units':'s'}, - 'prad':{'str':'power_radiated_total', - 'dim':'power', 'quant':'power radiative', 'units':'W'}, - 'pradbulk':{'str':'power_radiated_inside_lcfs', - 'dim':'power', 'quant':'power radiative', - 'units':'W'}}, + 'tpower': {'str': 'time','quant': 't', 'units': 's'}, + 'prad': {'str': 'power_radiated_total', + 'dim': 'power', 'quant': 'power radiative', + 'units': 'W'}, + 'pradbulk': {'str': 'power_radiated_inside_lcfs', + 'dim': 'power', 'quant': 'power radiative', + 'units': 'W'}}, 'soft_x_rays': {'t':{'str':'time', diff --git a/tofu/version.py b/tofu/version.py index 8a1afcc5a..4847591e6 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.2-a5-73-g75d20ea' +__version__ = '1.4.2-a5-74-g1b17fca' From af676c780915f13855deacffac51356a1884fe44 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Fri, 10 Jan 2020 14:40:10 +0100 Subject: [PATCH 115/168] [Issue321] PEP8 compliance 3 --- tofu/imas2tofu/_core.py | 66 ++++++++++++++++++++--------------------- tofu/version.py | 2 +- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/tofu/imas2tofu/_core.py b/tofu/imas2tofu/_core.py index 547bc100c..88f2be8c0 100644 --- a/tofu/imas2tofu/_core.py +++ b/tofu/imas2tofu/_core.py @@ -154,14 +154,14 @@ class MultiIDSLoader(object): 'dim':'B', 'quant':'BT', 'units':'T'}, '2dBZ':{'str':'time_slice[time].ggd[0].b_field_z[0].values', 'dim':'B', 'quant':'BZ', 'units':'T'}, - '2dmeshNodes':{'str': ('grids_ggd[0].grid[0].space[0]' - + '.objects_per_dimension[0]' - + '.object[].geometry')}, - '2dmeshFaces':{'str': ('grids_ggd[0].grid[0].space[0]' - + '.objects_per_dimension[2]' - + '.object[].nodes')}, - '2dmeshR':{'str': 'time_slice[0].profiles_2d[0].r'}, - '2dmeshZ':{'str': 'time_slice[0].profiles_2d[0].z'}}, + '2dmeshNodes': {'str': ('grids_ggd[0].grid[0].space[0]' + + '.objects_per_dimension[0]' + + '.object[].geometry')}, + '2dmeshFaces': {'str': ('grids_ggd[0].grid[0].space[0]' + + '.objects_per_dimension[2]' + + '.object[].nodes')}, + '2dmeshR': {'str': 'time_slice[0].profiles_2d[0].r'}, + '2dmeshZ': {'str': 'time_slice[0].profiles_2d[0].z'}}, 'core_profiles': {'t':{'str':'time'}, @@ -257,16 +257,16 @@ class MultiIDSLoader(object): 'floop_flux':{'str':'flux_loop[chan].flux.data', 'dim':'B flux', 'quant':'B flux', 'units':'Wb'}, 'floop_name':{'str':'flux_loop[chan].name'}, - 'floop_R':{'str': 'flux_loop[chan].position.r', - 'dim': 'distance', 'quant': 'R', 'units': 'm'}, - 'floop_Z':{'str': 'flux_loop[chan].position.z', - 'dim': 'distance', 'quant': 'Z', 'units': 'm'}}, + 'floop_R': {'str': 'flux_loop[chan].position.r', + 'dim': 'distance', 'quant': 'R', 'units': 'm'}, + 'floop_Z': {'str': 'flux_loop[chan].position.z', + 'dim': 'distance', 'quant': 'Z', 'units': 'm'}}, 'barometry': - {'t':{'str': 'gauge[chan].pressure.time'}, + {'t': {'str': 'gauge[chan].pressure.time'}, 'names': {'str': 'gauge[chan].name'}, - 'p':{'str': 'gauge[chan].pressure.data', - 'dim': 'pressure', 'quant': 'p', 'units': 'Pa?'}}, + 'p': {'str': 'gauge[chan].pressure.data', + 'dim': 'pressure', 'quant': 'p', 'units': 'Pa?'}}, 'neutron_diagnostic': {'t':{'str':'time', 'units':'s'}, @@ -317,13 +317,13 @@ class MultiIDSLoader(object): 'polarimeter': {'t': {'str': 'time', - 'quant': 't', 'units': 's'}, - 'lamb': {'str' :'channel[chan].wavelength', - 'dim' :'distance', 'quant' :'wavelength', + 'quant': 't', 'units': 's'}, + 'lamb': {'str': 'channel[chan].wavelength', + 'dim': 'distance', 'quant': 'wavelength', 'units': 'm'}, 'fangle': {'str': 'channel[chan].faraday_angle.data', - 'dim': 'angle', 'quant': 'faraday angle', - 'units': 'rad', 'Brightness': True}, + 'dim': 'angle', 'quant': 'faraday angle', + 'units': 'rad', 'Brightness': True}, 'names': {'str': 'channel[chan].name'}}, 'bolometer': @@ -336,26 +336,26 @@ class MultiIDSLoader(object): 'dim': 'etendue', 'quant': 'etendue', 'units': 'm2.sr'}, 'names': {'str': 'channel[chan].name'}, - 'tpower': {'str': 'time','quant': 't', 'units': 's'}, + 'tpower': {'str': 'time', 'quant': 't', 'units': 's'}, 'prad': {'str': 'power_radiated_total', 'dim': 'power', 'quant': 'power radiative', 'units': 'W'}, 'pradbulk': {'str': 'power_radiated_inside_lcfs', - 'dim': 'power', 'quant': 'power radiative', - 'units': 'W'}}, + 'dim': 'power', 'quant': 'power radiative', + 'units': 'W'}}, 'soft_x_rays': - {'t':{'str':'time', - 'quant':'t', 'units':'s'}, - 'power':{'str':'channel[chan].power.data', - 'dim':'power', 'quant':'power radiative', 'units':'W', - 'Brightness': False}, - 'brightness':{'str':'channel[chan].brightness.data', - 'dim':'brightness', 'quant':'brightness', - 'units':'W/(m2.sr)', 'Brightness': True}, + {'t': {'str': 'time', + 'quant': 't', 'units': 's'}, + 'power': {'str':'channel[chan].power.data', + 'dim': 'power', 'quant': 'power radiative', + 'units': 'W', 'Brightness': False}, + 'brightness': {'str': 'channel[chan].brightness.data', + 'dim': 'brightness', 'quant': 'brightness', + 'units': 'W/(m2.sr)', 'Brightness': True}, 'names': {'str': 'channel[chan].name'}, - 'etendue':{'str':'channel[chan].etendue', - 'dim':'etendue', 'quant':'etendue', 'units':'m2.sr'}}, + 'etendue': {'str': 'channel[chan].etendue', + 'dim': 'etendue', 'quant': 'etendue', 'units': 'm2.sr'}}, 'spectrometer_visible': {'t':{'str':'channel[chan].grating_spectrometer.radiance_spectral.time', diff --git a/tofu/version.py b/tofu/version.py index 4847591e6..c2ca7c57c 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.2-a5-74-g1b17fca' +__version__ = '1.4.2-a5-75-g456254d' From fac943f446b989850bccb3c4369b3c3ba61532db Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Fri, 10 Jan 2020 14:46:33 +0100 Subject: [PATCH 116/168] [Issue321] PEP8 compliance 4 --- tofu/imas2tofu/_core.py | 44 +++++++++++++++++++++++------------------ tofu/version.py | 2 +- 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/tofu/imas2tofu/_core.py b/tofu/imas2tofu/_core.py index 88f2be8c0..142a3fe1b 100644 --- a/tofu/imas2tofu/_core.py +++ b/tofu/imas2tofu/_core.py @@ -347,7 +347,7 @@ class MultiIDSLoader(object): 'soft_x_rays': {'t': {'str': 'time', 'quant': 't', 'units': 's'}, - 'power': {'str':'channel[chan].power.data', + 'power': {'str': 'channel[chan].power.data', 'dim': 'power', 'quant': 'power radiative', 'units': 'W', 'Brightness': False}, 'brightness': {'str': 'channel[chan].brightness.data', @@ -355,21 +355,24 @@ class MultiIDSLoader(object): 'units': 'W/(m2.sr)', 'Brightness': True}, 'names': {'str': 'channel[chan].name'}, 'etendue': {'str': 'channel[chan].etendue', - 'dim': 'etendue', 'quant': 'etendue', 'units': 'm2.sr'}}, + 'dim': 'etendue', 'quant': 'etendue', + 'units': 'm2.sr'}}, 'spectrometer_visible': {'t':{'str':'channel[chan].grating_spectrometer.radiance_spectral.time', 'quant':'t', 'units':'s'}, - 'spectra':{'str':'channel[chan].grating_spectrometer.radiance_spectral.data', - 'dim':'radiance_spectral', 'quant':'radiance_spectral', - 'units':'ph/s/(m2.sr)/m', 'Brightness': True}, + 'spectra': {'str': ('channel[chan].grating_spectrometer' + + '.radiance_spectral.data'), + 'dim': 'radiance_spectral', + 'quant': 'radiance_spectral', + 'units': 'ph/s/(m2.sr)/m', 'Brightness': True}, 'names': {'str': 'channel[chan].name'}, 'lamb':{'str':'channel[chan].grating_spectrometer.wavelengths', 'dim':'wavelength', 'quant':'wavelength', 'units':'m'}}, 'bremsstrahlung_visible': - {'t':{'str':'time', - 'quant':'t', 'units':'s'}, + {'t': {'str': 'time', + 'quant': 't', 'units': 's'}, 'radiance':{'str':'channel[chan].radiance_spectral.data', 'dim':'radiance_spectral', 'quant':'radiance_spectral', 'units':'ph/s/(m2.sr)/m', 'Brightness': True}, @@ -502,11 +505,12 @@ class MultiIDSLoader(object): _icmod = lambda al, ar, axis=0: np.sum(al - ar, axis=axis) _eqB = lambda BT, BR, BZ: np.sqrt(BT**2 + BR**2 + BZ**2) def _rhopn1d(psi): - return np.sqrt( (psi - psi[:,0:1]) / (psi[:,-1] - psi[:,0])[:,None] ) + return np.sqrt((psi - psi[:, 0:1]) / (psi[:, -1] - psi[:, 0])[:, None]) def _rhopn2d(psi, psi0, psisep): - return np.sqrt( (psi - psi0[:,None]) / (psisep[:,None] - psi0[:,None]) ) + return np.sqrt( + (psi - psi0[:, None]) / (psisep[:, None] - psi0[:, None])) def _rhotn2d(phi): - return np.sqrt(np.abs(phi) / np.nanmax(np.abs(phi), axis=1)[:,None]) + return np.sqrt(np.abs(phi) / np.nanmax(np.abs(phi), axis=1)[:, None]) def _eqSep(sepR, sepZ, npts=100): nt = len(sepR) @@ -2243,7 +2247,6 @@ def _get_t0(self, t0=None): warnings.warn(msg) return t0 - def to_Config(self, Name=None, occ=None, description_2d=None, mobile=None, plot=True): lidsok = ['wall'] @@ -2338,10 +2341,11 @@ def to_Config(self, Name=None, occ=None, nunits = len(units) if nunits == 0: - msg = "There is no unit stored !\n" - msg += "The required 2d description is empty:\n" - ms = "len(idd.%s[occ=%s].description_2d"%(ids, str(occ)) - msg += "%s[%s].limiter.unit) = 0"%(ms, str(description_2d)) + msg = ("There is no unit stored !\n" + + "The required 2d description is empty:\n") + ms = "len(idd.{}[occ={}].description_2d".format(ids, occ) + msg += "{}[{}].limiter.unit) = 0".format(ms, + description_2d) raise Exception(msg) lS = [None for _ in units] @@ -2354,7 +2358,7 @@ def to_Config(self, Name=None, occ=None, poly = np.array([outline.r, outline.z]) if units[ii].phi_extensions.size > 0: - pos, extent = units[ii].phi_extensions.T + pos, extent = units[ii].phi_extensions.T else: pos, extent = None, None name = units[ii].name @@ -2368,15 +2372,17 @@ def to_Config(self, Name=None, occ=None, elif len(ln) == 3: cls, name, mobi = ln else: - name = name.replace('_','') + name = name.replace('_', '') if cls is None: if ii == nunits-1: cls = 'Ves' else: cls = 'PFC' mobi = mobi == 'mobile' - lS[ii] = getattr(mod, cls)(Poly=poly, pos=pos, extent=extent, - Name=name, mobile=mobi, **kwargs) + lS[ii] = getattr(mod, cls)(Poly=poly, pos=pos, + extent=extent, + Name=name, mobile=mobi, + **kwargs) except Exception as err: msg = ("PFC unit[{}] named {} ".format(ii, name) + "could not be loaded!\n" diff --git a/tofu/version.py b/tofu/version.py index c2ca7c57c..1058be62c 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.2-a5-75-g456254d' +__version__ = '1.4.2-a5-76-gaf676c7' From bb2a7e11758158f67b7082605c637f31c9ca86e6 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Fri, 10 Jan 2020 14:52:52 +0100 Subject: [PATCH 117/168] [Issue321] PEP8 compliance 5 --- tofu/imas2tofu/_core.py | 59 ++++++++++++++++++++++++----------------- tofu/utils.py | 6 ++--- tofu/version.py | 2 +- 3 files changed, 39 insertions(+), 28 deletions(-) diff --git a/tofu/imas2tofu/_core.py b/tofu/imas2tofu/_core.py index 142a3fe1b..974234eca 100644 --- a/tofu/imas2tofu/_core.py +++ b/tofu/imas2tofu/_core.py @@ -375,7 +375,7 @@ class MultiIDSLoader(object): 'quant': 't', 'units': 's'}, 'radiance':{'str':'channel[chan].radiance_spectral.data', 'dim':'radiance_spectral', 'quant':'radiance_spectral', - 'units':'ph/s/(m2.sr)/m', 'Brightness': True}, + 'units': 'ph/s/(m2.sr)/m', 'Brightness': True}, 'names': {'str': 'channel[chan].name'}, 'lamb_up': {'str':'channel[chan].filter.wavelength_upper'}, 'lamb_lo': {'str':'channel[chan].filter.wavelength_lower'}}, @@ -3098,12 +3098,12 @@ def _get_indch_geomtdata(self, indch=None, indch_auto=None, indnan = np.logical_or(np.any(np.isnan(dgeom[0]), axis=0), np.any(np.isnan(dgeom[1]), axis=0)) if np.any(indnan) and not np.all(indnan): - if indch_auto != True: - dmsg = {True: 'not available', False:'ok'} - ls = ['index %s los %s'%(ii, dmsg[indnan[ii]]) + if indch_auto is not True: + dmsg = {True: 'not available', False: 'ok'} + ls = ['index {} los {}'.format(ii, dmsg[indnan[ii]]) for ii in range(0, dgeom[0].shape[1])] msg = ("The geometry of all channels is not available !\n" - + "Please choose indch to get all channels geomery !\n" + + "Please choose indch to get all LOS!\n" + "Currently:\n" + "\n ".join(ls) + "\n\n => Solution: choose indch accordingly !") @@ -3111,7 +3111,7 @@ def _get_indch_geomtdata(self, indch=None, indch_auto=None, else: msg = ("Geometry missing for some los !\n" + " => indch automatically set to:\n" - + " %s"%str(indch)) + + " {}".format(indch)) warnings.warn(msg) if indch is None: indch = (~indnan).nonzero()[0] @@ -3121,15 +3121,19 @@ def _get_indch_geomtdata(self, indch=None, indch_auto=None, # Get from time vectors consistency if t is not None: - if indch_auto != True: + if indch_auto is not True: if indch is None: - ls = ['index {} {}.shape {}'.format(ii, kk, - str(out[dsig[kk]][ii].shape)) - for ii in range(0, len(out[dsig[kk]]))] + ls = [ + 'index {} {}.shape {}'.format(ii, kk, + out[dsig[kk]][ii].shape) + for ii in range(0, len(out[dsig[kk]])) + ] else: - ls = ['index {} {}.shape {}'.format(indch[ii], kk, - str(out[dsig[kk]][ii].shape)) - for ii in range(0, len(out[dsig[kk]]))] + ls = [ + 'index {} {}.shape {}'.format(indch[ii], kk, + out[dsig[kk]][ii].shape) + for ii in range(0, len(out[dsig[kk]])) + ] msg = ("The following is supposed to be a np.ndarray:\n" + " - diag: {}\n".format(ids) + " - shortcut: {}\n".format(dsig[kk]) @@ -3170,20 +3174,24 @@ def _get_indch_geomtdata(self, indch=None, indch_auto=None, indch = [indch[ii] for ii in range(0, len(out[dsig[kk]])) if ls[ii] == su] msg = ("indch set automatically for {}\n".format(ids) - + " (due to inhomogeneous data shapes)\n" + + " (due to inhomogeneous data shapes)\n" + " - main shape: {}\n".format(su) + " - nb. chan. selected: {}\n".format(len(indch)) + " - indch: {}".format(indch)) warnings.warn(msg) else: if indch is None: - ls = ['index {} {}.shape {}'.format(ii, kk, - out[dsig[kk]][ii].shape) - for ii in range(0, len(out[dsig[kk]]))] + ls = [ + 'index {} {}.shape {}'.format(ii, kk, + out[dsig[kk]][ii].shape) + for ii in range(0, len(out[dsig[kk]])) + ] else: - ls = ['index {} {}.shape {}'.format(indch[ii], kk, - out[dsig[kk]][ii].shape) - for ii in range(0, len(out[dsig[kk]]))] + ls = [ + 'index {} {}.shape {}'.format(indch[ii], kk, + out[dsig[kk]][ii].shape) + for ii in range(0, len(out[dsig[kk]])) + ] msg = ("The following is supposed to be a np.ndarray:\n" + " - diag: {}\n".format(ids) + " - shortcut: {}\n".format(dsig[kk]) @@ -3262,20 +3270,23 @@ def to_Cam(self, ids=None, indch=None, indch_auto=False, raise Exception(msg) if 'LOS' in geom: - lk = ['los_ptsRZPhi','etendue','surface', 'names'] + lk = ['los_ptsRZPhi', 'etendue', 'surface', 'names'] lkok = set(self._dshort[ids].keys()) lkok = lkok.union(self._dcomp[ids].keys()) lk = list(set(lk).intersection(lkok)) dgeom, Etendues, Surfaces, names = self._to_Cam_Du(ids, lk, indch, - nan=nan, pos=pos) + nan=nan, + pos=pos) # Check all channels can be used, reset indch if necessary indch, modif = self._get_indch_geomtdata(indch=indch, indch_auto=indch_auto, dgeom=dgeom) if modif is True: - dgeom, Etendues, Surfaces, names = self._to_Cam_Du(ids, lk, indch, - nan=nan, pos=pos) + dgeom, Etendues, Surfaces, names = self._to_Cam_Du(ids, lk, + indch, + nan=nan, + pos=pos) if names is not None: dchans['names'] = names diff --git a/tofu/utils.py b/tofu/utils.py index a6b285d25..7868d9b39 100644 --- a/tofu/utils.py +++ b/tofu/utils.py @@ -972,9 +972,9 @@ def load_from_imas(shot=None, run=None, user=None, tokamak=None, version=None, # export to instances for ii in range(0,nids): if returnas[ii] == 'Config': - dout[ss]['Config'].append(multi.to_Config(Name=Name, occ=occ, - description_2d=description_2d, - plot=False)) + dout[ss]['Config'].append(multi.to_Config( + Name=Name, occ=occ, + description_2d=description_2d, plot=False)) elif returnas[ii] == 'Plasma2D': dout[ss]['Plasma2D'].append(multi.to_Plasma2D(Name=Name, occ=occ, diff --git a/tofu/version.py b/tofu/version.py index 1058be62c..f01c5e1c7 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.2-a5-76-gaf676c7' +__version__ = '1.4.2-a5-77-gfac943f' From 521264072bf7a372c5ba88ccc7871577734ce437 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Fri, 10 Jan 2020 14:57:30 +0100 Subject: [PATCH 118/168] [Issue321] PEP8 compliance 6 --- tofu/imas2tofu/_core.py | 12 +++++++----- tofu/version.py | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tofu/imas2tofu/_core.py b/tofu/imas2tofu/_core.py index 974234eca..a796cb0d5 100644 --- a/tofu/imas2tofu/_core.py +++ b/tofu/imas2tofu/_core.py @@ -373,9 +373,11 @@ class MultiIDSLoader(object): 'bremsstrahlung_visible': {'t': {'str': 'time', 'quant': 't', 'units': 's'}, - 'radiance':{'str':'channel[chan].radiance_spectral.data', - 'dim':'radiance_spectral', 'quant':'radiance_spectral', - 'units': 'ph/s/(m2.sr)/m', 'Brightness': True}, + 'radiance':{'str': 'channel[chan].radiance_spectral.data', + 'dim': 'radiance_spectral', + 'quant': 'radiance_spectral', + 'units': 'ph/s/(m2.sr)/m', + 'Brightness': True}, 'names': {'str': 'channel[chan].name'}, 'lamb_up': {'str':'channel[chan].filter.wavelength_upper'}, 'lamb_lo': {'str':'channel[chan].filter.wavelength_lower'}}, @@ -3084,7 +3086,7 @@ def _checkformat_Cam_geom(self, ids=None, geomcls=None, indch=None): lgeom = [kk for kk in dir(tfg) if 'Cam' in kk] if geomcls not in [False] + lgeom: - msg = "Arg geomcls must be in %s"%str([False]+lgeom) + msg = "Arg geomcls must be in {}".format([False]+lgeom) raise Exception(msg) return geomcls @@ -3498,7 +3500,7 @@ def to_Data(self, ids=None, dsig=None, data=None, X=None, tlim=None, dins[kk] = np.swapaxes(out[dsig[kk]].T, 1,2) # Update dgeom if necessary - if modif is True and geomcls != False: + if modif is True and geomcls is not False: dgeom, Etendues, Surfaces, names = self._to_Cam_Du(ids, lk_geom, indch, nan=nan, pos=pos) modif = False diff --git a/tofu/version.py b/tofu/version.py index f01c5e1c7..51df6437f 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.2-a5-77-gfac943f' +__version__ = '1.4.2-a5-78-gbb2a7e1' From 99e8092768118db1262a0ea12b1b82e1097717cb Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Fri, 10 Jan 2020 15:01:08 +0100 Subject: [PATCH 119/168] testing --- .travis.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 735009930..c8478846d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -88,14 +88,3 @@ deploy: server: https://test.pypi.org/legacy/ password: secure: o63EC+U+EtdAgUSV3plrLfZ7QZ6Aflp0quV5jJQxD9w47Ds5i4k5GjEHogV8x8l5NGwxbXPKp/1eKEfYgFH/i+WUnj1n9reiYZBd0lkr2Ih9nExNEIrziMhPbqjDEYAB672bjkXseS6mF44boqDUEP3jyDaamLB+aR75RCMM1j6aha/54Ko88ZJKXBW5FuNSraBGzgvjVG0P63jG5epS85hX09dEcKNR0XO0kbiGfNnYIp78QBohO0Pdv99x2ryp/QaoWD4m7cMUOts2xIcI2KCJNMhZNdIS8C0TVvk2tgumb+G2px7PsOxA8yZgxLefs+A14IAjg6uKe/jmwrihN1V6R6FF3WCcxM6kdzt9bpr+QKBoXjkF8BdxVbgmdnxkr+Ah5WIxmw2boQoW/SIMy9GVPrgtkSvocN6NwOExsO4pagiOwTLIvjIe+/0+OJt/Pud+mwF/94HD+B7j/XxsK7QehLCd9v5NTrdNgpS/TiWOyCDP1DLnpl1V9/vZ56x9NSQhN4Wr6hRrTxjWNAYLxsMxZf6uR+WWg1TqyicVlGrSf0to2asNIPWTTeGq3tB0/7WNslRQzP7QD67p5SuX0Z3Sv0WnQx+rZH77EN6FPCbv8Xn+D4ff06VKHaXXOkiFdK+6pTQ1VmFVPH/ablbWODhhcja/O3Xn3d/zTIyM+oQ= - - provider: pypi - distributions: "bdist_wheel" - user: __token__ - skip_existing: true - server: https://test.pypi.org/legacy/ - on: - condition: $OS = osx-64 - tags: true - all_branches: true - password: - secure: o63EC+U+EtdAgUSV3plrLfZ7QZ6Aflp0quV5jJQxD9w47Ds5i4k5GjEHogV8x8l5NGwxbXPKp/1eKEfYgFH/i+WUnj1n9reiYZBd0lkr2Ih9nExNEIrziMhPbqjDEYAB672bjkXseS6mF44boqDUEP3jyDaamLB+aR75RCMM1j6aha/54Ko88ZJKXBW5FuNSraBGzgvjVG0P63jG5epS85hX09dEcKNR0XO0kbiGfNnYIp78QBohO0Pdv99x2ryp/QaoWD4m7cMUOts2xIcI2KCJNMhZNdIS8C0TVvk2tgumb+G2px7PsOxA8yZgxLefs+A14IAjg6uKe/jmwrihN1V6R6FF3WCcxM6kdzt9bpr+QKBoXjkF8BdxVbgmdnxkr+Ah5WIxmw2boQoW/SIMy9GVPrgtkSvocN6NwOExsO4pagiOwTLIvjIe+/0+OJt/Pud+mwF/94HD+B7j/XxsK7QehLCd9v5NTrdNgpS/TiWOyCDP1DLnpl1V9/vZ56x9NSQhN4Wr6hRrTxjWNAYLxsMxZf6uR+WWg1TqyicVlGrSf0to2asNIPWTTeGq3tB0/7WNslRQzP7QD67p5SuX0Z3Sv0WnQx+rZH77EN6FPCbv8Xn+D4ff06VKHaXXOkiFdK+6pTQ1VmFVPH/ablbWODhhcja/O3Xn3d/zTIyM+oQ= From 2228cdaf8e472cb066fefe86bb41a7487463e24e Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Fri, 10 Jan 2020 15:03:15 +0100 Subject: [PATCH 120/168] new version --- tofu/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tofu/version.py b/tofu/version.py index 5621bf6f1..73a3a297c 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.2b10' +__version__ = '1.4.2b11' From e74f678b7f3f80623e6b664d008f4d489acd4038 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Fri, 10 Jan 2020 15:09:42 +0100 Subject: [PATCH 121/168] [Issue321] PEP8 compliance 7 --- tofu/imas2tofu/_core.py | 110 ++++++++++++++++++++-------------------- tofu/version.py | 2 +- 2 files changed, 57 insertions(+), 55 deletions(-) diff --git a/tofu/imas2tofu/_core.py b/tofu/imas2tofu/_core.py index a796cb0d5..851103299 100644 --- a/tofu/imas2tofu/_core.py +++ b/tofu/imas2tofu/_core.py @@ -373,11 +373,11 @@ class MultiIDSLoader(object): 'bremsstrahlung_visible': {'t': {'str': 'time', 'quant': 't', 'units': 's'}, - 'radiance':{'str': 'channel[chan].radiance_spectral.data', - 'dim': 'radiance_spectral', - 'quant': 'radiance_spectral', - 'units': 'ph/s/(m2.sr)/m', - 'Brightness': True}, + 'radiance': {'str': 'channel[chan].radiance_spectral.data', + 'dim': 'radiance_spectral', + 'quant': 'radiance_spectral', + 'units': 'ph/s/(m2.sr)/m', + 'Brightness': True}, 'names': {'str': 'channel[chan].name'}, 'lamb_up': {'str':'channel[chan].filter.wavelength_upper'}, 'lamb_lo': {'str':'channel[chan].filter.wavelength_lower'}}, @@ -3281,9 +3281,9 @@ def to_Cam(self, ids=None, indch=None, indch_auto=False, pos=pos) # Check all channels can be used, reset indch if necessary - indch, modif = self._get_indch_geomtdata(indch=indch, - indch_auto=indch_auto, - dgeom=dgeom) + indch, modif = self._get_indch_geomtdata(indch=indch, + indch_auto=indch_auto, + dgeom=dgeom) if modif is True: dgeom, Etendues, Surfaces, names = self._to_Cam_Du(ids, lk, indch, @@ -3414,12 +3414,12 @@ def to_Data(self, ids=None, dsig=None, data=None, X=None, tlim=None, raise Exception(msg) if 'LOS' in geomcls: - lk_geom = ['los_ptsRZPhi','etendue','surface'] + lk_geom = ['los_ptsRZPhi', 'etendue', 'surface'] lkok = set(self._dshort[ids].keys()) lkok = lkok.union(self._dcomp[ids].keys()) lk_geom = list(set(lk_geom).intersection(lkok)) - dgeom, Etendues, Surfaces, names = self._to_Cam_Du(ids, lk_geom, indch, - nan=nan, pos=pos) + dgeom, Etendues, Surfaces, names = self._to_Cam_Du( + ids, lk_geom, indch, nan=nan, pos=pos) # ---------- # Get time @@ -3435,16 +3435,16 @@ def to_Data(self, ids=None, dsig=None, data=None, X=None, tlim=None, # ----------- # Check indch if type(t) is list: - indch, modif = self._get_indch_geomtdata(indch=indch, - indch_auto=indch_auto, - dgeom=dgeom, t=t) + indch, modif = self._get_indch_geomtdata(indch=indch, + indch_auto=indch_auto, + dgeom=dgeom, t=t) assert modif is True else: - indch, modif = self._get_indch_geomtdata(indch=indch, - indch_auto=indch_auto, - dgeom=dgeom) + indch, modif = self._get_indch_geomtdata(indch=indch, + indch_auto=indch_auto, + dgeom=dgeom) if modif is True: - if geomcls != False: + if geomcls is not False: dgeom, Etendues, Surfaces, names = self._to_Cam_Du( ids, lk_geom, indch, nan=nan, pos=pos) t = self.get_data(ids, sig='t', indch=indch)['t'] @@ -3465,13 +3465,13 @@ def to_Data(self, ids=None, dsig=None, data=None, X=None, tlim=None, indt=indt, indch=indch, nan=nan, pos=pos) for kk in set(lk).difference('t'): if not isinstance(out[dsig[kk]], np.ndarray): - indch, modifk = self._get_indch_geomtdata(indch=indch, - indch_auto=indch_auto, - out=out, dsig=dsig, - kk=kk) + indch, modifk = self._get_indch_geomtdata( + indch=indch, indch_auto=indch_auto, + out=out, dsig=dsig, kk=kk) if modifk is True: out = self.get_data(ids, sig=[dsig[k] for k in lk], - indt=indt, indch=indch, nan=nan, pos=pos) + indt=indt, indch=indch, + nan=nan, pos=pos) modif = True # Arrange depending on shape and field @@ -3501,11 +3501,11 @@ def to_Data(self, ids=None, dsig=None, data=None, X=None, tlim=None, # Update dgeom if necessary if modif is True and geomcls is not False: - dgeom, Etendues, Surfaces, names = self._to_Cam_Du(ids, lk_geom, indch, - nan=nan, pos=pos) + dgeom, Etendues, Surfaces, names = self._to_Cam_Du( + ids, lk_geom, indch, + nan=nan, pos=pos) modif = False - # -------------------------- # Format special ids cases if ids == 'reflectometer_profile': @@ -3549,13 +3549,13 @@ def to_Data(self, ids=None, dsig=None, data=None, X=None, tlim=None, # -------------- # Create objects - if geomcls != False and dgeom is not None: + if geomcls is not False and dgeom is not None: import tofu.geom as tfg cam = getattr(tfg, geomcls)(dgeom=dgeom, config=config, Etendues=Etendues, Surfaces=Surfaces, Name=Name, Diag=ids, Exp=Exp, dchans=dchans) - cam.Id.set_dUSR( {'imas-nchMax': nchMax} ) + cam.Id.set_dUSR({'imas-nchMax': nchMax}) import tofu.data as tfd conf = None if cam is not None else config @@ -4082,7 +4082,7 @@ def _save_to_imas(obj, shot=None, run=None, refshot=None, refrun=None, # Class-specific functions #-------------------------------- -def _save_to_imas_Struct( obj, +def _save_to_imas_Struct(obj, shot=None, run=None, refshot=None, refrun=None, occ=None, user=None, tokamak=None, version=None, dryrun=False, tfversion=None, verb=True, @@ -4115,7 +4115,7 @@ def _save_to_imas_Struct( obj, idd.wall.description_2d[description_2d].type.index = ( description_typeindex) idd.wall.description_2d[description_2d].type.name = ( - '%s_%s'%(obj.__class__.__name__, obj.Id.Name)) + '{}_{}'.format(obj.__class__.__name__, obj.Id.Name)) idd.wall.description_2d[description_2d].type.description = ( "tofu-generated wall. Each PFC is represented independently as a" + " closed polygon in tofu, which saves them as disjoint PFCs") @@ -4154,7 +4154,7 @@ def _save_to_imas_Struct( obj, err=err0, dryrun=dryrun, verb=verb) -def _save_to_imas_Config( obj, idd=None, shotfile=None, +def _save_to_imas_Config(obj, idd=None, shotfile=None, shot=None, run=None, refshot=None, refrun=None, occ=None, user=None, tokamak=None, version=None, dryrun=False, tfversion=None, close=True, verb=True, @@ -4186,7 +4186,7 @@ def _save_to_imas_Config( obj, idd=None, shotfile=None, raise Exception(msg) if description_typeindex is None: - if nS == 1 and lcls[0] in ['Ves','PlasmaDomain']: + if nS == 1 and lcls[0] in ['Ves', 'PlasmaDomain']: description_typeindex = 0 else: description_typeindex = 2 @@ -4196,7 +4196,7 @@ def _save_to_imas_Config( obj, idd=None, shotfile=None, ismobile = any([ss._dgeom['mobile'] for ss in lS]) # Isolate StructIn and take out from lS - ves = lS.pop( lcls.index(lclsIn[0]) ) + ves = lS.pop(lcls.index(lclsIn[0])) nS = len(lS) # Fill in data @@ -4205,55 +4205,57 @@ def _save_to_imas_Config( obj, idd=None, shotfile=None, # data # -------- idd.wall.description_2d.resize( description_2d + 1 ) - idd.wall.description_2d[description_2d].type.name = obj.Id.Name - idd.wall.description_2d[description_2d].type.index = ( - description_typeindex) - idd.wall.description_2d[description_2d].type.description = ( + wall = idd.wall.description_2d[description_2d] + wall.type.name = obj.Id.Name + wall.type.index = description_typeindex + wall.type.description = ( "tofu-generated wall. Each PFC is represented independently as a" + " closed polygon in tofu, which saves them as disjoint PFCs") # Fill limiter / mobile if ismobile: - idd.wall.description_2d[description_2d].mobile.unit.resize(nS) - units = idd.wall.description_2d[description_2d].mobile.unit + wall.mobile.unit.resize(nS) + units = wall.mobile.unit for ii in range(0, nS): units[ii].outline.resize(1) units[ii].outline[0].r = lS[ii].Poly[0, :] units[ii].outline[0].z = lS[ii].Poly[1, :] if lS[ii].noccur > 0: - units[ii].phi_extensions = np.array([lS[ii].pos, lS[ii].extent]).T + units[ii].phi_extensions = np.array([lS[ii].pos, + lS[ii].extent]).T units[ii].closed = True - name = '%s_%s'%(lS[ii].__class__.__name__, lS[ii].Id.Name) + name = '{}_{}'.format(lS[ii].__class__.__name__, + lS[ii].Id.Name) if lS[ii]._dgeom['mobile'] is True: name = name + '_mobile' units[ii].name = name - else: - idd.wall.description_2d[description_2d].limiter.unit.resize(nS) - units = idd.wall.description_2d[description_2d].limiter.unit + wall.limiter.unit.resize(nS) + units = wall.limiter.unit for ii in range(0, nS): units[ii].outline.r = lS[ii].Poly[0, :] units[ii].outline.z = lS[ii].Poly[1, :] if lS[ii].noccur > 0: - units[ii].phi_extensions = np.array([lS[ii].pos, lS[ii].extent]).T + units[ii].phi_extensions = np.array([lS[ii].pos, + lS[ii].extent]).T units[ii].closed = True - name = '%s_%s'%(lS[ii].__class__.__name__, lS[ii].Id.Name) + name = '{}_{}'.format(lS[ii].__class__.__name__, + lS[ii].Id.Name) if lS[ii]._dgeom['mobile'] is True: name = name + '_mobile' units[ii].name = name - # Fill vessel - vesname = '%s_%s'%(ves.__class__.__name__, ves.Id.Name) - idd.wall.description_2d[description_2d].vessel.name = vesname - idd.wall.description_2d[description_2d].vessel.index = 1 - idd.wall.description_2d[description_2d].vessel.description = ( + vesname = '{}_{}'.format(ves.__class__.__name__, ves.Id.Name) + wall.vessel.name = vesname + wall.vessel.index = 1 + wall.vessel.description = ( "tofu-generated vessel outline, with a unique unit / element") - idd.wall.description_2d[description_2d].vessel.unit.resize(1) - idd.wall.description_2d[description_2d].vessel.unit[0].element.resize(1) - element = idd.wall.description_2d[description_2d].vessel.unit[0].element[0] + wall.vessel.unit.resize(1) + wall.vessel.unit[0].element.resize(1) + element = wall.vessel.unit[0].element[0] element.name = vesname element.outline.r = ves.Poly[0, :] element.outline.z = ves.Poly[1, :] diff --git a/tofu/version.py b/tofu/version.py index 51df6437f..039d816f7 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.2-a5-78-gbb2a7e1' +__version__ = '1.4.2-a5-79-g5212640' From 762f2fe07ec52c43834ae39d9ae015c6d6dde4ad Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Fri, 10 Jan 2020 15:12:19 +0100 Subject: [PATCH 122/168] [Issue321] PEP8 compliance 8 --- tofu/imas2tofu/_core.py | 2 +- tofu/version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tofu/imas2tofu/_core.py b/tofu/imas2tofu/_core.py index 851103299..b35d8c470 100644 --- a/tofu/imas2tofu/_core.py +++ b/tofu/imas2tofu/_core.py @@ -4196,7 +4196,7 @@ def _save_to_imas_Config(obj, idd=None, shotfile=None, ismobile = any([ss._dgeom['mobile'] for ss in lS]) # Isolate StructIn and take out from lS - ves = lS.pop(lcls.index(lclsIn[0])) + ves = lS.pop(lcls.index(lclsIn[0])) nS = len(lS) # Fill in data diff --git a/tofu/version.py b/tofu/version.py index 039d816f7..8153fd8cb 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.2-a5-79-g5212640' +__version__ = '1.4.2-a5-80-ge74f678' From e246d32d2bf946f584bc9308bbea6a6f84337dd2 Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Fri, 10 Jan 2020 15:58:01 +0100 Subject: [PATCH 123/168] with new key --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index c8478846d..a723b9cfc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -79,7 +79,7 @@ before_deploy: - echo "BEFORE DEPLOY END.........." deploy: - provider: pypi - distributions: "sdist" + distributions: sdist user: __token__ skip_existing: true on: @@ -87,4 +87,4 @@ deploy: branch: deploy-test server: https://test.pypi.org/legacy/ password: - secure: o63EC+U+EtdAgUSV3plrLfZ7QZ6Aflp0quV5jJQxD9w47Ds5i4k5GjEHogV8x8l5NGwxbXPKp/1eKEfYgFH/i+WUnj1n9reiYZBd0lkr2Ih9nExNEIrziMhPbqjDEYAB672bjkXseS6mF44boqDUEP3jyDaamLB+aR75RCMM1j6aha/54Ko88ZJKXBW5FuNSraBGzgvjVG0P63jG5epS85hX09dEcKNR0XO0kbiGfNnYIp78QBohO0Pdv99x2ryp/QaoWD4m7cMUOts2xIcI2KCJNMhZNdIS8C0TVvk2tgumb+G2px7PsOxA8yZgxLefs+A14IAjg6uKe/jmwrihN1V6R6FF3WCcxM6kdzt9bpr+QKBoXjkF8BdxVbgmdnxkr+Ah5WIxmw2boQoW/SIMy9GVPrgtkSvocN6NwOExsO4pagiOwTLIvjIe+/0+OJt/Pud+mwF/94HD+B7j/XxsK7QehLCd9v5NTrdNgpS/TiWOyCDP1DLnpl1V9/vZ56x9NSQhN4Wr6hRrTxjWNAYLxsMxZf6uR+WWg1TqyicVlGrSf0to2asNIPWTTeGq3tB0/7WNslRQzP7QD67p5SuX0Z3Sv0WnQx+rZH77EN6FPCbv8Xn+D4ff06VKHaXXOkiFdK+6pTQ1VmFVPH/ablbWODhhcja/O3Xn3d/zTIyM+oQ= + secure: LJt/pNnEQ2n7tjhujYe9LPEKUqgXOwr20Uylu5uyFBQYTzARGSQ/rpPF2DNN9/xvEBZJYHQ3QVVmkXW//G9xB3DsMySxHJqMnl+Ur/rBF1c9YObZC9YtGLf9oSRzbeEquSYfw2ZJMK5E+iuJybXtSKbWkiVtzl4WVV2SI6YxPJ8+BGmRk+6R1zWZ5DTdlVje2yPqetUdrQ+iU3bABs26yurq+qrbiKHjcQs1d8b34QEejxsbt6zEVdAUvX8j6DmtChTh1+GoQALTHt+pRnLn3rGLcsvaOZnLkGFr48YzPNSPKnqsWHnI8iZX5U+dEqhvqhSMNuiiQTkR6tZEQdcASjtroEb98XyKUCVIOd4KjzjPG1eJYwvry3t0bZH42zsm9dRPPqFiCRq1VIcmjzI208ySSgsJbY3JJXUAuLGBuG0xUyASsKZpTlftk3v3+EGE2Arqpc7fSMVY8cKmAQ4TxjAuVZgfn2KnmOHQAw/f0iDQ9N4+btbW4DUWaXjjHdjcmouRz9j0g/XAg9030+QobrozD0msYEdClzNq2fl5gjjpyaLd/ClkrcUbOozQRpXBq5UIB9ZDJjw4LW1VAN4whF6Fg8DdKzhYLaNK/YY8oJpd9mhlubDCbjlAF5cWqDsAUXHPJ6HmiWu5nCGajbEteX7gzBw8IzI/FlJWdXAL0i8= From 40d1ac1d9f5f975754d7e1145eae453e0983370e Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Fri, 10 Jan 2020 16:43:53 +0100 Subject: [PATCH 124/168] with perso key --- .travis.yml | 2 +- tofu/version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index a723b9cfc..15fc60fea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -87,4 +87,4 @@ deploy: branch: deploy-test server: https://test.pypi.org/legacy/ password: - secure: LJt/pNnEQ2n7tjhujYe9LPEKUqgXOwr20Uylu5uyFBQYTzARGSQ/rpPF2DNN9/xvEBZJYHQ3QVVmkXW//G9xB3DsMySxHJqMnl+Ur/rBF1c9YObZC9YtGLf9oSRzbeEquSYfw2ZJMK5E+iuJybXtSKbWkiVtzl4WVV2SI6YxPJ8+BGmRk+6R1zWZ5DTdlVje2yPqetUdrQ+iU3bABs26yurq+qrbiKHjcQs1d8b34QEejxsbt6zEVdAUvX8j6DmtChTh1+GoQALTHt+pRnLn3rGLcsvaOZnLkGFr48YzPNSPKnqsWHnI8iZX5U+dEqhvqhSMNuiiQTkR6tZEQdcASjtroEb98XyKUCVIOd4KjzjPG1eJYwvry3t0bZH42zsm9dRPPqFiCRq1VIcmjzI208ySSgsJbY3JJXUAuLGBuG0xUyASsKZpTlftk3v3+EGE2Arqpc7fSMVY8cKmAQ4TxjAuVZgfn2KnmOHQAw/f0iDQ9N4+btbW4DUWaXjjHdjcmouRz9j0g/XAg9030+QobrozD0msYEdClzNq2fl5gjjpyaLd/ClkrcUbOozQRpXBq5UIB9ZDJjw4LW1VAN4whF6Fg8DdKzhYLaNK/YY8oJpd9mhlubDCbjlAF5cWqDsAUXHPJ6HmiWu5nCGajbEteX7gzBw8IzI/FlJWdXAL0i8= + secure: xfVFuoz9YYNChzmT8DC9y+8eH6zdFkfoy3B51uqy8b+vhJNzCzLay4F0uSHvhHy6iYorM6UQKr6soC4D7n3PhmnFOTX/cgLtd/p4gBWGYZF6yXacvw+UHKMshgbAhn2sEynxdSAqdAlNttMI8jsUu9RhbzGiv1l5zSNnFWF4Zsly02G68UnztxIGoz8AYTRW2N2oQhGrl/ryj/YG4mSRKjled6BzK7kNoJUqLGl12DqdMMTEmdJ9NHBXgK3Dv0ya17ReFz3TcxE/4+Yc38NwSR4Ia2EvVSMtyIaccQ1uSrXwW8JQOMn+9CmDWZVUMDD2bzKYbm2WGGM9Fh8WrHnwlWRujoLDofhYEK0Cus11gULFF+J88XucOJlyJNrHP6TWxdSVVoQfwWr2ABqZIvilsvHpF+sjDLqomTNHdi+BbzP2koRv0nJb9K1W24bjPLtSK8+plX7suv7gdBNwlsJ+dPLDM87v4+jGHGthQ6P4X2guTMHZm1PU0PSPB9LCbENCN1uktLLhkgx7gZ42Ag+Jwiu02ENkChLaEB4WpPb9mjLnomu5LDYXFGtPJ/uLMOi3VCXyda0LrzqDhXYT3Cg4hvXySwJcgMYSXalfTxnTm9oouePiEXDbK+XwjMP9mjC5CeMg3SaFFTywqaTH0WUqiOBUJ6H3Gsm0sB15Tj4lNKQ= \ No newline at end of file diff --git a/tofu/version.py b/tofu/version.py index 73a3a297c..3b76e09d5 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.2b11' +__version__ = '1.4.2b12' From 41587772da32cce3be987369df4e7ccb342f76e8 Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Fri, 10 Jan 2020 16:45:12 +0100 Subject: [PATCH 125/168] new version --- tofu/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tofu/version.py b/tofu/version.py index 3b76e09d5..9f60b917a 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.2b12' +__version__ = '1.4.2b13' From 6503b991cbb4744bc64e645b3acd69d283a7ed2b Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Mon, 13 Jan 2020 11:56:06 +0100 Subject: [PATCH 126/168] [Issue301] Implemented tf.geom.utils.get_available_config(), with more explicit msg --- tofu/geom/utils.py | 49 +++++++++++++++++++++++++++++++++++++++------- tofu/version.py | 2 +- 2 files changed, 43 insertions(+), 8 deletions(-) diff --git a/tofu/geom/utils.py b/tofu/geom/utils.py index 8bc170ea5..90ce593f8 100644 --- a/tofu/geom/utils.py +++ b/tofu/geom/utils.py @@ -643,6 +643,11 @@ def _compute_CamLOS2D_pinhole(P=None, F=0.1, D12=0.1, N12=100, _ExpJET = 'JET' _ExpITER = 'ITER' _ExpNSTX = 'NSTX' +# Default config +_DEFCONFIG = 'ITER' + +_URL_TUTO = ('https://tofuproject.github.io/tofu/auto_examples/tutorials/' + + 'tuto_plot_create_geometry.html') # Dictionnary of unique config names _DCONFIG = {'WEST-V1': {'Exp': _ExpWest, @@ -695,8 +700,40 @@ def _compute_CamLOS2D_pinhole(P=None, F=0.1, D12=0.1, N12=100, 'B4': 'ITER-V2', 'NSTX': 'NSTX-V0'} -# Default config -_DEFCONFIG = 'ITER' + +def _get_listconfig(dconfig=_DCONFIG, dconfig_table=_DCONFIG_TABLE, + returnas=str): + assert returnas in [dict, str] + dc = {k0: [k0] + sorted([k1 for k1, v1 in dconfig_table.items() + if v1 == k0]) + for k0 in sorted(dconfig.keys())} + if returnas is dict: + return dc + else: + l0 = np.max([len(k0) for k0 in dc.keys()] + [len('unique names')]) + l1 = np.max([len(str(v0)) for v0 in dc.values()] + [len('shortcuts')]) + msg = ("\n\t" + "unique names".ljust(l0) + "\tshortcuts" + +"\n\t" + "-"*l0 + " \t" + "-"*l1 + + "\n\t- " + + "\n\t- ".join(["{}\t{}".format(k0.ljust(l0), v0) + for k0, v0 in dc.items()])) + return msg + + +def get_available_config(dconfig=_DCONFIG, dconfig_table=_DCONFIG_TABLE, + verb=True, returnas=False): + msg = ("A config is the geometry of a tokamak\n" + + "You can define your own" + + " (see online tutorial at {})\n".format(_URL_TUTO) + + "tofu also also provides some pre-defined config ready to load\n" + + "They are available via their name or via shortcuts\n" + + _get_listconfig(dconfig=dconfig, dconfig_table=dconfig_table) + + "\n\n => to get a pre-defined config, call for example:\n" + + "\tconfig = tf.geom.utils.create_config('ITER')") + if verb is True: + print(msg) + if returnas is str: + return msg def _create_config_testcase(config=None, returnas='object', @@ -724,11 +761,9 @@ def _create_config_testcase(config=None, returnas='object', config = dconfig_table[config] else: - msg = ("The provided config name is not valid:\n" - + "Please choose among either:\n" - + "\t - unique keys: {}\n".format(list(dconfig.keys())) - + "\t - shortcuts : {}\n\n".format(list(dconfig_table.keys())) - + " => you provided: case = {}\n".format(config)) + msg = ("\nThe provided config name is not valid.\n" + + get_available_config(verb=False, returnas=str) + + "\n\n => you provided: {}\n".format(config)) raise Exception(msg) # Get file names for config diff --git a/tofu/version.py b/tofu/version.py index 4fc937bc2..8d70bce59 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.2-a5-48-gac0016b' +__version__ = '1.4.2-a5-63-ge6c9f42b' From f2f9cb486d10570821acb967585e228f02b59738 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Mon, 13 Jan 2020 12:15:06 +0100 Subject: [PATCH 127/168] [Issue301] PEP8 compliance 1 --- tofu/geom/utils.py | 4 ++-- tofu/version.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tofu/geom/utils.py b/tofu/geom/utils.py index 90ce593f8..e33a15733 100644 --- a/tofu/geom/utils.py +++ b/tofu/geom/utils.py @@ -713,7 +713,7 @@ def _get_listconfig(dconfig=_DCONFIG, dconfig_table=_DCONFIG_TABLE, l0 = np.max([len(k0) for k0 in dc.keys()] + [len('unique names')]) l1 = np.max([len(str(v0)) for v0 in dc.values()] + [len('shortcuts')]) msg = ("\n\t" + "unique names".ljust(l0) + "\tshortcuts" - +"\n\t" + "-"*l0 + " \t" + "-"*l1 + + "\n\t" + "-"*l0 + " \t" + "-"*l1 + "\n\t- " + "\n\t- ".join(["{}\t{}".format(k0.ljust(l0), v0) for k0, v0 in dc.items()])) @@ -721,7 +721,7 @@ def _get_listconfig(dconfig=_DCONFIG, dconfig_table=_DCONFIG_TABLE, def get_available_config(dconfig=_DCONFIG, dconfig_table=_DCONFIG_TABLE, - verb=True, returnas=False): + verb=True, returnas=False): msg = ("A config is the geometry of a tokamak\n" + "You can define your own" + " (see online tutorial at {})\n".format(_URL_TUTO) diff --git a/tofu/version.py b/tofu/version.py index 8d70bce59..8c2ca6d8b 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.2-a5-63-ge6c9f42b' +__version__ = '1.4.2-a5-64-g6503b991' From c26ae5973da9392b5fde448b855149f3fa3781fd Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Mon, 13 Jan 2020 17:10:25 +0100 Subject: [PATCH 128/168] [Issue321] Added safeguard to use fill_value when interpolated data is nan already from source in Plasma2D.interp_pts2profile() Set sig = -2*sig for polarimeter due to vect direction (laser direction) Set vect = -u in newcalc=False Double checked all METIS synthetic diagnostics: polarimeter and interferometer ok bremsstrhalung_visible and bolometer waiting for sequenceur replay for units, geometry and etendues Synthetic diag now need to be double-checked for NICE / EQUINOX --- tofu/data/_comp.py | 9 +++++++++ tofu/data/_core.py | 8 ++++---- tofu/geom/_core.py | 10 +++++++--- tofu/imas2tofu/_core.py | 8 ++++++-- tofu/version.py | 2 +- 5 files changed, 27 insertions(+), 10 deletions(-) diff --git a/tofu/data/_comp.py b/tofu/data/_comp.py index bff7f4516..f98872655 100644 --- a/tofu/data/_comp.py +++ b/tofu/data/_comp.py @@ -432,6 +432,8 @@ def func(pts, vect=None, t=None, ntall=ntall, vquant[indtq[indtu[ii]], :], trifinder=trifind )(r, z).filled(fill_value) + if np.any(np.isnan(val)) and not np.isnan(fill_value): + val[np.isnan(val)] = fill_value return val, t # -------------------- @@ -463,6 +465,8 @@ def func(pts, vect=None, t=None, ntall=ntall, ind = indt == indtu[ii] val[ind, indok] = vquant[indtq[indtu[ii]], indpts[indok]] + if np.any(np.isnan(val)) and not np.isnan(fill_value): + val[np.isnan(val)] = fill_value return val, t @@ -568,6 +572,10 @@ def func(pts, vect=None, t=None, ntall=ntall, bounds_error=False, fill_value=fill_value )(vr2[indtr2[ii], indpts[indok]]) + + # Double check nan in case vr2 is itself nan on parts of mesh + if np.any(np.isnan(val)) and not np.isnan(fill_value): + val[np.isnan(val)] = fill_value return val, t return func @@ -698,6 +706,7 @@ def func(pts, vect=None, t=None, ntall=ntall, else: ntall, indt, indtu = plasma._get_indtu(t=t, tall=tall, tbinall=tbinall)[1:-2] + for ii in range(0, ntall): ind = indt == indtu[ii] valR[ind, ...] = vq2dR[indtq[indtu[ii]], indpts] diff --git a/tofu/data/_core.py b/tofu/data/_core.py index e55e57a78..a4f45c47e 100644 --- a/tofu/data/_core.py +++ b/tofu/data/_core.py @@ -3742,7 +3742,7 @@ def _get_finterp(self, idquant=None, idref1d=None, idref2d=None, idq2dR=None, idq2dPhi=None, idq2dZ=None, interp_t=None, interp_space=None, - fill_value=np.nan, ani=False, Type=None): + fill_value=None, ani=False, Type=None): if interp_t is None: interp_t = 'nearest' @@ -3860,7 +3860,7 @@ def _checkformat_qr12RPZ(self, quant=None, ref1d=None, ref2d=None, def get_finterp2d(self, quant=None, ref1d=None, ref2d=None, q2dR=None, q2dPhi=None, q2dZ=None, interp_t=None, interp_space=None, - fill_value=np.nan, Type=None): + fill_value=None, Type=None): """ Return the function interpolating (X,Y,Z) pts on a 1d/2d profile Can be used as input for tf.geom.CamLOS1D/2D.calc_signal() @@ -3887,7 +3887,7 @@ def interp_pts2profile(self, pts=None, vect=None, t=None, quant=None, ref1d=None, ref2d=None, q2dR=None, q2dPhi=None, q2dZ=None, interp_t=None, interp_space=None, - fill_value=np.nan, Type=None): + fill_value=None, Type=None): """ Return the value of the desired profiles_1d quantity For the desired inputs points (pts): @@ -3967,7 +3967,7 @@ def calc_signal_from_Cam(self, cam, t=None, quant=None, ref1d=None, ref2d=None, q2dR=None, q2dPhi=None, q2dZ=None, Brightness=True, interp_t=None, - interp_space=None, fill_value=np.nan, + interp_space=None, fill_value=None, res=0.005, DL=None, resMode='abs', method='sum', ind=None, out=object, plot=True, dataname=None, fs=None, dmargin=None, wintit=None, invert=True, diff --git a/tofu/geom/_core.py b/tofu/geom/_core.py index a13c69a4e..736a05477 100644 --- a/tofu/geom/_core.py +++ b/tofu/geom/_core.py @@ -6210,7 +6210,7 @@ def calc_signal_from_Plasma2D( self, plasma2d, t=None, - newcalc=False, + newcalc=True, quant=None, ref1d=None, ref2d=None, @@ -6255,7 +6255,9 @@ def calc_signal_from_Plasma2D( if newcalc: # Get time vector - if t is None: + lc = [t is None, type(t) is str, type(t) is np.ndarray] + assert any(lc) + if lc[0]: out = plasma2d._checkformat_qr12RPZ( quant=quant, ref1d=ref1d, @@ -6265,6 +6267,8 @@ def calc_signal_from_Plasma2D( q2dZ=q2dZ, ) t = plasma2d._get_tcom(*out[:4])[0] + elif lc[1]: + t = plasma2d._ddata[t]['data'] else: t = np.atleast_1d(t).ravel() @@ -6362,7 +6366,7 @@ def funcbis(*args, **kwdargs): nbrep = np.r_[ indpts[0], np.diff(indpts), pts.shape[1] - indpts[-1] ] - vect = np.repeat(self.u, nbrep, axis=1) + vect = -np.repeat(self.u, nbrep, axis=1) if fill_value is None: fill_value = 0. diff --git a/tofu/imas2tofu/_core.py b/tofu/imas2tofu/_core.py index b35d8c470..709a2a8cb 100644 --- a/tofu/imas2tofu/_core.py +++ b/tofu/imas2tofu/_core.py @@ -3639,7 +3639,7 @@ def _get_synth(self, ids, dsig=None, def calc_signal(self, ids=None, dsig=None, tlim=None, t=None, res=None, quant=None, ref1d=None, ref2d=None, q2dR=None, q2dPhi=None, q2dZ=None, - Brightness=None, interp_t=None, + Brightness=None, interp_t=None, newcalc=True, indch=None, indch_auto=False, Name=None, occ_cam=None, occ_plasma=None, config=None, dextra=None, t0=None, datacls=None, geomcls=None, @@ -3753,8 +3753,10 @@ def calc_signal(self, ids=None, dsig=None, tlim=None, t=None, res=None, # Calculate synthetic signal if Brightness is None: Brightness = self._didsdiag[ids]['synth'].get('Brightness', None) + dq['fill_value'] = 0. sig, units = cam.calc_signal_from_Plasma2D(plasma, res=res, t=t, Brightness=Brightness, + newcalc=newcalc, plot=False, **dq) sig._dextra = plasma.get_dextra(dextra) @@ -3762,7 +3764,9 @@ def calc_signal(self, ids=None, dsig=None, tlim=None, t=None, res=None, if ids == 'interferometer': sig = 2.*sig elif ids == 'polarimeter': - sig = 2.*sig + # For polarimeter, the vect is along the LOS + # it is not the direction of + sig = -2.*sig # Safety check regarding Brightness _, _, dsig_exp = self._checkformat_Data_dsig(ids) diff --git a/tofu/version.py b/tofu/version.py index 8153fd8cb..93a97ff06 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.2-a5-80-ge74f678' +__version__ = '1.4.2-a5-87-g0af50f6b' From 666ceff688586802ab885a2904c2af1544e8295f Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Mon, 13 Jan 2020 18:16:55 +0100 Subject: [PATCH 129/168] [Issue321] Debugged time index bug in data._comp.py interpolation functions. To be double-tested for all cases, METIS and NICE --- tofu/data/_comp.py | 4 ++-- tofu/version.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tofu/data/_comp.py b/tofu/data/_comp.py index f98872655..9af8e8117 100644 --- a/tofu/data/_comp.py +++ b/tofu/data/_comp.py @@ -522,7 +522,7 @@ def func(pts, vect=None, t=None, ntall=ntall, # interpolate 1d ind = indt == indtu[ii] val[ind, ...] = scpinterp.interp1d( - vr1[indtr1[indtu[ii]], :], + vr1[indtr1[ii], :], vquant[indtq[indtu[ii]], :], kind='linear', bounds_error=False, @@ -566,7 +566,7 @@ def func(pts, vect=None, t=None, ntall=ntall, # interpolate 1d ind = indt == indtu[ii] val[ind, indok] = scpinterp.interp1d( - vr1[indtr1[indtu[ii]], :], + vr1[indtr1[ii], :], vquant[indtq[indtu[ii]], :], kind='linear', bounds_error=False, diff --git a/tofu/version.py b/tofu/version.py index 93a97ff06..dae66b3fa 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.2-a5-87-g0af50f6b' +__version__ = '1.4.2-a5-87-gc26ae597' From f22285a9ace7d11d8f236292109f839bfea5f3bc Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Tue, 14 Jan 2020 10:01:01 +0100 Subject: [PATCH 130/168] [Issue321] Modified Config.save_to_imas() to put vessel in limiter/mobile.units[-1] --- tofu/imas2tofu/_core.py | 48 +++++++++++++++++++++++++---------------- tofu/version.py | 2 +- 2 files changed, 31 insertions(+), 19 deletions(-) diff --git a/tofu/imas2tofu/_core.py b/tofu/imas2tofu/_core.py index 709a2a8cb..85606fb27 100644 --- a/tofu/imas2tofu/_core.py +++ b/tofu/imas2tofu/_core.py @@ -4193,8 +4193,8 @@ def _save_to_imas_Config(obj, idd=None, shotfile=None, if nS == 1 and lcls[0] in ['Ves', 'PlasmaDomain']: description_typeindex = 0 else: - description_typeindex = 2 - assert description_typeindex in [0, 2] + description_typeindex = 1 + assert description_typeindex in [0, 1] # Check whether there is any mobile element ismobile = any([ss._dgeom['mobile'] for ss in lS]) @@ -4218,7 +4218,8 @@ def _save_to_imas_Config(obj, idd=None, shotfile=None, # Fill limiter / mobile if ismobile: - wall.mobile.unit.resize(nS) + # resize nS + 1 for vessel + wall.mobile.unit.resize(nS + 1) units = wall.mobile.unit for ii in range(0, nS): units[ii].outline.resize(1) @@ -4250,25 +4251,36 @@ def _save_to_imas_Config(obj, idd=None, shotfile=None, name = name + '_mobile' units[ii].name = name - # Fill vessel - vesname = '{}_{}'.format(ves.__class__.__name__, ves.Id.Name) - wall.vessel.name = vesname - wall.vessel.index = 1 - wall.vessel.description = ( - "tofu-generated vessel outline, with a unique unit / element") - - wall.vessel.unit.resize(1) - wall.vessel.unit[0].element.resize(1) - element = wall.vessel.unit[0].element[0] - element.name = vesname - element.outline.r = ves.Poly[0, :] - element.outline.z = ves.Poly[1, :] + # Add Vessel at the end + ii = nS + units[ii].outline.resize(1) + units[ii].outline[0].r = ves.Poly[0, :] + units[ii].outline[0].z = ves.Poly[1, :] + units[ii].closed = True + units[ii].name = '{}_{}'.format(ves.__class__.__name__, + ves.Id.Name) + + # ---------------------------------- + # Fill vessel if needed + # vesname = '{}_{}'.format(ves.__class__.__name__, ves.Id.Name) + # wall.vessel.name = vesname + # wall.vessel.index = 1 + # wall.vessel.description = ( + # "tofu-generated vessel outline, with a unique unit / element") + + # wall.vessel.unit.resize(1) + # wall.vessel.unit[0].element.resize(1) + # element = wall.vessel.unit[0].element[0] + # element.name = vesname + # element.outline.r = ves.Poly[0, :] + # element.outline.z = ves.Poly[1, :] + # ---------------------------------- # IDS properties # -------------- com = "PFC contour generated:\n" - com += " - from %s"%obj.Id.SaveName - com += " - by tofu %s"%tfversion + com += " - from {}".format(obj.Id.SaveName) + com += " - by tofu {}".format(tfversion) _fill_idsproperties(idd.wall, com, tfversion) err0 = None diff --git a/tofu/version.py b/tofu/version.py index dae66b3fa..a7079f6bc 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.2-a5-87-gc26ae597' +__version__ = '1.4.2-a5-88-g666ceff6' From b57122734a23dd8c1fe54379625e8ac6a1544b30 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Tue, 14 Jan 2020 10:31:15 +0100 Subject: [PATCH 131/168] [Issue321] Modified Multi.to_Config() to handle ves as last unit of limiter --- tofu/imas2tofu/_core.py | 281 +++++++++++++++++++++------------------- tofu/version.py | 2 +- 2 files changed, 148 insertions(+), 135 deletions(-) diff --git a/tofu/imas2tofu/_core.py b/tofu/imas2tofu/_core.py index 85606fb27..acfcd8603 100644 --- a/tofu/imas2tofu/_core.py +++ b/tofu/imas2tofu/_core.py @@ -2260,143 +2260,151 @@ def to_Config(self, Name=None, occ=None, lids, lidd, shot, Exp = self._get_lidsidd_shotExp(lidsok, errshot=True, errExp=True, upper=True) - # ------------- - # Input dicts + # ---------------- + # Trivial case + if 'wall' not in lids: + if plot: + msg = "ids 'wall' has not been loaded => Config not available!" + raise Exception(msg) + return None - # config - config = None - if 'wall' in lids: - ids = 'wall' + # ---------------- + # Relevant case - # occ = np.ndarray of valid int - occ = self._checkformat_getdata_occ(occ, ids) - assert occ.size == 1, "Please choose one occ only !" - occ = occ[0] - indoc = np.nonzero(self._dids[ids]['occ'] == occ)[0][0] + # Get relevant occ and description_2d + ids = 'wall' + # occ = np.ndarray of valid int + occ = self._checkformat_getdata_occ(occ, ids) + assert occ.size == 1, "Please choose one occ only !" + occ = occ[0] + indoc = np.nonzero(self._dids[ids]['occ'] == occ)[0][0] - wall = self._dids[ids]['ids'][indoc].description_2d[description_2d] - kwargs = dict(Exp=Exp, Type='Tor') + wall = self._dids[ids]['ids'][indoc].description_2d[description_2d] + kwargs = dict(Exp=Exp, Type='Tor') - import tofu.geom as mod + import tofu.geom as mod - # Get vessel - nlim = len(wall.limiter.unit) - nmob = len(wall.mobile.unit) - onelimonly = False - try: - if len(wall.vessel.unit) != 1: - msg = "There is no / several vessel.unit!" - raise Exception(msg) - if len(wall.vessel.unit[0].element) != 1: - msg = "There is no / several vessel.unit[0].element!" - raise Exception(msg) - if len(wall.vessel.unit[0].element[0].outline.r) < 3: - msg = "wall.vessel polygon has less than 3 points!" - raise Exception(msg) - name = wall.vessel.unit[0].element[0].name - poly = np.array([wall.vessel.unit[0].element[0].outline.r, - wall.vessel.unit[0].element[0].outline.z]) - except Exception as err: - # If vessel not in vessel, sometimes stored a a single limiter - if nlim == 1: - name = wall.limiter.unit[0].name - poly = np.array([wall.limiter.unit[0].outline.r, - wall.limiter.unit[0].outline.z]) - onelimonly = True - else: - msg = ("There does not seem to be any vessel, " - + "not in wall.vessel nor in wall.limiter!") - raise Exception(msg) - cls = None - if name == '': - name = 'ImasVessel' - if '_' in name: - ln = name.split('_') - if len(ln) == 2: - cls, name = ln - else: - name = name.replace('_', '') - if cls is None: - cls = 'Ves' - assert cls in ['Ves', 'PlasmaDomain'] - ves = getattr(mod, cls)(Poly=poly, Name=name, **kwargs) - - # Determine if mobile or not - lS = [] - if onelimonly is False: - if mobile is None: - if nlim == 0 and nmob > 0: - mobile = True - elif nmob == 0 and nlim > 0: - mobile = False - else: - msg = ("Can't decide automatically whether to choose" - + " limiter or mobile!") - raise Exception(msg) - assert isinstance(mobile, bool) + # Get vessel + nlim = len(wall.limiter.unit) + nmob = len(wall.mobile.unit) + # onelimonly = False + + # ---------------------------------- + # Relevant only if vessel is filled + # try: + # if len(wall.vessel.unit) != 1: + # msg = "There is no / several vessel.unit!" + # raise Exception(msg) + # if len(wall.vessel.unit[0].element) != 1: + # msg = "There is no / several vessel.unit[0].element!" + # raise Exception(msg) + # if len(wall.vessel.unit[0].element[0].outline.r) < 3: + # msg = "wall.vessel polygon has less than 3 points!" + # raise Exception(msg) + # name = wall.vessel.unit[0].element[0].name + # poly = np.array([wall.vessel.unit[0].element[0].outline.r, + # wall.vessel.unit[0].element[0].outline.z]) + # except Exception as err: + # # If vessel not in vessel, sometimes stored a a single limiter + # if nlim == 1: + # name = wall.limiter.unit[0].name + # poly = np.array([wall.limiter.unit[0].outline.r, + # wall.limiter.unit[0].outline.z]) + # onelimonly = True + # else: + # msg = ("There does not seem to be any vessel, " + # + "not in wall.vessel nor in wall.limiter!") + # raise Exception(msg) + # cls = None + # if name == '': + # name = 'ImasVessel' + # if '_' in name: + # ln = name.split('_') + # if len(ln) == 2: + # cls, name = ln + # else: + # name = name.replace('_', '') + # if cls is None: + # cls = 'Ves' + # assert cls in ['Ves', 'PlasmaDomain'] + # ves = getattr(mod, cls)(Poly=poly, Name=name, **kwargs) + + # Determine if mobile or not + lS = [] + # if onelimonly is False: + if mobile is None: + if nlim == 0 and nmob > 0: + mobile = True + elif nmob == 0 and nlim > 0: + mobile = False + else: + msg = ("Can't decide automatically whether to choose" + + " limiter or mobile!") + raise Exception(msg) + assert isinstance(mobile, bool) - # Get PFC + # Get PFC + if mobile is True: + units = wall.mobile.unit + else: + units = wall.limiter.unit + nunits = len(units) + + if nunits == 0: + msg = ("There is no unit stored !\n" + + "The required 2d description is empty:\n") + ms = "len(idd.{}[occ={}].description_2d".format(ids, occ) + msg += "{}[{}].limiter.unit) = 0".format(ms, + description_2d) + raise Exception(msg) + + lS = [None for _ in units] + for ii in range(0, nunits): + try: if mobile is True: - units = wall.mobile.unit + outline = units[ii].outline[0] else: - units = wall.limiter.unit - nunits = len(units) - - if nunits == 0: - msg = ("There is no unit stored !\n" - + "The required 2d description is empty:\n") - ms = "len(idd.{}[occ={}].description_2d".format(ids, occ) - msg += "{}[{}].limiter.unit) = 0".format(ms, - description_2d) - raise Exception(msg) + outline = units[ii].outline + poly = np.array([outline.r, outline.z]) - lS = [None for _ in units] - for ii in range(0, nunits): - try: - if mobile is True: - outline = units[ii].outline[0] - else: - outline = units[ii].outline - poly = np.array([outline.r, outline.z]) - - if units[ii].phi_extensions.size > 0: - pos, extent = units[ii].phi_extensions.T - else: - pos, extent = None, None - name = units[ii].name - cls, mobi = None, None - if name == '': - name = 'unit{:02.0f}'.format(ii) - if '_' in name: - ln = name.split('_') - if len(ln) == 2: - cls, name = ln - elif len(ln) == 3: - cls, name, mobi = ln - else: - name = name.replace('_', '') - if cls is None: - if ii == nunits-1: - cls = 'Ves' - else: - cls = 'PFC' - mobi = mobi == 'mobile' - lS[ii] = getattr(mod, cls)(Poly=poly, pos=pos, - extent=extent, - Name=name, mobile=mobi, - **kwargs) - except Exception as err: - msg = ("PFC unit[{}] named {} ".format(ii, name) - + "could not be loaded!\n" - + str(err)) - raise Exception(msg) + if units[ii].phi_extensions.size > 0: + pos, extent = units[ii].phi_extensions.T + else: + pos, extent = None, None + name = units[ii].name + cls, mobi = None, None + if name == '': + name = 'unit{:02.0f}'.format(ii) + if '_' in name: + ln = name.split('_') + if len(ln) == 2: + cls, name = ln + elif len(ln) == 3: + cls, name, mobi = ln + else: + name = name.replace('_', '') + if cls is None: + if ii == nunits - 1: + cls = 'Ves' + else: + cls = 'PFC' + mobi = mobi == 'mobile' + lS[ii] = getattr(mod, cls)(Poly=poly, pos=pos, + extent=extent, + Name=name, mobile=mobi, + **kwargs) + except Exception as err: + msg = ("PFC unit[{}] named {} ".format(ii, name) + + "could not be loaded!\n" + + str(err)) + raise Exception(msg) - if Name is None: - Name = wall.type.name - if Name == '': - Name = 'imas wall' + if Name is None: + Name = wall.type.name + if Name == '': + Name = 'imas wall' - config = mod.Config(lStruct=[ves] + lS, Name=Name, **kwargs) + config = mod.Config(lStruct=lS, Name=Name, **kwargs) # Output if plot: @@ -4031,10 +4039,10 @@ def _save_to_imas(obj, shot=None, run=None, refshot=None, refrun=None, occ=None, user=None, tokamak=None, version=None, dryrun=False, tfversion=None, verb=True, **kwdargs): - dfunc = {'Struct':_save_to_imas_Struct, - 'Config':_save_to_imas_Config, - 'CamLOS1D':_save_to_imas_CamLOS1D, - 'DataCam1D':_save_to_imas_DataCam1D} + dfunc = {'Struct': _save_to_imas_Struct, + 'Config': _save_to_imas_Config, + 'CamLOS1D': _save_to_imas_CamLOS1D, + 'DataCam1D': _save_to_imas_DataCam1D} # Preliminary check on object class @@ -4236,7 +4244,8 @@ def _save_to_imas_Config(obj, idd=None, shotfile=None, units[ii].name = name else: - wall.limiter.unit.resize(nS) + # resize nS + 1 for vessel + wall.limiter.unit.resize(nS + 1) units = wall.limiter.unit for ii in range(0, nS): units[ii].outline.r = lS[ii].Poly[0, :] @@ -4253,9 +4262,13 @@ def _save_to_imas_Config(obj, idd=None, shotfile=None, # Add Vessel at the end ii = nS - units[ii].outline.resize(1) - units[ii].outline[0].r = ves.Poly[0, :] - units[ii].outline[0].z = ves.Poly[1, :] + if ismobile: + units[ii].outline.resize(1) + units[ii].outline[0].r = ves.Poly[0, :] + units[ii].outline[0].z = ves.Poly[1, :] + else: + units[ii].outline.r = ves.Poly[0, :] + units[ii].outline.z = ves.Poly[1, :] units[ii].closed = True units[ii].name = '{}_{}'.format(ves.__class__.__name__, ves.Id.Name) diff --git a/tofu/version.py b/tofu/version.py index a7079f6bc..46dd4e9f7 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.2-a5-88-g666ceff6' +__version__ = '1.4.2-a5-89-gf22285a9' From 5e9b601ac6659fb76d899e12125c7f757d3dbb1c Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Tue, 14 Jan 2020 10:59:17 +0100 Subject: [PATCH 132/168] [Issue321] More explicit error message when nlim and nmob are both non-zero and different in Multi.to_Config(), and limiter chosen by default (with warning) when they are equal --- tofu/imas2tofu/_core.py | 13 ++++++++++++- tofu/version.py | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/tofu/imas2tofu/_core.py b/tofu/imas2tofu/_core.py index acfcd8603..6e97c56ac 100644 --- a/tofu/imas2tofu/_core.py +++ b/tofu/imas2tofu/_core.py @@ -2337,9 +2337,20 @@ def to_Config(self, Name=None, occ=None, mobile = True elif nmob == 0 and nlim > 0: mobile = False + elif nmob == nlim: + msgw = 'wall.description_2[{}]'.format(description_2d) + msg = ("\nids wall has same number of limiter / mobile units\n" + + "\t- len({}.limiter.unit) = {}\n".format(msgw, nlim) + + "\t- len({}.mobile.unit) = {}\n".format(msgw, nmob) + + " => Choosing limiter by default") + warnings.warn(msg) + mobile = False else: + msgw = 'wall.description_2[{}]'.format(description_2d) msg = ("Can't decide automatically whether to choose" - + " limiter or mobile!") + + " limiter or mobile!\n" + + "\t- len({}.limiter.unit) = {}\n".format(msgw, nlim) + + "\t- len({}.mobile.unit) = {}".format(msgw, nmob)) raise Exception(msg) assert isinstance(mobile, bool) diff --git a/tofu/version.py b/tofu/version.py index 46dd4e9f7..5cf0854c8 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.2-a5-89-gf22285a9' +__version__ = '1.4.2-a5-90-gb5712273' From 74ab6810b0eb34e0f96ee3132498e1af24c3ad84 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Tue, 14 Jan 2020 11:04:35 +0100 Subject: [PATCH 133/168] [Issue321] PEP8 compliance 9 --- tofu/imas2tofu/_core.py | 60 ++++++++++++++++++++--------------------- tofu/version.py | 2 +- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/tofu/imas2tofu/_core.py b/tofu/imas2tofu/_core.py index 6e97c56ac..6e941f810 100644 --- a/tofu/imas2tofu/_core.py +++ b/tofu/imas2tofu/_core.py @@ -2292,40 +2292,40 @@ def to_Config(self, Name=None, occ=None, # ---------------------------------- # Relevant only if vessel is filled # try: - # if len(wall.vessel.unit) != 1: - # msg = "There is no / several vessel.unit!" - # raise Exception(msg) - # if len(wall.vessel.unit[0].element) != 1: - # msg = "There is no / several vessel.unit[0].element!" - # raise Exception(msg) - # if len(wall.vessel.unit[0].element[0].outline.r) < 3: - # msg = "wall.vessel polygon has less than 3 points!" - # raise Exception(msg) - # name = wall.vessel.unit[0].element[0].name - # poly = np.array([wall.vessel.unit[0].element[0].outline.r, - # wall.vessel.unit[0].element[0].outline.z]) + # if len(wall.vessel.unit) != 1: + # msg = "There is no / several vessel.unit!" + # raise Exception(msg) + # if len(wall.vessel.unit[0].element) != 1: + # msg = "There is no / several vessel.unit[0].element!" + # raise Exception(msg) + # if len(wall.vessel.unit[0].element[0].outline.r) < 3: + # msg = "wall.vessel polygon has less than 3 points!" + # raise Exception(msg) + # name = wall.vessel.unit[0].element[0].name + # poly = np.array([wall.vessel.unit[0].element[0].outline.r, + # wall.vessel.unit[0].element[0].outline.z]) # except Exception as err: - # # If vessel not in vessel, sometimes stored a a single limiter - # if nlim == 1: - # name = wall.limiter.unit[0].name - # poly = np.array([wall.limiter.unit[0].outline.r, - # wall.limiter.unit[0].outline.z]) - # onelimonly = True - # else: - # msg = ("There does not seem to be any vessel, " - # + "not in wall.vessel nor in wall.limiter!") - # raise Exception(msg) + # # If vessel not in vessel, sometimes stored a a single limiter + # if nlim == 1: + # name = wall.limiter.unit[0].name + # poly = np.array([wall.limiter.unit[0].outline.r, + # wall.limiter.unit[0].outline.z]) + # onelimonly = True + # else: + # msg = ("There does not seem to be any vessel, " + # + "not in wall.vessel nor in wall.limiter!") + # raise Exception(msg) # cls = None # if name == '': - # name = 'ImasVessel' + # name = 'ImasVessel' # if '_' in name: - # ln = name.split('_') - # if len(ln) == 2: - # cls, name = ln - # else: - # name = name.replace('_', '') + # ln = name.split('_') + # if len(ln) == 2: + # cls, name = ln + # else: + # name = name.replace('_', '') # if cls is None: - # cls = 'Ves' + # cls = 'Ves' # assert cls in ['Ves', 'PlasmaDomain'] # ves = getattr(mod, cls)(Poly=poly, Name=name, **kwargs) @@ -4290,7 +4290,7 @@ def _save_to_imas_Config(obj, idd=None, shotfile=None, # wall.vessel.name = vesname # wall.vessel.index = 1 # wall.vessel.description = ( - # "tofu-generated vessel outline, with a unique unit / element") + # "tofu-generated vessel outline, with a unique unit / element") # wall.vessel.unit.resize(1) # wall.vessel.unit[0].element.resize(1) diff --git a/tofu/version.py b/tofu/version.py index 5cf0854c8..7b58261e4 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.2-a5-90-gb5712273' +__version__ = '1.4.2-a5-91-g5e9b601a' From 995809ff6a7d05d94302665b4b8d4d433aa1abfa Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Tue, 14 Jan 2020 18:06:38 +0100 Subject: [PATCH 134/168] [Issue301] Error message now used also when user provides no input to tf.geom.utils.create_Config() --- tofu/geom/utils.py | 9 ++++++--- tofu/version.py | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tofu/geom/utils.py b/tofu/geom/utils.py index e33a15733..4caf5774c 100644 --- a/tofu/geom/utils.py +++ b/tofu/geom/utils.py @@ -858,11 +858,14 @@ def create_config(case=None, Exp='Dummy', Type='Tor', any([pp is not None for pp in lp])] if np.sum(lc) > 1: msg = ("Please provide either:\n" - + "\t- case: the name of a stored case\n" - + "\t- geometrical parameters {}".format(lpstr)) + + "\t- case: the name of a pre-defined config\n" + + "\t- geometrical parameters {}\n\n".format(lpstr) + + get_available_config(verb=False, returnas=str)) raise Exception(msg) elif not any(lc): - case = _DEFCONFIG + msg = get_available_config(verb=False, returnas=str) + raise Exception(msg) + # case = _DEFCONFIG # Get config, either from known case or geometrical parameterization if case is not None: diff --git a/tofu/version.py b/tofu/version.py index 8c2ca6d8b..56c82a627 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.2-a5-64-g6503b991' +__version__ = '1.4.2-a5-65-gf2f9cb48' From 11c10608547fe23072bf43acbd118c77b12cc9af Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Tue, 14 Jan 2020 18:07:10 +0100 Subject: [PATCH 135/168] [Issue301] Typo --- tofu/geom/utils.py | 3 +-- tofu/version.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tofu/geom/utils.py b/tofu/geom/utils.py index 4caf5774c..230530c42 100644 --- a/tofu/geom/utils.py +++ b/tofu/geom/utils.py @@ -859,8 +859,7 @@ def create_config(case=None, Exp='Dummy', Type='Tor', if np.sum(lc) > 1: msg = ("Please provide either:\n" + "\t- case: the name of a pre-defined config\n" - + "\t- geometrical parameters {}\n\n".format(lpstr) - + get_available_config(verb=False, returnas=str)) + + "\t- geometrical parameters {}\n\n".format(lpstr)) raise Exception(msg) elif not any(lc): msg = get_available_config(verb=False, returnas=str) diff --git a/tofu/version.py b/tofu/version.py index 56c82a627..6b5f1dfa5 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.2-a5-65-gf2f9cb48' +__version__ = '1.4.2-a5-66-g995809ff' From 67d988bb2427efba635cf0949918095493b2728a Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Fri, 17 Jan 2020 09:22:56 +0100 Subject: [PATCH 136/168] [Issue281] Added diaggeom input file for AUG config in 2D --- AUG_vessel_20200116.coords | 741 +++++++++++++++++++++++++++++++++++++ tofu/version.py | 2 +- 2 files changed, 742 insertions(+), 1 deletion(-) create mode 100644 AUG_vessel_20200116.coords diff --git a/AUG_vessel_20200116.coords b/AUG_vessel_20200116.coords new file mode 100644 index 000000000..05eb85fdb --- /dev/null +++ b/AUG_vessel_20200116.coords @@ -0,0 +1,741 @@ +# Vessel coordinates 37095 + +# PCup + 2.151 0.562 + 1.966 0.865 + 1.966 0.874 + 2.054 0.874 + 2.233 0.582 + 2.233 0.562 + 2.151 0.562 + +# PClow + 1.877 -0.874 + 1.877 -0.864 + 2.075 -0.562 + 2.158 -0.562 + 2.158 -0.582 + 1.966 -0.874 + 1.877 -0.874 + +# LIM09 + 1.095 -0.760 + 1.095 -0.680 + 1.073 -0.680 + 1.073 -0.705 + 1.000 -0.705 + 1.000 -0.725 + 1.073 -0.725 + 1.073 -0.760 + 1.095 -0.760 + +# SBi + 1.100 -0.584 + 1.085 -0.517 + 1.072 -0.450 + 1.060 -0.382 + 1.051 -0.314 + 1.043 -0.246 + 1.037 -0.177 + 1.033 -0.108 + 1.031 -0.040 + 1.031 0.029 + 1.033 0.098 + 1.037 0.166 + 1.042 0.235 + 1.049 0.303 + 1.059 0.371 + 1.070 0.439 + 1.083 0.507 + 1.098 0.574 + 1.114 0.641 + 1.133 0.707 + 1.153 0.773 + 1.164 0.769 + 1.144 0.704 + 1.126 0.638 + 1.109 0.571 + 1.095 0.504 + 1.082 0.437 + 1.071 0.370 + 1.061 0.302 + 1.054 0.234 + 1.049 0.166 + 1.045 0.097 + 1.043 0.029 + 1.043 -0.040 + 1.045 -0.108 + 1.049 -0.176 + 1.055 -0.244 + 1.063 -0.312 + 1.072 -0.380 + 1.083 -0.448 + 1.097 -0.515 + 1.112 -0.582 + 1.100 -0.584 + +# ICRHa + 2.002 -0.524 + 1.997 -0.523 + 1.994 -0.520 + 1.992 -0.516 + 1.992 -0.511 + 1.994 -0.507 + 2.004 -0.495 + 2.017 -0.476 + 2.030 -0.457 + 2.043 -0.438 + 2.055 -0.418 + 2.066 -0.399 + 2.078 -0.379 + 2.089 -0.358 + 2.099 -0.338 + 2.109 -0.317 + 2.118 -0.296 + 2.126 -0.276 + 2.127 -0.275 + 2.136 -0.253 + 2.144 -0.231 + 2.151 -0.210 + 2.159 -0.188 + 2.165 -0.166 + 2.170 -0.149 + 2.171 -0.143 + 2.175 -0.129 + 2.177 -0.121 + 2.182 -0.098 + 2.187 -0.075 + 2.191 -0.053 + 2.195 -0.030 + 2.198 -0.007 + 2.198 -0.001 + 2.200 0.016 + 2.203 0.039 + 2.204 0.062 + 2.205 0.098 + 2.205 0.133 + 2.204 0.157 + 2.204 0.169 + 2.200 0.204 + 2.200 0.209 + 2.196 0.239 + 2.190 0.274 + 2.182 0.308 + 2.173 0.343 + 2.162 0.377 + 2.159 0.386 + 2.150 0.410 + 2.137 0.442 + 2.137 0.443 + 2.122 0.475 + 2.109 0.499 + 2.106 0.509 + 2.107 0.517 + 2.111 0.524 + 2.118 0.529 + 2.126 0.531 + 2.900 0.531 + 2.900 -0.524 + 2.002 -0.524 + +# VESiR + 2.521 0.000 + 2.506 0.210 + 2.461 0.416 + 2.387 0.613 + 2.286 0.798 + 2.159 0.966 + 2.010 1.114 + 1.841 1.240 + 1.841 1.240 + 1.705 1.303 + 1.558 1.329 + 1.409 1.315 + 1.269 1.264 + 1.147 1.177 + 1.052 1.062 + 0.990 0.927 + 0.965 0.779 + 0.965 0.779 + 0.957 0.519 + 0.953 0.260 + 0.951 0.000 + 0.953 -0.260 + 0.957 -0.519 + 0.965 -0.779 + 0.965 -0.779 + 0.990 -0.927 + 1.052 -1.062 + 1.147 -1.177 + 1.269 -1.264 + 1.409 -1.315 + 1.558 -1.329 + 1.705 -1.303 + 1.841 -1.240 + 1.841 -1.240 + 2.010 -1.114 + 2.159 -0.966 + 2.286 -0.798 + 2.387 -0.613 + 2.461 -0.416 + 2.506 -0.210 + 2.521 0.000 + +# D2c.i1 + 1.138 -0.658 + 1.141 -0.659 + 1.143 -0.660 + 1.145 -0.661 + 1.187 -0.726 + 1.187 -0.727 + 1.187 -0.728 + 1.187 -0.729 + 1.186 -0.730 + 1.165 -0.744 + 1.117 -0.669 + 1.136 -0.658 + 1.138 -0.658 + +# D2c.i2 + 1.187 -0.730 + 1.188 -0.730 + 1.189 -0.730 + 1.190 -0.731 + 1.247 -0.820 + 1.247 -0.822 + 1.244 -0.824 + 1.216 -0.824 + 1.165 -0.744 + 1.186 -0.730 + 1.187 -0.730 + +# D2c.TPib + 1.249 -0.826 + 1.250 -0.827 + 1.250 -0.827 + 1.250 -0.827 + 1.250 -0.827 + 1.259 -0.842 + 1.266 -0.858 + 1.273 -0.873 + 1.278 -0.890 + 1.282 -0.906 + 1.285 -0.923 + 1.287 -0.940 + 1.288 -0.957 + 1.287 -0.974 + 1.287 -0.975 + 1.287 -0.976 + 1.286 -0.977 + 1.286 -0.977 + 1.285 -0.978 + 1.284 -0.978 + 1.283 -0.979 + 1.282 -0.979 + 1.226 -0.979 + 1.226 -0.825 + 1.246 -0.825 + 1.246 -0.825 + 1.247 -0.825 + 1.247 -0.825 + 1.248 -0.826 + 1.248 -0.826 + 1.248 -0.826 + 1.249 -0.826 + 1.249 -0.826 + 1.249 -0.826 + +# D2c.TPi + 1.281 -0.981 + 1.282 -0.983 + 1.283 -0.985 + 1.283 -0.987 + 1.236 -1.123 + 1.235 -1.124 + 1.235 -1.125 + 1.234 -1.125 + 1.233 -1.125 + 1.232 -1.125 + 1.232 -1.125 + 1.231 -1.125 + 1.230 -1.125 + 1.217 -1.138 + 1.201 -1.122 + 1.249 -0.980 + 1.265 -0.986 + 1.267 -0.980 + 1.278 -0.980 + 1.281 -0.981 + +# D2c.TPic + 1.232 -1.125 + 1.233 -1.126 + 1.234 -1.128 + 1.244 -1.142 + 1.244 -1.142 + 1.244 -1.143 + 1.244 -1.144 + 1.243 -1.144 + 1.233 -1.154 + 1.217 -1.138 + 1.230 -1.126 + 1.230 -1.125 + 1.231 -1.125 + 1.232 -1.125 + +# D2c.domL + 1.280 -1.123 + 1.280 -1.102 + 1.280 -1.100 + 1.280 -1.098 + 1.282 -1.096 + 1.314 -1.071 + 1.315 -1.070 + 1.317 -1.069 + 1.319 -1.070 + 1.321 -1.071 + 1.337 -1.092 + 1.286 -1.133 + 1.281 -1.126 + 1.281 -1.125 + 1.280 -1.123 + +# D2c.dome + 1.320 -1.066 + 1.322 -1.064 + 1.326 -1.062 + 1.459 -1.062 + 1.461 -1.063 + 1.463 -1.064 + 1.482 -1.087 + 1.482 -1.088 + 1.482 -1.089 + 1.482 -1.090 + 1.480 -1.090 + 1.337 -1.090 + 1.320 -1.068 + 1.319 -1.067 + 1.320 -1.066 + +# D2c.domR + 1.487 -1.093 + 1.554 -1.173 + 1.555 -1.175 + 1.555 -1.175 + 1.555 -1.176 + 1.555 -1.184 + 1.555 -1.186 + 1.554 -1.188 + 1.543 -1.196 + 1.462 -1.101 + 1.472 -1.093 + 1.474 -1.092 + 1.475 -1.091 + 1.483 -1.091 + 1.485 -1.092 + 1.487 -1.093 + +# D3.BG10 + 1.554 -1.218 + 1.555 -1.216 + 1.556 -1.214 + 1.558 -1.213 + 1.562 -1.211 + 1.563 -1.210 + 1.566 -1.209 + 1.567 -1.209 + 1.579 -1.209 + 1.579 -1.215 + 1.577 -1.222 + 1.562 -1.222 + 1.562 -1.220 + 1.561 -1.219 + 1.556 -1.219 + 1.555 -1.220 + 1.555 -1.222 + 1.554 -1.222 + 1.554 -1.220 + 1.554 -1.218 + +# D3.BG1 + 1.579 -1.208 + 1.635 -0.999 + 1.639 -0.999 + 1.634 -1.021 + 1.637 -1.021 + 1.638 -1.022 + 1.639 -1.021 + 1.640 -1.020 + 1.640 -1.018 + 1.641 -1.014 + 1.642 -1.013 + 1.647 -1.015 + 1.592 -1.220 + 1.584 -1.220 + 1.587 -1.212 + 1.587 -1.211 + 1.587 -1.210 + 1.586 -1.209 + 1.585 -1.208 + 1.584 -1.208 + 1.579 -1.208 + +# D2d.BG2 + 1.636 -0.997 + 1.636 -0.995 + 1.638 -0.986 + 1.643 -0.972 + 1.649 -0.956 + 1.658 -0.937 + 1.665 -0.924 + 1.674 -0.909 + 1.687 -0.888 + 1.702 -0.863 + 1.704 -0.860 + 1.707 -0.857 + 1.711 -0.854 + 1.715 -0.850 + 1.722 -0.846 + 1.727 -0.843 + 1.732 -0.842 + 1.739 -0.840 + 1.745 -0.839 + 1.758 -0.839 + 1.763 -0.845 + 1.745 -0.868 + 1.737 -0.868 + 1.732 -0.870 + 1.728 -0.872 + 1.725 -0.875 + 1.671 -0.998 + 1.638 -0.998 + 1.636 -0.997 + +# D2d.Bl3 + 1.752 -0.826 + 1.753 -0.826 + 1.875 -0.686 + 1.876 -0.686 + 1.878 -0.685 + 1.879 -0.686 + 1.879 -0.686 + 1.939 -0.725 + 1.901 -0.783 + 1.870 -0.762 + 1.775 -0.845 + 1.772 -0.842 + 1.771 -0.841 + 1.770 -0.839 + 1.752 -0.826 + +# D2d.Bl2 + 1.879 -0.683 + 1.994 -0.550 + 1.996 -0.549 + 1.998 -0.548 + 2.000 -0.547 + 2.002 -0.547 + 2.006 -0.547 + 2.007 -0.547 + 2.008 -0.548 + 2.008 -0.549 + 2.008 -0.559 + 1.950 -0.647 + 1.978 -0.666 + 1.940 -0.723 + +# D2d.Bl1 + 2.011 -0.560 + 2.011 -0.559 + 2.018 -0.548 + 2.019 -0.547 + 2.020 -0.547 + 2.149 -0.547 + 2.150 -0.547 + 2.151 -0.548 + 2.151 -0.549 + 2.151 -0.562 + 2.013 -0.562 + 2.012 -0.562 + 2.011 -0.561 + 2.011 -0.560 + +# TPLT_1 + 1.500 1.185 + 1.336 1.093 + 1.335 1.093 + 1.334 1.093 + 1.320 1.103 + 1.328 1.114 + 1.322 1.119 + 1.367 1.178 + 1.407 1.178 + 1.497 1.196 + 1.499 1.196 + 1.501 1.195 + 1.502 1.194 + 1.503 1.192 + 1.503 1.190 + 1.503 1.188 + 1.502 1.186 + 1.500 1.185 + +# TPLT_2 + 1.331 1.087 + 1.288 1.031 + 1.287 1.030 + 1.286 1.029 + 1.284 1.029 + 1.258 1.037 + 1.312 1.108 + 1.330 1.094 + 1.331 1.093 + 1.332 1.092 + 1.332 1.090 + 1.332 1.089 + 1.331 1.087 + +# TPLT_3 + 1.282 1.023 + 1.242 0.969 + 1.240 0.967 + 1.239 0.966 + 1.238 0.965 + 1.236 0.965 + 1.235 0.965 + 1.234 0.965 + 1.209 0.973 + 1.257 1.036 + 1.281 1.030 + 1.282 1.029 + 1.283 1.028 + 1.283 1.026 + 1.283 1.024 + 1.282 1.023 + +# TPLT_4 + 1.237 0.958 + 1.208 0.891 + 1.207 0.891 + 1.207 0.890 + 1.206 0.890 + 1.206 0.889 + 1.205 0.889 + 1.204 0.888 + 1.204 0.888 + 1.203 0.888 + 1.202 0.888 + 1.201 0.889 + 1.200 0.889 + 1.200 0.889 + 1.166 0.915 + 1.209 0.973 + 1.234 0.965 + 1.234 0.965 + 1.235 0.965 + 1.235 0.964 + 1.236 0.964 + 1.236 0.963 + 1.237 0.962 + 1.237 0.961 + 1.237 0.961 + 1.237 0.960 + 1.237 0.959 + 1.237 0.958 + +# TPLT_5 + 1.203 0.881 + 1.180 0.820 + 1.179 0.818 + 1.179 0.818 + 1.178 0.816 + 1.178 0.816 + 1.167 0.802 + 1.167 0.802 + 1.166 0.801 + 1.166 0.801 + 1.165 0.800 + 1.164 0.800 + 1.163 0.800 + 1.162 0.800 + 1.161 0.800 + 1.161 0.800 + 1.160 0.801 + 1.160 0.801 + 1.119 0.832 + 1.142 0.861 + 1.131 0.869 + 1.165 0.914 + 1.201 0.886 + 1.202 0.886 + 1.202 0.886 + 1.203 0.885 + 1.203 0.884 + 1.203 0.883 + 1.203 0.882 + 1.203 0.882 + 1.203 0.881 + 1.203 0.881 + +# TPRT_2 + 1.863 0.941 + 1.775 1.071 + 1.774 1.073 + 1.774 1.075 + 1.775 1.076 + 1.776 1.078 + 1.784 1.083 + 1.801 1.076 + 1.802 1.076 + 1.802 1.075 + 1.803 1.075 + 1.804 1.075 + 1.805 1.076 + 1.806 1.076 + 1.806 1.077 + 1.807 1.077 + 1.807 1.078 + 1.808 1.078 + 1.814 1.093 + 1.839 1.083 + 1.913 0.973 + 1.914 0.972 + 1.914 0.970 + 1.913 0.968 + 1.912 0.966 + 1.870 0.939 + 1.868 0.938 + 1.866 0.938 + 1.865 0.939 + 1.863 0.941 + 1.863 0.941 + +# TPRT_3 + 1.796 1.082 + 1.729 1.106 + 1.727 1.107 + 1.726 1.108 + 1.725 1.109 + 1.725 1.111 + 1.726 1.112 + 1.733 1.132 + 1.809 1.105 + 1.802 1.084 + 1.801 1.083 + 1.800 1.082 + 1.799 1.081 + 1.797 1.081 + 1.796 1.082 + +# TPRT_4 + 1.718 1.109 + 1.651 1.134 + 1.650 1.135 + 1.649 1.136 + 1.648 1.138 + 1.648 1.140 + 1.656 1.160 + 1.732 1.133 + 1.725 1.112 + 1.724 1.111 + 1.722 1.110 + 1.720 1.109 + 1.718 1.109 + +# TPRT_5 + 1.644 1.137 + 1.509 1.190 + 1.508 1.191 + 1.507 1.195 + 1.506 1.195 + 1.504 1.198 + 1.501 1.200 + 1.494 1.203 + 1.493 1.204 + 1.493 1.205 + 1.493 1.206 + 1.493 1.206 + 1.501 1.217 + 1.655 1.161 + 1.646 1.138 + 1.646 1.137 + 1.645 1.137 + 1.644 1.137 + 1.644 1.137 + +# D2d.Bu4 + 2.121 0.547 + 2.113 0.559 + 2.113 0.560 + 2.113 0.561 + 2.114 0.562 + 2.115 0.562 + 2.228 0.562 + 2.228 0.547 + 2.121 0.547 + +# D2d.Bu3 + 2.101 0.547 + 2.003 0.707 + 2.046 0.734 + 2.081 0.676 + 2.067 0.667 + 2.063 0.664 + 2.060 0.659 + 2.058 0.653 + 2.059 0.646 + 2.061 0.640 + 2.118 0.547 + 2.101 0.547 + +# D2d.Bu2 + 2.002 0.708 + 1.905 0.866 + 1.918 0.874 + 1.969 0.791 + 1.974 0.786 + 1.980 0.782 + 1.985 0.781 + 1.991 0.781 + 1.996 0.783 + 2.010 0.792 + 2.045 0.734 + 2.002 0.708 + 2.002 0.708 + +# D2d.Bu1 + 1.905 0.868 + 1.904 0.868 + 1.904 0.869 + 1.903 0.869 + 1.903 0.869 + 1.897 0.880 + 1.896 0.881 + 1.896 0.881 + 1.896 0.881 + 1.897 0.882 + 1.897 0.882 + 1.897 0.882 + 1.897 0.883 + 1.897 0.883 + 1.897 0.883 + 1.897 0.884 + 1.875 0.921 + 1.875 0.922 + 1.875 0.923 + 1.875 0.923 + 1.875 0.924 + 1.875 0.924 + 1.924 0.952 + 1.925 0.953 + 1.927 0.953 + 1.928 0.954 + 1.930 0.954 + 1.932 0.953 + 2.022 0.925 + 2.022 0.894 + 1.949 0.894 + 1.906 0.869 + 1.905 0.868 + 1.905 0.868 + 1.905 0.868 diff --git a/tofu/version.py b/tofu/version.py index 38f81c4e7..814916362 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.2-alpha2-48-gbe9fde3' +__version__ = '1.4.2-alpha2-50-g1bd7a6df' From 8cf3812b6a15bae0dbe0c6fc0dfa53b610d9226d Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Fri, 17 Jan 2020 10:25:51 +0100 Subject: [PATCH 137/168] [Issue281] First version of all AUG txt files from diaggeom, 13/33 have double points, to be corrected --- tofu/geom/inputs/TFG_PFC_ExpAUG_D2cTPi.txt | 24 ++++++++ tofu/geom/inputs/TFG_PFC_ExpAUG_D2cTPib.txt | 38 ++++++++++++ tofu/geom/inputs/TFG_PFC_ExpAUG_D2cTPic.txt | 18 ++++++ tofu/geom/inputs/TFG_PFC_ExpAUG_D2cdomL.txt | 19 ++++++ tofu/geom/inputs/TFG_PFC_ExpAUG_D2cdomR.txt | 20 +++++++ tofu/geom/inputs/TFG_PFC_ExpAUG_D2cdome.txt | 19 ++++++ tofu/geom/inputs/TFG_PFC_ExpAUG_D2ci1.txt | 17 ++++++ tofu/geom/inputs/TFG_PFC_ExpAUG_D2ci2.txt | 15 +++++ tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBG2.txt | 33 +++++++++++ tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBl1.txt | 18 ++++++ tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBl2.txt | 18 ++++++ tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBl3.txt | 19 ++++++ tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBu1.txt | 39 ++++++++++++ tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBu2.txt | 17 ++++++ tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBu3.txt | 16 +++++ tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBu4.txt | 13 ++++ tofu/geom/inputs/TFG_PFC_ExpAUG_D3BG1.txt | 25 ++++++++ tofu/geom/inputs/TFG_PFC_ExpAUG_D3BG10.txt | 24 ++++++++ tofu/geom/inputs/TFG_PFC_ExpAUG_ICRHa.txt | 66 +++++++++++++++++++++ tofu/geom/inputs/TFG_PFC_ExpAUG_LIM09.txt | 13 ++++ tofu/geom/inputs/TFG_PFC_ExpAUG_PClow.txt | 11 ++++ tofu/geom/inputs/TFG_PFC_ExpAUG_PCup.txt | 11 ++++ tofu/geom/inputs/TFG_PFC_ExpAUG_SBi.txt | 47 +++++++++++++++ tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT1.txt | 22 +++++++ tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT2.txt | 17 ++++++ tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT3.txt | 20 +++++++ tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT4.txt | 32 ++++++++++ tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT5.txt | 36 +++++++++++ tofu/geom/inputs/TFG_PFC_ExpAUG_TPRT2.txt | 35 +++++++++++ tofu/geom/inputs/TFG_PFC_ExpAUG_TPRT3.txt | 19 ++++++ tofu/geom/inputs/TFG_PFC_ExpAUG_TPRT4.txt | 17 ++++++ tofu/geom/inputs/TFG_PFC_ExpAUG_TPRT5.txt | 23 +++++++ tofu/geom/inputs/TFG_PFC_ExpAUG_VESiR.txt | 45 ++++++++++++++ tofu/version.py | 2 +- 34 files changed, 807 insertions(+), 1 deletion(-) create mode 100644 tofu/geom/inputs/TFG_PFC_ExpAUG_D2cTPi.txt create mode 100644 tofu/geom/inputs/TFG_PFC_ExpAUG_D2cTPib.txt create mode 100644 tofu/geom/inputs/TFG_PFC_ExpAUG_D2cTPic.txt create mode 100644 tofu/geom/inputs/TFG_PFC_ExpAUG_D2cdomL.txt create mode 100644 tofu/geom/inputs/TFG_PFC_ExpAUG_D2cdomR.txt create mode 100644 tofu/geom/inputs/TFG_PFC_ExpAUG_D2cdome.txt create mode 100644 tofu/geom/inputs/TFG_PFC_ExpAUG_D2ci1.txt create mode 100644 tofu/geom/inputs/TFG_PFC_ExpAUG_D2ci2.txt create mode 100644 tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBG2.txt create mode 100644 tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBl1.txt create mode 100644 tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBl2.txt create mode 100644 tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBl3.txt create mode 100644 tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBu1.txt create mode 100644 tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBu2.txt create mode 100644 tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBu3.txt create mode 100644 tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBu4.txt create mode 100644 tofu/geom/inputs/TFG_PFC_ExpAUG_D3BG1.txt create mode 100644 tofu/geom/inputs/TFG_PFC_ExpAUG_D3BG10.txt create mode 100644 tofu/geom/inputs/TFG_PFC_ExpAUG_ICRHa.txt create mode 100644 tofu/geom/inputs/TFG_PFC_ExpAUG_LIM09.txt create mode 100644 tofu/geom/inputs/TFG_PFC_ExpAUG_PClow.txt create mode 100644 tofu/geom/inputs/TFG_PFC_ExpAUG_PCup.txt create mode 100644 tofu/geom/inputs/TFG_PFC_ExpAUG_SBi.txt create mode 100644 tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT1.txt create mode 100644 tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT2.txt create mode 100644 tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT3.txt create mode 100644 tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT4.txt create mode 100644 tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT5.txt create mode 100644 tofu/geom/inputs/TFG_PFC_ExpAUG_TPRT2.txt create mode 100644 tofu/geom/inputs/TFG_PFC_ExpAUG_TPRT3.txt create mode 100644 tofu/geom/inputs/TFG_PFC_ExpAUG_TPRT4.txt create mode 100644 tofu/geom/inputs/TFG_PFC_ExpAUG_TPRT5.txt create mode 100644 tofu/geom/inputs/TFG_PFC_ExpAUG_VESiR.txt diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2cTPi.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2cTPi.txt new file mode 100644 index 000000000..6cb901060 --- /dev/null +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2cTPi.txt @@ -0,0 +1,24 @@ +#Name = D2cTPi +#Exp = AUG +#CLs = PFC +20 0 +1.281 -0.981 +1.282 -0.983 +1.283 -0.985 +1.283 -0.987 +1.236 -1.123 +1.235 -1.124 +1.235 -1.125 +1.234 -1.125 +1.233 -1.125 +1.232 -1.125 +1.232 -1.125 +1.231 -1.125 +1.230 -1.125 +1.217 -1.138 +1.201 -1.122 +1.249 -0.980 +1.265 -0.986 +1.267 -0.980 +1.278 -0.980 +1.281 -0.981 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2cTPib.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2cTPib.txt new file mode 100644 index 000000000..842645219 --- /dev/null +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2cTPib.txt @@ -0,0 +1,38 @@ +#Name = D2cTPib +#Exp = AUG +#CLs = PFC +34 0 +1.249 -0.826 +1.250 -0.827 +1.250 -0.827 +1.250 -0.827 +1.250 -0.827 +1.259 -0.842 +1.266 -0.858 +1.273 -0.873 +1.278 -0.890 +1.282 -0.906 +1.285 -0.923 +1.287 -0.940 +1.288 -0.957 +1.287 -0.974 +1.287 -0.975 +1.287 -0.976 +1.286 -0.977 +1.286 -0.977 +1.285 -0.978 +1.284 -0.978 +1.283 -0.979 +1.282 -0.979 +1.226 -0.979 +1.226 -0.825 +1.246 -0.825 +1.246 -0.825 +1.247 -0.825 +1.247 -0.825 +1.248 -0.826 +1.248 -0.826 +1.248 -0.826 +1.249 -0.826 +1.249 -0.826 +1.249 -0.826 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2cTPic.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2cTPic.txt new file mode 100644 index 000000000..0dd5d87b1 --- /dev/null +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2cTPic.txt @@ -0,0 +1,18 @@ +#Name = D2cTPic +#Exp = AUG +#CLs = PFC +14 0 +1.232 -1.125 +1.233 -1.126 +1.234 -1.128 +1.244 -1.142 +1.244 -1.142 +1.244 -1.143 +1.244 -1.144 +1.243 -1.144 +1.233 -1.154 +1.217 -1.138 +1.230 -1.126 +1.230 -1.125 +1.231 -1.125 +1.232 -1.125 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2cdomL.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2cdomL.txt new file mode 100644 index 000000000..70677dff9 --- /dev/null +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2cdomL.txt @@ -0,0 +1,19 @@ +#Name = D2cdomL +#Exp = AUG +#CLs = PFC +15 0 +1.280 -1.123 +1.280 -1.102 +1.280 -1.100 +1.280 -1.098 +1.282 -1.096 +1.314 -1.071 +1.315 -1.070 +1.317 -1.069 +1.319 -1.070 +1.321 -1.071 +1.337 -1.092 +1.286 -1.133 +1.281 -1.126 +1.281 -1.125 +1.280 -1.123 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2cdomR.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2cdomR.txt new file mode 100644 index 000000000..efe931d1c --- /dev/null +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2cdomR.txt @@ -0,0 +1,20 @@ +#Name = D2CdomR +#Exp = AUG +#CLs = PFC +16 0 +1.487 -1.093 +1.554 -1.173 +1.555 -1.175 +1.555 -1.175 +1.555 -1.176 +1.555 -1.184 +1.555 -1.186 +1.554 -1.188 +1.543 -1.196 +1.462 -1.101 +1.472 -1.093 +1.474 -1.092 +1.475 -1.091 +1.483 -1.091 +1.485 -1.092 +1.487 -1.093 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2cdome.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2cdome.txt new file mode 100644 index 000000000..9ce921cc9 --- /dev/null +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2cdome.txt @@ -0,0 +1,19 @@ +#Name = D2cdome +#Exp = AUG +#CLs = PFC +15 0 +1.320 -1.066 +1.322 -1.064 +1.326 -1.062 +1.459 -1.062 +1.461 -1.063 +1.463 -1.064 +1.482 -1.087 +1.482 -1.088 +1.482 -1.089 +1.482 -1.090 +1.480 -1.090 +1.337 -1.090 +1.320 -1.068 +1.319 -1.067 +1.320 -1.066 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2ci1.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2ci1.txt new file mode 100644 index 000000000..f33fea4ba --- /dev/null +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2ci1.txt @@ -0,0 +1,17 @@ +#Name = D2ci1 +#Exp = AUG +#CLs = PFC +13 0 +1.138 -0.658 +1.141 -0.659 +1.143 -0.660 +1.145 -0.661 +1.187 -0.726 +1.187 -0.727 +1.187 -0.728 +1.187 -0.729 +1.186 -0.730 +1.165 -0.744 +1.117 -0.669 +1.136 -0.658 +1.138 -0.658 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2ci2.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2ci2.txt new file mode 100644 index 000000000..edbdbf163 --- /dev/null +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2ci2.txt @@ -0,0 +1,15 @@ +#Name = D2ci2 +#Exp = AUG +#CLs = PFC +11 0 +1.187 -0.730 +1.188 -0.730 +1.189 -0.730 +1.190 -0.731 +1.247 -0.820 +1.247 -0.822 +1.244 -0.824 +1.216 -0.824 +1.165 -0.744 +1.186 -0.730 +1.187 -0.730 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBG2.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBG2.txt new file mode 100644 index 000000000..16e1023b9 --- /dev/null +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBG2.txt @@ -0,0 +1,33 @@ +#Name = D2dBG2 +#Exp = AUG +#CLs = PFC +29 0 +1.636 -0.997 +1.636 -0.995 +1.638 -0.986 +1.643 -0.972 +1.649 -0.956 +1.658 -0.937 +1.665 -0.924 +1.674 -0.909 +1.687 -0.888 +1.702 -0.863 +1.704 -0.860 +1.707 -0.857 +1.711 -0.854 +1.715 -0.850 +1.722 -0.846 +1.727 -0.843 +1.732 -0.842 +1.739 -0.840 +1.745 -0.839 +1.758 -0.839 +1.763 -0.845 +1.745 -0.868 +1.737 -0.868 +1.732 -0.870 +1.728 -0.872 +1.725 -0.875 +1.671 -0.998 +1.638 -0.998 +1.636 -0.997 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBl1.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBl1.txt new file mode 100644 index 000000000..993b43bb9 --- /dev/null +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBl1.txt @@ -0,0 +1,18 @@ +#Name = D2dBl1 +#Exp = AUG +#CLs = PFC +14 0 +2.011 -0.560 +2.011 -0.559 +2.018 -0.548 +2.019 -0.547 +2.020 -0.547 +2.149 -0.547 +2.150 -0.547 +2.151 -0.548 +2.151 -0.549 +2.151 -0.562 +2.013 -0.562 +2.012 -0.562 +2.011 -0.561 +2.011 -0.560 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBl2.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBl2.txt new file mode 100644 index 000000000..66e8536d3 --- /dev/null +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBl2.txt @@ -0,0 +1,18 @@ +#Name = D2dBl2 +#Exp = AUG +#CLs = PFC +14 0 +1.879 -0.683 +1.994 -0.550 +1.996 -0.549 +1.998 -0.548 +2.000 -0.547 +2.002 -0.547 +2.006 -0.547 +2.007 -0.547 +2.008 -0.548 +2.008 -0.549 +2.008 -0.559 +1.950 -0.647 +1.978 -0.666 +1.940 -0.723 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBl3.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBl3.txt new file mode 100644 index 000000000..7d34fdbdc --- /dev/null +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBl3.txt @@ -0,0 +1,19 @@ +#Name = D2dBl3 +#Exp = AUG +#CLs = PFC +15 0 +1.752 -0.826 +1.753 -0.826 +1.875 -0.686 +1.876 -0.686 +1.878 -0.685 +1.879 -0.686 +1.879 -0.686 +1.939 -0.725 +1.901 -0.783 +1.870 -0.762 +1.775 -0.845 +1.772 -0.842 +1.771 -0.841 +1.770 -0.839 +1.752 -0.826 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBu1.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBu1.txt new file mode 100644 index 000000000..6535b1cb9 --- /dev/null +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBu1.txt @@ -0,0 +1,39 @@ +#Name = D2dBu1 +#Exp = AUG +#CLs = PFC +35 0 +1.905 0.868 +1.904 0.868 +1.904 0.869 +1.903 0.869 +1.903 0.869 +1.897 0.880 +1.896 0.881 +1.896 0.881 +1.896 0.881 +1.897 0.882 +1.897 0.882 +1.897 0.882 +1.897 0.883 +1.897 0.883 +1.897 0.883 +1.897 0.884 +1.875 0.921 +1.875 0.922 +1.875 0.923 +1.875 0.923 +1.875 0.924 +1.875 0.924 +1.924 0.952 +1.925 0.953 +1.927 0.953 +1.928 0.954 +1.930 0.954 +1.932 0.953 +2.022 0.925 +2.022 0.894 +1.949 0.894 +1.906 0.869 +1.905 0.868 +1.905 0.868 +1.905 0.868 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBu2.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBu2.txt new file mode 100644 index 000000000..fd60ed1c4 --- /dev/null +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBu2.txt @@ -0,0 +1,17 @@ +#Name = D2dBu2 +#Exp = AUG +#CLs = PFC +13 0 +2.002 0.708 +1.905 0.866 +1.918 0.874 +1.969 0.791 +1.974 0.786 +1.980 0.782 +1.985 0.781 +1.991 0.781 +1.996 0.783 +2.010 0.792 +2.045 0.734 +2.002 0.708 +2.002 0.708 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBu3.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBu3.txt new file mode 100644 index 000000000..aaf35f1f2 --- /dev/null +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBu3.txt @@ -0,0 +1,16 @@ +#Name = D2dBu3 +#Exp = AUG +#CLs = PFC +12 0 +2.101 0.547 +2.003 0.707 +2.046 0.734 +2.081 0.676 +2.067 0.667 +2.063 0.664 +2.060 0.659 +2.058 0.653 +2.059 0.646 +2.061 0.640 +2.118 0.547 +2.101 0.547 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBu4.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBu4.txt new file mode 100644 index 000000000..0c998d3fd --- /dev/null +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBu4.txt @@ -0,0 +1,13 @@ +#Name = D2dBu4 +#Exp = AUG +#CLs = PFC +9 0 +2.121 0.547 +2.113 0.559 +2.113 0.560 +2.113 0.561 +2.114 0.562 +2.115 0.562 +2.228 0.562 +2.228 0.547 +2.121 0.547 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_D3BG1.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_D3BG1.txt new file mode 100644 index 000000000..83af9b109 --- /dev/null +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_D3BG1.txt @@ -0,0 +1,25 @@ +#Name = D3BG1 +#Exp = AUG +#CLs = PFC +21 0 +1.579 -1.208 +1.635 -0.999 +1.639 -0.999 +1.634 -1.021 +1.637 -1.021 +1.638 -1.022 +1.639 -1.021 +1.640 -1.020 +1.640 -1.018 +1.641 -1.014 +1.642 -1.013 +1.647 -1.015 +1.592 -1.220 +1.584 -1.220 +1.587 -1.212 +1.587 -1.211 +1.587 -1.210 +1.586 -1.209 +1.585 -1.208 +1.584 -1.208 +1.579 -1.208 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_D3BG10.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_D3BG10.txt new file mode 100644 index 000000000..a6d39db7e --- /dev/null +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_D3BG10.txt @@ -0,0 +1,24 @@ +#Name = D3BG10 +#Exp = AUG +#CLs = PFC +20 0 +1.554 -1.218 +1.555 -1.216 +1.556 -1.214 +1.558 -1.213 +1.562 -1.211 +1.563 -1.210 +1.566 -1.209 +1.567 -1.209 +1.579 -1.209 +1.579 -1.215 +1.577 -1.222 +1.562 -1.222 +1.562 -1.220 +1.561 -1.219 +1.556 -1.219 +1.555 -1.220 +1.555 -1.222 +1.554 -1.222 +1.554 -1.220 +1.554 -1.218 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_ICRHa.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_ICRHa.txt new file mode 100644 index 000000000..4a5d33a02 --- /dev/null +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_ICRHa.txt @@ -0,0 +1,66 @@ +#Name = ICRHa +#Exp = AUG +#CLs = PFC +62 0 +2.002 -0.524 +1.997 -0.523 +1.994 -0.520 +1.992 -0.516 +1.992 -0.511 +1.994 -0.507 +2.004 -0.495 +2.017 -0.476 +2.030 -0.457 +2.043 -0.438 +2.055 -0.418 +2.066 -0.399 +2.078 -0.379 +2.089 -0.358 +2.099 -0.338 +2.109 -0.317 +2.118 -0.296 +2.126 -0.276 +2.127 -0.275 +2.136 -0.253 +2.144 -0.231 +2.151 -0.210 +2.159 -0.188 +2.165 -0.166 +2.170 -0.149 +2.171 -0.143 +2.175 -0.129 +2.177 -0.121 +2.182 -0.098 +2.187 -0.075 +2.191 -0.053 +2.195 -0.030 +2.198 -0.007 +2.198 -0.001 +2.200 0.016 +2.203 0.039 +2.204 0.062 +2.205 0.098 +2.205 0.133 +2.204 0.157 +2.204 0.169 +2.200 0.204 +2.200 0.209 +2.196 0.239 +2.190 0.274 +2.182 0.308 +2.173 0.343 +2.162 0.377 +2.159 0.386 +2.150 0.410 +2.137 0.442 +2.137 0.443 +2.122 0.475 +2.109 0.499 +2.106 0.509 +2.107 0.517 +2.111 0.524 +2.118 0.529 +2.126 0.531 +2.900 0.531 +2.900 -0.524 +2.002 -0.524 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_LIM09.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_LIM09.txt new file mode 100644 index 000000000..1ca6d8b71 --- /dev/null +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_LIM09.txt @@ -0,0 +1,13 @@ +#Name = LIM09 +#Exp = AUG +#CLs = PFC +9 0 +1.095 -0.760 +1.095 -0.680 +1.073 -0.680 +1.073 -0.705 +1.000 -0.705 +1.000 -0.725 +1.073 -0.725 +1.073 -0.760 +1.095 -0.760 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_PClow.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_PClow.txt new file mode 100644 index 000000000..4a2e75d53 --- /dev/null +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_PClow.txt @@ -0,0 +1,11 @@ +#Name = PClow +#Exp = AUG +#CLs = PFC +7 0 +1.877 -0.874 +1.877 -0.864 +2.075 -0.562 +2.158 -0.562 +2.158 -0.582 +1.966 -0.874 +1.877 -0.874 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_PCup.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_PCup.txt new file mode 100644 index 000000000..3f2b85d19 --- /dev/null +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_PCup.txt @@ -0,0 +1,11 @@ +#Name = PCup +#Exp = AUG +#CLs = PFC +7 0 +2.151 0.562 +1.966 0.865 +1.966 0.874 +2.054 0.874 +2.233 0.582 +2.233 0.562 +2.151 0.562 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_SBi.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_SBi.txt new file mode 100644 index 000000000..2717e6f9f --- /dev/null +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_SBi.txt @@ -0,0 +1,47 @@ +#Name = SBi +#Exp = AUG +#CLs = PFC +43 0 +1.100 -0.584 +1.085 -0.517 +1.072 -0.450 +1.060 -0.382 +1.051 -0.314 +1.043 -0.246 +1.037 -0.177 +1.033 -0.108 +1.031 -0.040 +1.031 0.029 +1.033 0.098 +1.037 0.166 +1.042 0.235 +1.049 0.303 +1.059 0.371 +1.070 0.439 +1.083 0.507 +1.098 0.574 +1.114 0.641 +1.133 0.707 +1.153 0.773 +1.164 0.769 +1.144 0.704 +1.126 0.638 +1.109 0.571 +1.095 0.504 +1.082 0.437 +1.071 0.370 +1.061 0.302 +1.054 0.234 +1.049 0.166 +1.045 0.097 +1.043 0.029 +1.043 -0.040 +1.045 -0.108 +1.049 -0.176 +1.055 -0.244 +1.063 -0.312 +1.072 -0.380 +1.083 -0.448 +1.097 -0.515 +1.112 -0.582 +1.100 -0.584 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT1.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT1.txt new file mode 100644 index 000000000..6769177f9 --- /dev/null +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT1.txt @@ -0,0 +1,22 @@ +#Name = TPLT1 +#Exp = AUG +#CLs = PFC +18 0 +1.500 1.185 +1.336 1.093 +1.335 1.093 +1.334 1.093 +1.320 1.103 +1.328 1.114 +1.322 1.119 +1.367 1.178 +1.407 1.178 +1.497 1.196 +1.499 1.196 +1.501 1.195 +1.502 1.194 +1.503 1.192 +1.503 1.190 +1.503 1.188 +1.502 1.186 +1.500 1.185 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT2.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT2.txt new file mode 100644 index 000000000..3b69ecb92 --- /dev/null +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT2.txt @@ -0,0 +1,17 @@ +#Name = TPLT2 +#Exp = AUG +#CLs = PFC +13 0 +1.331 1.087 +1.288 1.031 +1.287 1.030 +1.286 1.029 +1.284 1.029 +1.258 1.037 +1.312 1.108 +1.330 1.094 +1.331 1.093 +1.332 1.092 +1.332 1.090 +1.332 1.089 +1.331 1.087 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT3.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT3.txt new file mode 100644 index 000000000..57c417a0f --- /dev/null +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT3.txt @@ -0,0 +1,20 @@ +#Name = TPLT3 +#Exp = AUG +#CLs = PFC +16 0 +1.282 1.023 +1.242 0.969 +1.240 0.967 +1.239 0.966 +1.238 0.965 +1.236 0.965 +1.235 0.965 +1.234 0.965 +1.209 0.973 +1.257 1.036 +1.281 1.030 +1.282 1.029 +1.283 1.028 +1.283 1.026 +1.283 1.024 +1.282 1.023 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT4.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT4.txt new file mode 100644 index 000000000..a77058aa3 --- /dev/null +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT4.txt @@ -0,0 +1,32 @@ +#Name = TPLT4 +#Exp = AUG +#CLs = PFC +28 0 +1.237 0.958 +1.208 0.891 +1.207 0.891 +1.207 0.890 +1.206 0.890 +1.206 0.889 +1.205 0.889 +1.204 0.888 +1.204 0.888 +1.203 0.888 +1.202 0.888 +1.201 0.889 +1.200 0.889 +1.200 0.889 +1.166 0.915 +1.209 0.973 +1.234 0.965 +1.234 0.965 +1.235 0.965 +1.235 0.964 +1.236 0.964 +1.236 0.963 +1.237 0.962 +1.237 0.961 +1.237 0.961 +1.237 0.960 +1.237 0.959 +1.237 0.958 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT5.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT5.txt new file mode 100644 index 000000000..99a837fcc --- /dev/null +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT5.txt @@ -0,0 +1,36 @@ +#Name = TPLT5 +#Exp = AUG +#CLs = PFC +32 0 +1.203 0.881 +1.180 0.820 +1.179 0.818 +1.179 0.818 +1.178 0.816 +1.178 0.816 +1.167 0.802 +1.167 0.802 +1.166 0.801 +1.166 0.801 +1.165 0.800 +1.164 0.800 +1.163 0.800 +1.162 0.800 +1.161 0.800 +1.161 0.800 +1.160 0.801 +1.160 0.801 +1.119 0.832 +1.142 0.861 +1.131 0.869 +1.165 0.914 +1.201 0.886 +1.202 0.886 +1.202 0.886 +1.203 0.885 +1.203 0.884 +1.203 0.883 +1.203 0.882 +1.203 0.882 +1.203 0.881 +1.203 0.881 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_TPRT2.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_TPRT2.txt new file mode 100644 index 000000000..e4c317a4f --- /dev/null +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_TPRT2.txt @@ -0,0 +1,35 @@ +#Name = TPRT2 +#Exp = AUG +#CLs = PFC +31 0 +1.863 0.941 +1.775 1.071 +1.774 1.073 +1.774 1.075 +1.775 1.076 +1.776 1.078 +1.784 1.083 +1.801 1.076 +1.802 1.076 +1.802 1.075 +1.803 1.075 +1.804 1.075 +1.805 1.076 +1.806 1.076 +1.806 1.077 +1.807 1.077 +1.807 1.078 +1.808 1.078 +1.814 1.093 +1.839 1.083 +1.913 0.973 +1.914 0.972 +1.914 0.970 +1.913 0.968 +1.912 0.966 +1.870 0.939 +1.868 0.938 +1.866 0.938 +1.865 0.939 +1.863 0.941 +1.863 0.941 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_TPRT3.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_TPRT3.txt new file mode 100644 index 000000000..0b8274312 --- /dev/null +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_TPRT3.txt @@ -0,0 +1,19 @@ +#Name = TPRT3 +#Exp = AUG +#CLs = PFC +15 0 +1.796 1.082 +1.729 1.106 +1.727 1.107 +1.726 1.108 +1.725 1.109 +1.725 1.111 +1.726 1.112 +1.733 1.132 +1.809 1.105 +1.802 1.084 +1.801 1.083 +1.800 1.082 +1.799 1.081 +1.797 1.081 +1.796 1.082 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_TPRT4.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_TPRT4.txt new file mode 100644 index 000000000..fa10349c3 --- /dev/null +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_TPRT4.txt @@ -0,0 +1,17 @@ +#Name = TPRT4 +#Exp = AUG +#CLs = PFC +13 0 +1.718 1.109 +1.651 1.134 +1.650 1.135 +1.649 1.136 +1.648 1.138 +1.648 1.140 +1.656 1.160 +1.732 1.133 +1.725 1.112 +1.724 1.111 +1.722 1.110 +1.720 1.109 +1.718 1.109 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_TPRT5.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_TPRT5.txt new file mode 100644 index 000000000..9521a46f4 --- /dev/null +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_TPRT5.txt @@ -0,0 +1,23 @@ +#Name = TPRT5 +#Exp = AUG +#CLs = PFC +19 0 +1.644 1.137 +1.509 1.190 +1.508 1.191 +1.507 1.195 +1.506 1.195 +1.504 1.198 +1.501 1.200 +1.494 1.203 +1.493 1.204 +1.493 1.205 +1.493 1.206 +1.493 1.206 +1.501 1.217 +1.655 1.161 +1.646 1.138 +1.646 1.137 +1.645 1.137 +1.644 1.137 +1.644 1.137 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_VESiR.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_VESiR.txt new file mode 100644 index 000000000..1c9e26339 --- /dev/null +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_VESiR.txt @@ -0,0 +1,45 @@ +#Name = VESiR +#Exp = AUG +#CLs = PFC +41 0 +2.521 0.000 +2.506 0.210 +2.461 0.416 +2.387 0.613 +2.286 0.798 +2.159 0.966 +2.010 1.114 +1.841 1.240 +1.841 1.240 +1.705 1.303 +1.558 1.329 +1.409 1.315 +1.269 1.264 +1.147 1.177 +1.052 1.062 +0.990 0.927 +0.965 0.779 +0.965 0.779 +0.957 0.519 +0.953 0.260 +0.951 0.000 +0.953 -0.260 +0.957 -0.519 +0.965 -0.779 +0.965 -0.779 +0.990 -0.927 +1.052 -1.062 +1.147 -1.177 +1.269 -1.264 +1.409 -1.315 +1.558 -1.329 +1.705 -1.303 +1.841 -1.240 +1.841 -1.240 +2.010 -1.114 +2.159 -0.966 +2.286 -0.798 +2.387 -0.613 +2.461 -0.416 +2.506 -0.210 +2.521 0.000 diff --git a/tofu/version.py b/tofu/version.py index 814916362..ef8f6fc15 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.2-alpha2-50-g1bd7a6df' +__version__ = '1.4.2-alpha2-51-g67d988bb' From 0e006f99d6d0486b705f7b47e2eb7309370ca8a0 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Fri, 17 Jan 2020 11:14:15 +0100 Subject: [PATCH 138/168] [Issue281] More robust strategy for input polygons with double points in Struct._checkformat_dgeom() and cleaner error handling in tf.geom._comp._Struct_set_Poly() --- tofu/geom/_comp.py | 5 +++-- tofu/geom/_core.py | 10 +++++++--- tofu/version.py | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/tofu/geom/_comp.py b/tofu/geom/_comp.py index 8ddef84bf..a822fcf1a 100644 --- a/tofu/geom/_comp.py +++ b/tofu/geom/_comp.py @@ -62,8 +62,9 @@ def _Struct_set_Poly( Vol, BaryV = None, None else: Vol, BaryV = _GG.Poly_VolAngTor(Poly) - msg = "Pb. with volume computation for Ves object of type 'Tor' !" - assert Vol > 0.0, msg + if Vol <= 0.0: + msg = "Pb. with volume computation for Ves object of type 'Tor' !" + raise Exception(msg) # Compute the non-normalized vector of each side of the Poly Vect = np.diff(Poly, n=1, axis=1) diff --git a/tofu/geom/_core.py b/tofu/geom/_core.py index 123c9fd49..957fae60c 100644 --- a/tofu/geom/_core.py +++ b/tofu/geom/_core.py @@ -436,19 +436,23 @@ def _checkformat_inputs_dgeom( Poly = Poly.T # Elimininate any double identical point - ind = np.sum(np.diff(Poly, axis=1) ** 2, axis=0) < 1.0e-12 + ind = np.sum(np.diff(np.concatenate((Poly, Poly[:, 0:1]), axis=1), + axis=1) ** 2, axis=0) < 1.0e-12 if np.any(ind): npts = Poly.shape[1] + Poly = Poly[:, ~ind] msg = ( "%s instance: double identical points in Poly\n" % cls.__name__ ) msg += " => %s points removed\n" % ind.sum() msg += " => Poly goes from %s to %s points" % ( npts, - npts - ind.sum(), + Poly.shape[1], ) warnings.warn(msg) - Poly = Poly[:, ~ind] + ind = np.sum(np.diff(np.concatenate((Poly, Poly[:, 0:1]), axis=1), + axis=1) ** 2, axis=0) < 1.0e-12 + assert not np.any(ind), ind lC = [Lim is None, pos is None] if not any(lC): diff --git a/tofu/version.py b/tofu/version.py index ef8f6fc15..23253d16e 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.2-alpha2-51-g67d988bb' +__version__ = '1.4.2-alpha2-52-g8cf3812b' From 6d60c2590564fc197e886e90dd04dea10e5e073c Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Fri, 17 Jan 2020 11:18:17 +0100 Subject: [PATCH 139/168] [Issue281] Moving reference AUG diaggeom coords file to tofu/geom/inputs for archive --- .../geom/inputs/AUG_vessel_20200116.coords | 0 tofu/version.py | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename AUG_vessel_20200116.coords => tofu/geom/inputs/AUG_vessel_20200116.coords (100%) diff --git a/AUG_vessel_20200116.coords b/tofu/geom/inputs/AUG_vessel_20200116.coords similarity index 100% rename from AUG_vessel_20200116.coords rename to tofu/geom/inputs/AUG_vessel_20200116.coords diff --git a/tofu/version.py b/tofu/version.py index 097a74e3e..d24d810bd 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.2-alpha2-53-g0e006f99' +__version__ = '1.4.2-a5-97-gae6a650a' From 03dfe39a8a8b5e59c703315023963470b75817b1 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Fri, 17 Jan 2020 13:02:54 +0100 Subject: [PATCH 140/168] [Issue281] Corrected all double points in AUG txt files, still 3 Struct not valid due to bug in _GG.Poly_isClockwise() inducing error on Vol in _GG.Poly_Order(), probably solved by lasofivec on another branch --- tofu/geom/inputs/TFG_PFC_ExpAUG_D2cTPi.txt | 4 +--- tofu/geom/inputs/TFG_PFC_ExpAUG_D2cTPib.txt | 13 +------------ tofu/geom/inputs/TFG_PFC_ExpAUG_D2cTPic.txt | 4 +--- tofu/geom/inputs/TFG_PFC_ExpAUG_D2cdomL.txt | 3 +-- tofu/geom/inputs/TFG_PFC_ExpAUG_D2cdomR.txt | 4 +--- tofu/geom/inputs/TFG_PFC_ExpAUG_D2cdome.txt | 3 +-- tofu/geom/inputs/TFG_PFC_ExpAUG_D2ci1.txt | 3 +-- tofu/geom/inputs/TFG_PFC_ExpAUG_D2ci2.txt | 3 +-- tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBG2.txt | 3 +-- tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBl1.txt | 3 +-- tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBl3.txt | 4 +--- tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBu1.txt | 15 +-------------- tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBu2.txt | 4 +--- tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBu3.txt | 3 +-- tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBu4.txt | 3 +-- tofu/geom/inputs/TFG_PFC_ExpAUG_D3BG1.txt | 3 +-- tofu/geom/inputs/TFG_PFC_ExpAUG_D3BG10.txt | 3 +-- tofu/geom/inputs/TFG_PFC_ExpAUG_ICRHa.txt | 3 +-- tofu/geom/inputs/TFG_PFC_ExpAUG_LIM09.txt | 3 +-- tofu/geom/inputs/TFG_PFC_ExpAUG_PClow.txt | 3 +-- tofu/geom/inputs/TFG_PFC_ExpAUG_PCup.txt | 3 +-- tofu/geom/inputs/TFG_PFC_ExpAUG_SBi.txt | 3 +-- tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT1.txt | 3 +-- tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT2.txt | 3 +-- tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT3.txt | 3 +-- tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT4.txt | 7 +------ tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT5.txt | 12 +----------- tofu/geom/inputs/TFG_PFC_ExpAUG_TPRT2.txt | 4 +--- tofu/geom/inputs/TFG_PFC_ExpAUG_TPRT3.txt | 3 +-- tofu/geom/inputs/TFG_PFC_ExpAUG_TPRT4.txt | 3 +-- tofu/geom/inputs/TFG_PFC_ExpAUG_TPRT5.txt | 5 +---- ..._ExpAUG_VESiR.txt => TFG_Ves_ExpAUG_VESiR.txt} | 9 ++------- tofu/version.py | 2 +- 33 files changed, 34 insertions(+), 113 deletions(-) rename tofu/geom/inputs/{TFG_PFC_ExpAUG_VESiR.txt => TFG_Ves_ExpAUG_VESiR.txt} (85%) diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2cTPi.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2cTPi.txt index 6cb901060..d7bcf6375 100644 --- a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2cTPi.txt +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2cTPi.txt @@ -1,7 +1,7 @@ #Name = D2cTPi #Exp = AUG #CLs = PFC -20 0 +18 0 1.281 -0.981 1.282 -0.983 1.283 -0.985 @@ -12,7 +12,6 @@ 1.234 -1.125 1.233 -1.125 1.232 -1.125 -1.232 -1.125 1.231 -1.125 1.230 -1.125 1.217 -1.138 @@ -21,4 +20,3 @@ 1.265 -0.986 1.267 -0.980 1.278 -0.980 -1.281 -0.981 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2cTPib.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2cTPib.txt index 842645219..2c45ce9a0 100644 --- a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2cTPib.txt +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2cTPib.txt @@ -1,12 +1,9 @@ #Name = D2cTPib #Exp = AUG #CLs = PFC -34 0 +23 0 1.249 -0.826 1.250 -0.827 -1.250 -0.827 -1.250 -0.827 -1.250 -0.827 1.259 -0.842 1.266 -0.858 1.273 -0.873 @@ -19,7 +16,6 @@ 1.287 -0.975 1.287 -0.976 1.286 -0.977 -1.286 -0.977 1.285 -0.978 1.284 -0.978 1.283 -0.979 @@ -27,12 +23,5 @@ 1.226 -0.979 1.226 -0.825 1.246 -0.825 -1.246 -0.825 -1.247 -0.825 1.247 -0.825 1.248 -0.826 -1.248 -0.826 -1.248 -0.826 -1.249 -0.826 -1.249 -0.826 -1.249 -0.826 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2cTPic.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2cTPic.txt index 0dd5d87b1..c1e21e7e8 100644 --- a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2cTPic.txt +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2cTPic.txt @@ -1,12 +1,11 @@ #Name = D2cTPic #Exp = AUG #CLs = PFC -14 0 +12 0 1.232 -1.125 1.233 -1.126 1.234 -1.128 1.244 -1.142 -1.244 -1.142 1.244 -1.143 1.244 -1.144 1.243 -1.144 @@ -15,4 +14,3 @@ 1.230 -1.126 1.230 -1.125 1.231 -1.125 -1.232 -1.125 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2cdomL.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2cdomL.txt index 70677dff9..c01783987 100644 --- a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2cdomL.txt +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2cdomL.txt @@ -1,7 +1,7 @@ #Name = D2cdomL #Exp = AUG #CLs = PFC -15 0 +14 0 1.280 -1.123 1.280 -1.102 1.280 -1.100 @@ -16,4 +16,3 @@ 1.286 -1.133 1.281 -1.126 1.281 -1.125 -1.280 -1.123 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2cdomR.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2cdomR.txt index efe931d1c..cce4a8d58 100644 --- a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2cdomR.txt +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2cdomR.txt @@ -1,11 +1,10 @@ #Name = D2CdomR #Exp = AUG #CLs = PFC -16 0 +14 0 1.487 -1.093 1.554 -1.173 1.555 -1.175 -1.555 -1.175 1.555 -1.176 1.555 -1.184 1.555 -1.186 @@ -17,4 +16,3 @@ 1.475 -1.091 1.483 -1.091 1.485 -1.092 -1.487 -1.093 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2cdome.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2cdome.txt index 9ce921cc9..e0637a611 100644 --- a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2cdome.txt +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2cdome.txt @@ -1,7 +1,7 @@ #Name = D2cdome #Exp = AUG #CLs = PFC -15 0 +14 0 1.320 -1.066 1.322 -1.064 1.326 -1.062 @@ -16,4 +16,3 @@ 1.337 -1.090 1.320 -1.068 1.319 -1.067 -1.320 -1.066 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2ci1.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2ci1.txt index f33fea4ba..e1f486f9d 100644 --- a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2ci1.txt +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2ci1.txt @@ -1,7 +1,7 @@ #Name = D2ci1 #Exp = AUG #CLs = PFC -13 0 +12 0 1.138 -0.658 1.141 -0.659 1.143 -0.660 @@ -14,4 +14,3 @@ 1.165 -0.744 1.117 -0.669 1.136 -0.658 -1.138 -0.658 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2ci2.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2ci2.txt index edbdbf163..127e85d3e 100644 --- a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2ci2.txt +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2ci2.txt @@ -1,7 +1,7 @@ #Name = D2ci2 #Exp = AUG #CLs = PFC -11 0 +10 0 1.187 -0.730 1.188 -0.730 1.189 -0.730 @@ -12,4 +12,3 @@ 1.216 -0.824 1.165 -0.744 1.186 -0.730 -1.187 -0.730 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBG2.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBG2.txt index 16e1023b9..aa384395e 100644 --- a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBG2.txt +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBG2.txt @@ -1,7 +1,7 @@ #Name = D2dBG2 #Exp = AUG #CLs = PFC -29 0 +28 0 1.636 -0.997 1.636 -0.995 1.638 -0.986 @@ -30,4 +30,3 @@ 1.725 -0.875 1.671 -0.998 1.638 -0.998 -1.636 -0.997 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBl1.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBl1.txt index 993b43bb9..2c35f270d 100644 --- a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBl1.txt +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBl1.txt @@ -1,7 +1,7 @@ #Name = D2dBl1 #Exp = AUG #CLs = PFC -14 0 +13 0 2.011 -0.560 2.011 -0.559 2.018 -0.548 @@ -15,4 +15,3 @@ 2.013 -0.562 2.012 -0.562 2.011 -0.561 -2.011 -0.560 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBl3.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBl3.txt index 7d34fdbdc..1fe40f1b5 100644 --- a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBl3.txt +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBl3.txt @@ -1,14 +1,13 @@ #Name = D2dBl3 #Exp = AUG #CLs = PFC -15 0 +13 0 1.752 -0.826 1.753 -0.826 1.875 -0.686 1.876 -0.686 1.878 -0.685 1.879 -0.686 -1.879 -0.686 1.939 -0.725 1.901 -0.783 1.870 -0.762 @@ -16,4 +15,3 @@ 1.772 -0.842 1.771 -0.841 1.770 -0.839 -1.752 -0.826 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBu1.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBu1.txt index 6535b1cb9..bc98c85f1 100644 --- a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBu1.txt +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBu1.txt @@ -1,28 +1,18 @@ #Name = D2dBu1 #Exp = AUG #CLs = PFC -35 0 +22 0 1.905 0.868 1.904 0.868 -1.904 0.869 -1.903 0.869 1.903 0.869 1.897 0.880 1.896 0.881 -1.896 0.881 -1.896 0.881 1.897 0.882 -1.897 0.882 -1.897 0.882 -1.897 0.883 -1.897 0.883 1.897 0.883 1.897 0.884 1.875 0.921 1.875 0.922 1.875 0.923 -1.875 0.923 -1.875 0.924 1.875 0.924 1.924 0.952 1.925 0.953 @@ -34,6 +24,3 @@ 2.022 0.894 1.949 0.894 1.906 0.869 -1.905 0.868 -1.905 0.868 -1.905 0.868 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBu2.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBu2.txt index fd60ed1c4..45fe01d38 100644 --- a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBu2.txt +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBu2.txt @@ -1,7 +1,7 @@ #Name = D2dBu2 #Exp = AUG #CLs = PFC -13 0 +11 0 2.002 0.708 1.905 0.866 1.918 0.874 @@ -13,5 +13,3 @@ 1.996 0.783 2.010 0.792 2.045 0.734 -2.002 0.708 -2.002 0.708 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBu3.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBu3.txt index aaf35f1f2..1f97f6fcc 100644 --- a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBu3.txt +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBu3.txt @@ -1,7 +1,7 @@ #Name = D2dBu3 #Exp = AUG #CLs = PFC -12 0 +11 0 2.101 0.547 2.003 0.707 2.046 0.734 @@ -13,4 +13,3 @@ 2.059 0.646 2.061 0.640 2.118 0.547 -2.101 0.547 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBu4.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBu4.txt index 0c998d3fd..0dc2a3905 100644 --- a/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBu4.txt +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_D2dBu4.txt @@ -1,7 +1,7 @@ #Name = D2dBu4 #Exp = AUG #CLs = PFC -9 0 +8 0 2.121 0.547 2.113 0.559 2.113 0.560 @@ -10,4 +10,3 @@ 2.115 0.562 2.228 0.562 2.228 0.547 -2.121 0.547 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_D3BG1.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_D3BG1.txt index 83af9b109..940a5f5f0 100644 --- a/tofu/geom/inputs/TFG_PFC_ExpAUG_D3BG1.txt +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_D3BG1.txt @@ -1,7 +1,7 @@ #Name = D3BG1 #Exp = AUG #CLs = PFC -21 0 +20 0 1.579 -1.208 1.635 -0.999 1.639 -0.999 @@ -22,4 +22,3 @@ 1.586 -1.209 1.585 -1.208 1.584 -1.208 -1.579 -1.208 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_D3BG10.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_D3BG10.txt index a6d39db7e..5c1ef9ea5 100644 --- a/tofu/geom/inputs/TFG_PFC_ExpAUG_D3BG10.txt +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_D3BG10.txt @@ -1,7 +1,7 @@ #Name = D3BG10 #Exp = AUG #CLs = PFC -20 0 +19 0 1.554 -1.218 1.555 -1.216 1.556 -1.214 @@ -21,4 +21,3 @@ 1.555 -1.222 1.554 -1.222 1.554 -1.220 -1.554 -1.218 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_ICRHa.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_ICRHa.txt index 4a5d33a02..27b84c96d 100644 --- a/tofu/geom/inputs/TFG_PFC_ExpAUG_ICRHa.txt +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_ICRHa.txt @@ -1,7 +1,7 @@ #Name = ICRHa #Exp = AUG #CLs = PFC -62 0 +61 0 2.002 -0.524 1.997 -0.523 1.994 -0.520 @@ -63,4 +63,3 @@ 2.126 0.531 2.900 0.531 2.900 -0.524 -2.002 -0.524 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_LIM09.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_LIM09.txt index 1ca6d8b71..9d721bd98 100644 --- a/tofu/geom/inputs/TFG_PFC_ExpAUG_LIM09.txt +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_LIM09.txt @@ -1,7 +1,7 @@ #Name = LIM09 #Exp = AUG #CLs = PFC -9 0 +8 0 1.095 -0.760 1.095 -0.680 1.073 -0.680 @@ -10,4 +10,3 @@ 1.000 -0.725 1.073 -0.725 1.073 -0.760 -1.095 -0.760 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_PClow.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_PClow.txt index 4a2e75d53..b68e9f31f 100644 --- a/tofu/geom/inputs/TFG_PFC_ExpAUG_PClow.txt +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_PClow.txt @@ -1,11 +1,10 @@ #Name = PClow #Exp = AUG #CLs = PFC -7 0 +6 0 1.877 -0.874 1.877 -0.864 2.075 -0.562 2.158 -0.562 2.158 -0.582 1.966 -0.874 -1.877 -0.874 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_PCup.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_PCup.txt index 3f2b85d19..5d1739a13 100644 --- a/tofu/geom/inputs/TFG_PFC_ExpAUG_PCup.txt +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_PCup.txt @@ -1,11 +1,10 @@ #Name = PCup #Exp = AUG #CLs = PFC -7 0 +6 0 2.151 0.562 1.966 0.865 1.966 0.874 2.054 0.874 2.233 0.582 2.233 0.562 -2.151 0.562 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_SBi.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_SBi.txt index 2717e6f9f..e589b22a5 100644 --- a/tofu/geom/inputs/TFG_PFC_ExpAUG_SBi.txt +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_SBi.txt @@ -1,7 +1,7 @@ #Name = SBi #Exp = AUG #CLs = PFC -43 0 +42 0 1.100 -0.584 1.085 -0.517 1.072 -0.450 @@ -44,4 +44,3 @@ 1.083 -0.448 1.097 -0.515 1.112 -0.582 -1.100 -0.584 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT1.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT1.txt index 6769177f9..a4043bd4f 100644 --- a/tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT1.txt +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT1.txt @@ -1,7 +1,7 @@ #Name = TPLT1 #Exp = AUG #CLs = PFC -18 0 +17 0 1.500 1.185 1.336 1.093 1.335 1.093 @@ -19,4 +19,3 @@ 1.503 1.190 1.503 1.188 1.502 1.186 -1.500 1.185 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT2.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT2.txt index 3b69ecb92..984b2ab57 100644 --- a/tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT2.txt +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT2.txt @@ -1,7 +1,7 @@ #Name = TPLT2 #Exp = AUG #CLs = PFC -13 0 +12 0 1.331 1.087 1.288 1.031 1.287 1.030 @@ -14,4 +14,3 @@ 1.332 1.092 1.332 1.090 1.332 1.089 -1.331 1.087 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT3.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT3.txt index 57c417a0f..bf32069a5 100644 --- a/tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT3.txt +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT3.txt @@ -1,7 +1,7 @@ #Name = TPLT3 #Exp = AUG #CLs = PFC -16 0 +15 0 1.282 1.023 1.242 0.969 1.240 0.967 @@ -17,4 +17,3 @@ 1.283 1.028 1.283 1.026 1.283 1.024 -1.282 1.023 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT4.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT4.txt index a77058aa3..311c8f465 100644 --- a/tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT4.txt +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT4.txt @@ -1,7 +1,7 @@ #Name = TPLT4 #Exp = AUG #CLs = PFC -28 0 +23 0 1.237 0.958 1.208 0.891 1.207 0.891 @@ -10,23 +10,18 @@ 1.206 0.889 1.205 0.889 1.204 0.888 -1.204 0.888 1.203 0.888 1.202 0.888 1.201 0.889 1.200 0.889 -1.200 0.889 1.166 0.915 1.209 0.973 1.234 0.965 -1.234 0.965 1.235 0.965 1.235 0.964 1.236 0.964 1.236 0.963 1.237 0.962 1.237 0.961 -1.237 0.961 1.237 0.960 1.237 0.959 -1.237 0.958 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT5.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT5.txt index 99a837fcc..d6429e985 100644 --- a/tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT5.txt +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_TPLT5.txt @@ -1,24 +1,18 @@ #Name = TPLT5 #Exp = AUG #CLs = PFC -32 0 +22 0 1.203 0.881 1.180 0.820 1.179 0.818 -1.179 0.818 -1.178 0.816 1.178 0.816 1.167 0.802 -1.167 0.802 -1.166 0.801 1.166 0.801 1.165 0.800 1.164 0.800 1.163 0.800 1.162 0.800 1.161 0.800 -1.161 0.800 -1.160 0.801 1.160 0.801 1.119 0.832 1.142 0.861 @@ -26,11 +20,7 @@ 1.165 0.914 1.201 0.886 1.202 0.886 -1.202 0.886 1.203 0.885 1.203 0.884 1.203 0.883 1.203 0.882 -1.203 0.882 -1.203 0.881 -1.203 0.881 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_TPRT2.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_TPRT2.txt index e4c317a4f..5b5f14f58 100644 --- a/tofu/geom/inputs/TFG_PFC_ExpAUG_TPRT2.txt +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_TPRT2.txt @@ -1,7 +1,7 @@ #Name = TPRT2 #Exp = AUG #CLs = PFC -31 0 +29 0 1.863 0.941 1.775 1.071 1.774 1.073 @@ -31,5 +31,3 @@ 1.868 0.938 1.866 0.938 1.865 0.939 -1.863 0.941 -1.863 0.941 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_TPRT3.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_TPRT3.txt index 0b8274312..c7dfe9d19 100644 --- a/tofu/geom/inputs/TFG_PFC_ExpAUG_TPRT3.txt +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_TPRT3.txt @@ -1,7 +1,7 @@ #Name = TPRT3 #Exp = AUG #CLs = PFC -15 0 +14 0 1.796 1.082 1.729 1.106 1.727 1.107 @@ -16,4 +16,3 @@ 1.800 1.082 1.799 1.081 1.797 1.081 -1.796 1.082 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_TPRT4.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_TPRT4.txt index fa10349c3..c077d5ef8 100644 --- a/tofu/geom/inputs/TFG_PFC_ExpAUG_TPRT4.txt +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_TPRT4.txt @@ -1,7 +1,7 @@ #Name = TPRT4 #Exp = AUG #CLs = PFC -13 0 +12 0 1.718 1.109 1.651 1.134 1.650 1.135 @@ -14,4 +14,3 @@ 1.724 1.111 1.722 1.110 1.720 1.109 -1.718 1.109 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_TPRT5.txt b/tofu/geom/inputs/TFG_PFC_ExpAUG_TPRT5.txt index 9521a46f4..20df8a9ed 100644 --- a/tofu/geom/inputs/TFG_PFC_ExpAUG_TPRT5.txt +++ b/tofu/geom/inputs/TFG_PFC_ExpAUG_TPRT5.txt @@ -1,7 +1,7 @@ #Name = TPRT5 #Exp = AUG #CLs = PFC -19 0 +16 0 1.644 1.137 1.509 1.190 1.508 1.191 @@ -13,11 +13,8 @@ 1.493 1.204 1.493 1.205 1.493 1.206 -1.493 1.206 1.501 1.217 1.655 1.161 1.646 1.138 1.646 1.137 1.645 1.137 -1.644 1.137 -1.644 1.137 diff --git a/tofu/geom/inputs/TFG_PFC_ExpAUG_VESiR.txt b/tofu/geom/inputs/TFG_Ves_ExpAUG_VESiR.txt similarity index 85% rename from tofu/geom/inputs/TFG_PFC_ExpAUG_VESiR.txt rename to tofu/geom/inputs/TFG_Ves_ExpAUG_VESiR.txt index 1c9e26339..cb8ca007d 100644 --- a/tofu/geom/inputs/TFG_PFC_ExpAUG_VESiR.txt +++ b/tofu/geom/inputs/TFG_Ves_ExpAUG_VESiR.txt @@ -1,7 +1,7 @@ #Name = VESiR #Exp = AUG -#CLs = PFC -41 0 +#CLs = Ves +36 0 2.521 0.000 2.506 0.210 2.461 0.416 @@ -10,7 +10,6 @@ 2.159 0.966 2.010 1.114 1.841 1.240 -1.841 1.240 1.705 1.303 1.558 1.329 1.409 1.315 @@ -19,14 +18,12 @@ 1.052 1.062 0.990 0.927 0.965 0.779 -0.965 0.779 0.957 0.519 0.953 0.260 0.951 0.000 0.953 -0.260 0.957 -0.519 0.965 -0.779 -0.965 -0.779 0.990 -0.927 1.052 -1.062 1.147 -1.177 @@ -35,11 +32,9 @@ 1.558 -1.329 1.705 -1.303 1.841 -1.240 -1.841 -1.240 2.010 -1.114 2.159 -0.966 2.286 -0.798 2.387 -0.613 2.461 -0.416 2.506 -0.210 -2.521 0.000 diff --git a/tofu/version.py b/tofu/version.py index d24d810bd..ee309c828 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.2-a5-97-gae6a650a' +__version__ = '1.4.2-a5-98-g6d60c259' From 483793267d7b1b1a748c054e8ba1e8044cb22412 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Fri, 17 Jan 2020 13:28:38 +0100 Subject: [PATCH 141/168] [Issue281] Added 'AUG-V1' and shortcut 'AUG' to predefined config, but 3 txt files still not loaded due to bug in _GG. tf.geom.utils.create_Config() more robust vs Struct that can't be loaded (warnings not fatal) --- tofu/geom/utils.py | 47 ++++++++++++++++++++++++++++++++++++---------- tofu/version.py | 2 +- 2 files changed, 38 insertions(+), 11 deletions(-) diff --git a/tofu/geom/utils.py b/tofu/geom/utils.py index 8bc170ea5..67c8cdc2d 100644 --- a/tofu/geom/utils.py +++ b/tofu/geom/utils.py @@ -642,6 +642,7 @@ def _compute_CamLOS2D_pinhole(P=None, F=0.1, D12=0.1, N12=100, _ExpWest = 'WEST' _ExpJET = 'JET' _ExpITER = 'ITER' +_ExpAUG = 'AUG' _ExpNSTX = 'NSTX' # Dictionnary of unique config names @@ -676,6 +677,16 @@ def _compute_CamLOS2D_pinhole(P=None, F=0.1, D12=0.1, N12=100, 'BLK16', 'BLK17', 'BLK18', 'Div1', 'Div2', 'Div3', 'Div4', 'Div5', 'Div6']}, + 'AUG-V1': {'Exp': _ExpAUG, + 'Ves': ['VESiR'], + 'PFC': ['D2cdome', 'D2cdomL', 'D2cdomR', 'D2ci1', + 'D2ci2', 'D2cTPib', 'D2cTPic', 'D2cTPi', + 'D2dBG2', 'D2dBl1', 'D2dBl2', 'D2dBl3', + 'D2dBu1', 'D2dBu2', 'D2dBu3', 'D2dBu4', + 'D3BG10', 'D3BG1', 'ICRHa', 'LIM09', 'PClow', + 'PCup', 'SBi', 'TPLT1', 'TPLT2', 'TPLT3', + 'TPLT4', 'TPLT5', 'TPRT2', 'TPRT3', 'TPRT4', + 'TPRT5']}, 'NSTX-V0': {'Exp': _ExpNSTX, 'Ves': ['V0']} } @@ -693,6 +704,7 @@ def _compute_CamLOS2D_pinhole(P=None, F=0.1, D12=0.1, N12=100, 'B2': 'WEST-V3', 'B3': 'WEST-V4', 'B4': 'ITER-V2', + 'AUG': 'AUG-V1', 'NSTX': 'NSTX-V0'} # Default config @@ -739,20 +751,35 @@ def _create_config_testcase(config=None, returnas='object', for cc in lcls: for ss in dconfig[config][cc]: ff = [f for f in lf - if all([s in f for s in [cc,Exp,ss]])] - if not len(ff) == 1: - msg = "No / several matching files\n" + if all([s in f for s in [cc, Exp, ss]])] + if len(ff) == 0: + msg = "No matching files\n" msg += " Folder: %s\n"%path msg += " Criteria: [%s, %s]\n"%(cc,ss) msg += " Matching: "+"\n ".join(ff) raise Exception(msg) - pfe = os.path.join(path,ff[0]) - obj = eval('_core.'+cc).from_txt(pfe, Name=ss, Type='Tor', - Exp=dconfig[config]['Exp'], - out=returnas) - if returnas not in ['object', object]: - obj = ((ss,{'Poly':obj[0], 'pos':obj[1], 'extent':obj[2]}),) - lS.append(obj) + elif len(ff) > 1: + # More demanding criterion + ssbis, Expbis = '_'+ss+'.txt', '_Exp'+Exp+'_' + ff = [fff for fff in ff if ssbis in fff and Expbis in fff] + if len(ff) != 1: + msg = "No / several matching files\n" + msg += " Folder: %s\n"%path + msg += " Criteria: [%s, %s]\n"%(cc,ss) + msg += " Matching: "+"\n ".join(ff) + raise Exception(msg) + + pfe = os.path.join(path, ff[0]) + try: + obj = eval('_core.'+cc).from_txt(pfe, Name=ss, Type='Tor', + Exp=dconfig[config]['Exp'], + out=returnas) + if returnas not in ['object', object]: + obj = ((ss,{'Poly':obj[0], 'pos':obj[1], 'extent':obj[2]}),) + lS.append(obj) + except Exception as err: + msg = "Could not be loaded: {}".format(ff[0]) + warnings.warn(msg) if returnas == 'dict': conf = dict([tt for tt in lS]) else: diff --git a/tofu/version.py b/tofu/version.py index ee309c828..e1ff23f43 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.2-a5-98-g6d60c259' +__version__ = '1.4.2-a5-99-g03dfe39a' From ef8ffa10567a59c5e7b01bbe0aceb36a2e2175cd Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Fri, 17 Jan 2020 15:51:42 +0100 Subject: [PATCH 142/168] [Issue301] Rename _DCONFIG_TABLE -> _DCONFIG_SHORTCUTS --- tofu/geom/utils.py | 40 ++++++++++++++++++++-------------------- tofu/version.py | 2 +- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/tofu/geom/utils.py b/tofu/geom/utils.py index 230530c42..60e8ed5f5 100644 --- a/tofu/geom/utils.py +++ b/tofu/geom/utils.py @@ -688,23 +688,23 @@ def _compute_CamLOS2D_pinhole(P=None, F=0.1, D12=0.1, N12=100, # Each config can be called by various names (for benchmark and # retro-compatibility), this table stores the available names for each unique # config in _DCONFIG -_DCONFIG_TABLE = {'ITER': 'ITER-V2', - 'JET': 'JET-V0', - 'WEST': 'WEST-V4', - 'A1': 'WEST-V1', - 'A2': 'ITER-V1', - 'A3': 'WEST-Sep', - 'B1': 'WEST-V2', - 'B2': 'WEST-V3', - 'B3': 'WEST-V4', - 'B4': 'ITER-V2', - 'NSTX': 'NSTX-V0'} - - -def _get_listconfig(dconfig=_DCONFIG, dconfig_table=_DCONFIG_TABLE, +_DCONFIG_SHORTCUTS = {'ITER': 'ITER-V2', + 'JET': 'JET-V0', + 'WEST': 'WEST-V4', + 'A1': 'WEST-V1', + 'A2': 'ITER-V1', + 'A3': 'WEST-Sep', + 'B1': 'WEST-V2', + 'B2': 'WEST-V3', + 'B3': 'WEST-V4', + 'B4': 'ITER-V2', + 'NSTX': 'NSTX-V0'} + + +def _get_listconfig(dconfig=_DCONFIG, dconfig_shortcuts=_DCONFIG_SHORTCUTS, returnas=str): assert returnas in [dict, str] - dc = {k0: [k0] + sorted([k1 for k1, v1 in dconfig_table.items() + dc = {k0: [k0] + sorted([k1 for k1, v1 in dconfig_shortcuts.items() if v1 == k0]) for k0 in sorted(dconfig.keys())} if returnas is dict: @@ -720,14 +720,14 @@ def _get_listconfig(dconfig=_DCONFIG, dconfig_table=_DCONFIG_TABLE, return msg -def get_available_config(dconfig=_DCONFIG, dconfig_table=_DCONFIG_TABLE, +def get_available_config(dconfig=_DCONFIG, dconfig_shortcuts=_DCONFIG_SHORTCUTS, verb=True, returnas=False): msg = ("A config is the geometry of a tokamak\n" + "You can define your own" + " (see online tutorial at {})\n".format(_URL_TUTO) + "tofu also also provides some pre-defined config ready to load\n" + "They are available via their name or via shortcuts\n" - + _get_listconfig(dconfig=dconfig, dconfig_table=dconfig_table) + + _get_listconfig(dconfig=dconfig, dconfig_shortcuts=dconfig_shortcuts) + "\n\n => to get a pre-defined config, call for example:\n" + "\tconfig = tf.geom.utils.create_config('ITER')") if verb is True: @@ -738,7 +738,7 @@ def get_available_config(dconfig=_DCONFIG, dconfig_table=_DCONFIG_TABLE, def _create_config_testcase(config=None, returnas='object', path=_path_testcases, dconfig=_DCONFIG, - dconfig_table=_DCONFIG_TABLE): + dconfig_shortcuts=_DCONFIG_SHORTCUTS): """ Load the desired test case configuration Choose from one of the reference preset configurations: @@ -756,9 +756,9 @@ def _create_config_testcase(config=None, returnas='object', if config in dconfig.keys(): pass - elif config in dconfig_table.keys(): + elif config in dconfig_shortcuts.keys(): # Get corresponding config - config = dconfig_table[config] + config = dconfig_shortcuts[config] else: msg = ("\nThe provided config name is not valid.\n" diff --git a/tofu/version.py b/tofu/version.py index 6b5f1dfa5..85be830a1 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.2-a5-66-g995809ff' +__version__ = '1.4.2-a5-67-g11c10608' From 2b90034c6e5f0508b85ceb24ffef3a8884849edf Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Fri, 17 Jan 2020 16:01:12 +0100 Subject: [PATCH 143/168] [Issue301] Added comments (for dev) and docstr to new method, also included new method in tf.geom.utils.__all__ --- tofu/geom/utils.py | 27 +++++++++++++++++++++++---- tofu/version.py | 2 +- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/tofu/geom/utils.py b/tofu/geom/utils.py index 60e8ed5f5..606d7584c 100644 --- a/tofu/geom/utils.py +++ b/tofu/geom/utils.py @@ -20,7 +20,7 @@ __all__ = ['coords_transform', 'get_nIne1e2', 'get_X12fromflat', 'compute_RaysCones', - 'create_config', + 'get_available_config', 'create_config', 'create_CamLOS1D', 'create_CamLOS2D'] @@ -650,6 +650,9 @@ def _compute_CamLOS2D_pinhole(P=None, F=0.1, D12=0.1, N12=100, + 'tuto_plot_create_geometry.html') # Dictionnary of unique config names +# For each config, indicates which structural elements it comprises +# Elements are sorted by class (Ves, PFC...) +# For each element, a unique txt file containing the geometry will be loaded _DCONFIG = {'WEST-V1': {'Exp': _ExpWest, 'Ves': ['V1']}, 'ITER-V1': {'Exp': _ExpITER, @@ -685,9 +688,9 @@ def _compute_CamLOS2D_pinhole(P=None, F=0.1, D12=0.1, N12=100, 'Ves': ['V0']} } -# Each config can be called by various names (for benchmark and -# retro-compatibility), this table stores the available names for each unique -# config in _DCONFIG +# Each config can be called by various names / shortcuts (for benchmark and +# retro-compatibility), this table stores, for each shortcut, +# the associated unique name it refers to _DCONFIG_SHORTCUTS = {'ITER': 'ITER-V2', 'JET': 'JET-V0', 'WEST': 'WEST-V4', @@ -703,6 +706,7 @@ def _compute_CamLOS2D_pinhole(P=None, F=0.1, D12=0.1, N12=100, def _get_listconfig(dconfig=_DCONFIG, dconfig_shortcuts=_DCONFIG_SHORTCUTS, returnas=str): + """ Hidden function generating the config names table as a str or dict """ assert returnas in [dict, str] dc = {k0: [k0] + sorted([k1 for k1, v1 in dconfig_shortcuts.items() if v1 == k0]) @@ -722,6 +726,21 @@ def _get_listconfig(dconfig=_DCONFIG, dconfig_shortcuts=_DCONFIG_SHORTCUTS, def get_available_config(dconfig=_DCONFIG, dconfig_shortcuts=_DCONFIG_SHORTCUTS, verb=True, returnas=False): + """ Print a table showing all pre-defined config + + Each pre-defined config in tofu can be called by its unique name or + by a series of shortcuts / alterantive names refereing to the same unique + name. this feature is useful for retro-compatibility and for making sure a + standard name always refers to the latest (most detailed) available version + of the geometry. + + Can also return the table as str + + No input arg needed: + >>> import tofu as tf + >>> tf.geom.utils.get_available_config() + + """ msg = ("A config is the geometry of a tokamak\n" + "You can define your own" + " (see online tutorial at {})\n".format(_URL_TUTO) diff --git a/tofu/version.py b/tofu/version.py index 85be830a1..291248db8 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.2-a5-67-g11c10608' +__version__ = '1.4.2-a5-68-gef8ffa10' From f7444b9a50944e9861e2f5a168d086925401fa39 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Fri, 17 Jan 2020 16:05:32 +0100 Subject: [PATCH 144/168] [Issue301] Better formatted msg (url on its onw line) --- tofu/geom/utils.py | 2 +- tofu/version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tofu/geom/utils.py b/tofu/geom/utils.py index 606d7584c..318ff4617 100644 --- a/tofu/geom/utils.py +++ b/tofu/geom/utils.py @@ -743,7 +743,7 @@ def get_available_config(dconfig=_DCONFIG, dconfig_shortcuts=_DCONFIG_SHORTCUTS, """ msg = ("A config is the geometry of a tokamak\n" + "You can define your own" - + " (see online tutorial at {})\n".format(_URL_TUTO) + + ", see online tutorial at:\n\t{}\n".format(_URL_TUTO) + "tofu also also provides some pre-defined config ready to load\n" + "They are available via their name or via shortcuts\n" + _get_listconfig(dconfig=dconfig, dconfig_shortcuts=dconfig_shortcuts) diff --git a/tofu/version.py b/tofu/version.py index 291248db8..d00696688 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.2-a5-68-gef8ffa10' +__version__ = '1.4.2-a5-69-g2b90034c' From 56f30784a56c03a8532b898a2c55e0e2c6920b6f Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Fri, 17 Jan 2020 16:14:10 +0100 Subject: [PATCH 145/168] [Issue301] PEP8 compliance --- tofu/geom/utils.py | 6 ++++-- tofu/version.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tofu/geom/utils.py b/tofu/geom/utils.py index 318ff4617..af1a8af64 100644 --- a/tofu/geom/utils.py +++ b/tofu/geom/utils.py @@ -724,7 +724,8 @@ def _get_listconfig(dconfig=_DCONFIG, dconfig_shortcuts=_DCONFIG_SHORTCUTS, return msg -def get_available_config(dconfig=_DCONFIG, dconfig_shortcuts=_DCONFIG_SHORTCUTS, +def get_available_config(dconfig=_DCONFIG, + dconfig_shortcuts=_DCONFIG_SHORTCUTS, verb=True, returnas=False): """ Print a table showing all pre-defined config @@ -746,7 +747,8 @@ def get_available_config(dconfig=_DCONFIG, dconfig_shortcuts=_DCONFIG_SHORTCUTS, + ", see online tutorial at:\n\t{}\n".format(_URL_TUTO) + "tofu also also provides some pre-defined config ready to load\n" + "They are available via their name or via shortcuts\n" - + _get_listconfig(dconfig=dconfig, dconfig_shortcuts=dconfig_shortcuts) + + _get_listconfig(dconfig=dconfig, + dconfig_shortcuts=dconfig_shortcuts) + "\n\n => to get a pre-defined config, call for example:\n" + "\tconfig = tf.geom.utils.create_config('ITER')") if verb is True: diff --git a/tofu/version.py b/tofu/version.py index d00696688..0b0c8df8e 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.2-a5-69-g2b90034c' +__version__ = '1.4.2-a5-70-gf7444b9a' From 7a3aca15417e765d80f51e1585a46ebd124ca7d2 Mon Sep 17 00:00:00 2001 From: Didier Date: Fri, 17 Jan 2020 16:45:49 +0100 Subject: [PATCH 146/168] None and True options for returnas are also handled in get_available_config() (default to str) --- tofu/geom/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tofu/geom/utils.py b/tofu/geom/utils.py index af1a8af64..0c16c0c31 100644 --- a/tofu/geom/utils.py +++ b/tofu/geom/utils.py @@ -753,7 +753,7 @@ def get_available_config(dconfig=_DCONFIG, + "\tconfig = tf.geom.utils.create_config('ITER')") if verb is True: print(msg) - if returnas is str: + if returnas in [None, True, str]: return msg From 08eeb453ca2b7c7bae84c1f944df2dc2934514cd Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Mon, 20 Jan 2020 16:20:32 +0100 Subject: [PATCH 147/168] added bdsit wheel --- .travis.yml | 11 +++++++++++ tofu/version.py | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 15fc60fea..e2d79beb2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -86,5 +86,16 @@ deploy: tags: true branch: deploy-test server: https://test.pypi.org/legacy/ + password: + secure: xfVFuoz9YYNChzmT8DC9y+8eH6zdFkfoy3B51uqy8b+vhJNzCzLay4F0uSHvhHy6iYorM6UQKr6soC4D7n3PhmnFOTX/cgLtd/p4gBWGYZF6yXacvw+UHKMshgbAhn2sEynxdSAqdAlNttMI8jsUu9RhbzGiv1l5zSNnFWF4Zsly02G68UnztxIGoz8AYTRW2N2oQhGrl/ryj/YG4mSRKjled6BzK7kNoJUqLGl12DqdMMTEmdJ9NHBXgK3Dv0ya17ReFz3TcxE/4+Yc38NwSR4Ia2EvVSMtyIaccQ1uSrXwW8JQOMn+9CmDWZVUMDD2bzKYbm2WGGM9Fh8WrHnwlWRujoLDofhYEK0Cus11gULFF+J88XucOJlyJNrHP6TWxdSVVoQfwWr2ABqZIvilsvHpF+sjDLqomTNHdi+BbzP2koRv0nJb9K1W24bjPLtSK8+plX7suv7gdBNwlsJ+dPLDM87v4+jGHGthQ6P4X2guTMHZm1PU0PSPB9LCbENCN1uktLLhkgx7gZ42Ag+Jwiu02ENkChLaEB4WpPb9mjLnomu5LDYXFGtPJ/uLMOi3VCXyda0LrzqDhXYT3Cg4hvXySwJcgMYSXalfTxnTm9oouePiEXDbK+XwjMP9mjC5CeMg3SaFFTywqaTH0WUqiOBUJ6H3Gsm0sB15Tj4lNKQ= + - provider: pypi + distributions: "bdist_wheel" + user: __token__ + skip_existing: true + on: + condition: $OS = osx-64 + tags: true + branch: deploy-test + server: https://test.pypi.org/legacy/ password: secure: xfVFuoz9YYNChzmT8DC9y+8eH6zdFkfoy3B51uqy8b+vhJNzCzLay4F0uSHvhHy6iYorM6UQKr6soC4D7n3PhmnFOTX/cgLtd/p4gBWGYZF6yXacvw+UHKMshgbAhn2sEynxdSAqdAlNttMI8jsUu9RhbzGiv1l5zSNnFWF4Zsly02G68UnztxIGoz8AYTRW2N2oQhGrl/ryj/YG4mSRKjled6BzK7kNoJUqLGl12DqdMMTEmdJ9NHBXgK3Dv0ya17ReFz3TcxE/4+Yc38NwSR4Ia2EvVSMtyIaccQ1uSrXwW8JQOMn+9CmDWZVUMDD2bzKYbm2WGGM9Fh8WrHnwlWRujoLDofhYEK0Cus11gULFF+J88XucOJlyJNrHP6TWxdSVVoQfwWr2ABqZIvilsvHpF+sjDLqomTNHdi+BbzP2koRv0nJb9K1W24bjPLtSK8+plX7suv7gdBNwlsJ+dPLDM87v4+jGHGthQ6P4X2guTMHZm1PU0PSPB9LCbENCN1uktLLhkgx7gZ42Ag+Jwiu02ENkChLaEB4WpPb9mjLnomu5LDYXFGtPJ/uLMOi3VCXyda0LrzqDhXYT3Cg4hvXySwJcgMYSXalfTxnTm9oouePiEXDbK+XwjMP9mjC5CeMg3SaFFTywqaTH0WUqiOBUJ6H3Gsm0sB15Tj4lNKQ= \ No newline at end of file diff --git a/tofu/version.py b/tofu/version.py index 9f60b917a..d8fdd4f65 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.2b13' +__version__ = '1.4.2b13-1-g41587772' From c8e02cae8dfd6db542c23ff3c99f8b87e4922014 Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Mon, 20 Jan 2020 16:22:48 +0100 Subject: [PATCH 148/168] new version --- tofu/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tofu/version.py b/tofu/version.py index d8fdd4f65..456d2b381 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.2b13-1-g41587772' +__version__ = '1.4.2b14' From 5da95ce440f3cef601871f46af7dd9077685e9e6 Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Mon, 20 Jan 2020 16:36:19 +0100 Subject: [PATCH 149/168] corrected travis file --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index e2d79beb2..7a8f1dcc5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -88,8 +88,8 @@ deploy: server: https://test.pypi.org/legacy/ password: secure: xfVFuoz9YYNChzmT8DC9y+8eH6zdFkfoy3B51uqy8b+vhJNzCzLay4F0uSHvhHy6iYorM6UQKr6soC4D7n3PhmnFOTX/cgLtd/p4gBWGYZF6yXacvw+UHKMshgbAhn2sEynxdSAqdAlNttMI8jsUu9RhbzGiv1l5zSNnFWF4Zsly02G68UnztxIGoz8AYTRW2N2oQhGrl/ryj/YG4mSRKjled6BzK7kNoJUqLGl12DqdMMTEmdJ9NHBXgK3Dv0ya17ReFz3TcxE/4+Yc38NwSR4Ia2EvVSMtyIaccQ1uSrXwW8JQOMn+9CmDWZVUMDD2bzKYbm2WGGM9Fh8WrHnwlWRujoLDofhYEK0Cus11gULFF+J88XucOJlyJNrHP6TWxdSVVoQfwWr2ABqZIvilsvHpF+sjDLqomTNHdi+BbzP2koRv0nJb9K1W24bjPLtSK8+plX7suv7gdBNwlsJ+dPLDM87v4+jGHGthQ6P4X2guTMHZm1PU0PSPB9LCbENCN1uktLLhkgx7gZ42Ag+Jwiu02ENkChLaEB4WpPb9mjLnomu5LDYXFGtPJ/uLMOi3VCXyda0LrzqDhXYT3Cg4hvXySwJcgMYSXalfTxnTm9oouePiEXDbK+XwjMP9mjC5CeMg3SaFFTywqaTH0WUqiOBUJ6H3Gsm0sB15Tj4lNKQ= - - provider: pypi - distributions: "bdist_wheel" + - provider: pypi + distributions: bdist_wheel user: __token__ skip_existing: true on: @@ -98,4 +98,4 @@ deploy: branch: deploy-test server: https://test.pypi.org/legacy/ password: - secure: xfVFuoz9YYNChzmT8DC9y+8eH6zdFkfoy3B51uqy8b+vhJNzCzLay4F0uSHvhHy6iYorM6UQKr6soC4D7n3PhmnFOTX/cgLtd/p4gBWGYZF6yXacvw+UHKMshgbAhn2sEynxdSAqdAlNttMI8jsUu9RhbzGiv1l5zSNnFWF4Zsly02G68UnztxIGoz8AYTRW2N2oQhGrl/ryj/YG4mSRKjled6BzK7kNoJUqLGl12DqdMMTEmdJ9NHBXgK3Dv0ya17ReFz3TcxE/4+Yc38NwSR4Ia2EvVSMtyIaccQ1uSrXwW8JQOMn+9CmDWZVUMDD2bzKYbm2WGGM9Fh8WrHnwlWRujoLDofhYEK0Cus11gULFF+J88XucOJlyJNrHP6TWxdSVVoQfwWr2ABqZIvilsvHpF+sjDLqomTNHdi+BbzP2koRv0nJb9K1W24bjPLtSK8+plX7suv7gdBNwlsJ+dPLDM87v4+jGHGthQ6P4X2guTMHZm1PU0PSPB9LCbENCN1uktLLhkgx7gZ42Ag+Jwiu02ENkChLaEB4WpPb9mjLnomu5LDYXFGtPJ/uLMOi3VCXyda0LrzqDhXYT3Cg4hvXySwJcgMYSXalfTxnTm9oouePiEXDbK+XwjMP9mjC5CeMg3SaFFTywqaTH0WUqiOBUJ6H3Gsm0sB15Tj4lNKQ= \ No newline at end of file + secure: xfVFuoz9YYNChzmT8DC9y+8eH6zdFkfoy3B51uqy8b+vhJNzCzLay4F0uSHvhHy6iYorM6UQKr6soC4D7n3PhmnFOTX/cgLtd/p4gBWGYZF6yXacvw+UHKMshgbAhn2sEynxdSAqdAlNttMI8jsUu9RhbzGiv1l5zSNnFWF4Zsly02G68UnztxIGoz8AYTRW2N2oQhGrl/ryj/YG4mSRKjled6BzK7kNoJUqLGl12DqdMMTEmdJ9NHBXgK3Dv0ya17ReFz3TcxE/4+Yc38NwSR4Ia2EvVSMtyIaccQ1uSrXwW8JQOMn+9CmDWZVUMDD2bzKYbm2WGGM9Fh8WrHnwlWRujoLDofhYEK0Cus11gULFF+J88XucOJlyJNrHP6TWxdSVVoQfwWr2ABqZIvilsvHpF+sjDLqomTNHdi+BbzP2koRv0nJb9K1W24bjPLtSK8+plX7suv7gdBNwlsJ+dPLDM87v4+jGHGthQ6P4X2guTMHZm1PU0PSPB9LCbENCN1uktLLhkgx7gZ42Ag+Jwiu02ENkChLaEB4WpPb9mjLnomu5LDYXFGtPJ/uLMOi3VCXyda0LrzqDhXYT3Cg4hvXySwJcgMYSXalfTxnTm9oouePiEXDbK+XwjMP9mjC5CeMg3SaFFTywqaTH0WUqiOBUJ6H3Gsm0sB15Tj4lNKQ= From 810ec8cb8283487bca44b17ec7b8259040786d1d Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Mon, 20 Jan 2020 16:37:46 +0100 Subject: [PATCH 150/168] new version --- tofu/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tofu/version.py b/tofu/version.py index 456d2b381..4ca07c85d 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.2b14' +__version__ = '1.4.2b15' From 61c6165d6decf6d8ca783fef08ae4c2482875d60 Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Mon, 20 Jan 2020 17:28:19 +0100 Subject: [PATCH 151/168] all deployments done --- .travis.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.travis.yml b/.travis.yml index 7a8f1dcc5..1221ac507 100644 --- a/.travis.yml +++ b/.travis.yml @@ -99,3 +99,22 @@ deploy: server: https://test.pypi.org/legacy/ password: secure: xfVFuoz9YYNChzmT8DC9y+8eH6zdFkfoy3B51uqy8b+vhJNzCzLay4F0uSHvhHy6iYorM6UQKr6soC4D7n3PhmnFOTX/cgLtd/p4gBWGYZF6yXacvw+UHKMshgbAhn2sEynxdSAqdAlNttMI8jsUu9RhbzGiv1l5zSNnFWF4Zsly02G68UnztxIGoz8AYTRW2N2oQhGrl/ryj/YG4mSRKjled6BzK7kNoJUqLGl12DqdMMTEmdJ9NHBXgK3Dv0ya17ReFz3TcxE/4+Yc38NwSR4Ia2EvVSMtyIaccQ1uSrXwW8JQOMn+9CmDWZVUMDD2bzKYbm2WGGM9Fh8WrHnwlWRujoLDofhYEK0Cus11gULFF+J88XucOJlyJNrHP6TWxdSVVoQfwWr2ABqZIvilsvHpF+sjDLqomTNHdi+BbzP2koRv0nJb9K1W24bjPLtSK8+plX7suv7gdBNwlsJ+dPLDM87v4+jGHGthQ6P4X2guTMHZm1PU0PSPB9LCbENCN1uktLLhkgx7gZ42Ag+Jwiu02ENkChLaEB4WpPb9mjLnomu5LDYXFGtPJ/uLMOi3VCXyda0LrzqDhXYT3Cg4hvXySwJcgMYSXalfTxnTm9oouePiEXDbK+XwjMP9mjC5CeMg3SaFFTywqaTH0WUqiOBUJ6H3Gsm0sB15Tj4lNKQ= + - provider: pypi + distributions: sdist + user: "Didou09" + skip_existing: true + on: + tags: true + branch: master + password: + secure: JNEDTDJVx/2fXNfHntNQ99iDRNuQ4uB3y+DBWVIBycCT95+UCb36YPtKzmruEk/UUS29Xgq4IYCGdfCSWE9smKqG8tV1PcHiw705m+AzcpKy77YtzbVECFBxqY4W36O2pHrkwEUzP/7acjFwNsnUFzArqEzsBJ+KdLaa4OPHJXCh30GA0GyqlrXYbBKG+DA9hX5vtsGo4C6w9noALYF3fS7pKPiI6ipKFnAlzGgHQ7Ke0uQME8N3IAFhmh+Z5xMtIIDWxlnqv+KszdG4DIaGV/W6NIJNAbRhzkqUd+Chu6LoPAd/XkHDTeirR/MBkNUc5UcRJxRnP9rUTRo1gCO/buTYuNRgFkMvqhV5a033+x9edWgtUiKNJIMPLXOxe0RJvc5GWji+Co77HtHxRmGRM2rnYqWMtZeYZlFbUdvHu/8jf0d6I8jyUgAoJYdlMA2u/ipENP3S6by4epE9qycUPXiIVh6r3DZbf3vPTMFvTZYAjBrA0NOzihv1xgcXwemmNUFOQSpe0io4UcFxtS9lLMo+30UMQjCHSnbEVM3zSlZmbMOKpkVOlKlt8Lz5NxwVgWtu9FuW2pGukLtE8AWbqvY9urXAPZCQqZlOIklIjJQIqOITnuw9LEV09cgvPHXfdvNni3ldbMlIQ89zryM6dYvhYryTiEZGK4JDR3wAKJA= + - provider: pypi + distributions: bdist_wheel + user: "Didou09" + skip_existing: true + on: + condition: $OS = osx-64 + tags: true + branch: master + password: + secure: JNEDTDJVx/2fXNfHntNQ99iDRNuQ4uB3y+DBWVIBycCT95+UCb36YPtKzmruEk/UUS29Xgq4IYCGdfCSWE9smKqG8tV1PcHiw705m+AzcpKy77YtzbVECFBxqY4W36O2pHrkwEUzP/7acjFwNsnUFzArqEzsBJ+KdLaa4OPHJXCh30GA0GyqlrXYbBKG+DA9hX5vtsGo4C6w9noALYF3fS7pKPiI6ipKFnAlzGgHQ7Ke0uQME8N3IAFhmh+Z5xMtIIDWxlnqv+KszdG4DIaGV/W6NIJNAbRhzkqUd+Chu6LoPAd/XkHDTeirR/MBkNUc5UcRJxRnP9rUTRo1gCO/buTYuNRgFkMvqhV5a033+x9edWgtUiKNJIMPLXOxe0RJvc5GWji+Co77HtHxRmGRM2rnYqWMtZeYZlFbUdvHu/8jf0d6I8jyUgAoJYdlMA2u/ipENP3S6by4epE9qycUPXiIVh6r3DZbf3vPTMFvTZYAjBrA0NOzihv1xgcXwemmNUFOQSpe0io4UcFxtS9lLMo+30UMQjCHSnbEVM3zSlZmbMOKpkVOlKlt8Lz5NxwVgWtu9FuW2pGukLtE8AWbqvY9urXAPZCQqZlOIklIjJQIqOITnuw9LEV09cgvPHXfdvNni3ldbMlIQ89zryM6dYvhYryTiEZGK4JDR3wAKJA= From f6971f5d865891ce6184ef4a807f3e0ee1c7e4e4 Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Mon, 20 Jan 2020 17:31:15 +0100 Subject: [PATCH 152/168] new version --- tofu/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tofu/version.py b/tofu/version.py index 4ca07c85d..61a5c84d9 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.2b15' +__version__ = '1.4.2b16' From 5e47a9e7b7d3e9524ee97e5d18cd09c192dd3869 Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Tue, 21 Jan 2020 16:47:07 +0100 Subject: [PATCH 153/168] [deployment] added back anacaonda upload, black --- .travis.yml | 7 +++++++ _updateversion.py | 11 ++++++----- setup.py | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1221ac507..f512b11ba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -118,3 +118,10 @@ deploy: branch: master password: secure: JNEDTDJVx/2fXNfHntNQ99iDRNuQ4uB3y+DBWVIBycCT95+UCb36YPtKzmruEk/UUS29Xgq4IYCGdfCSWE9smKqG8tV1PcHiw705m+AzcpKy77YtzbVECFBxqY4W36O2pHrkwEUzP/7acjFwNsnUFzArqEzsBJ+KdLaa4OPHJXCh30GA0GyqlrXYbBKG+DA9hX5vtsGo4C6w9noALYF3fS7pKPiI6ipKFnAlzGgHQ7Ke0uQME8N3IAFhmh+Z5xMtIIDWxlnqv+KszdG4DIaGV/W6NIJNAbRhzkqUd+Chu6LoPAd/XkHDTeirR/MBkNUc5UcRJxRnP9rUTRo1gCO/buTYuNRgFkMvqhV5a033+x9edWgtUiKNJIMPLXOxe0RJvc5GWji+Co77HtHxRmGRM2rnYqWMtZeYZlFbUdvHu/8jf0d6I8jyUgAoJYdlMA2u/ipENP3S6by4epE9qycUPXiIVh6r3DZbf3vPTMFvTZYAjBrA0NOzihv1xgcXwemmNUFOQSpe0io4UcFxtS9lLMo+30UMQjCHSnbEVM3zSlZmbMOKpkVOlKlt8Lz5NxwVgWtu9FuW2pGukLtE8AWbqvY9urXAPZCQqZlOIklIjJQIqOITnuw9LEV09cgvPHXfdvNni3ldbMlIQ89zryM6dYvhYryTiEZGK4JDR3wAKJA= + - provider: script + user: "ToFuProject" + script: $START/anaconda_upload.sh + on: + tags: true + branch: master + skip_cleanup: true diff --git a/_updateversion.py b/_updateversion.py index 1dc1453a2..d948f779b 100644 --- a/_updateversion.py +++ b/_updateversion.py @@ -6,6 +6,7 @@ _HERE = os.path.abspath(os.path.dirname(__file__)) + def updateversion(path=_HERE): # Fetch version from git tags, and write to version.py # Also, when git is not available (PyPi package), use stored version.py @@ -13,13 +14,13 @@ def updateversion(path=_HERE): try: version_git = subprocess.check_output(["git", "describe"]).rstrip().decode() - except: - with open(version_py,'r') as fh: - version_git = fh.read().strip().split("=")[-1].replace("'",'') - version_git = version_git.lower().replace('v','').replace(' ','') + except subprocess.CalledProcessError: + with open(version_py, 'r') as fh: + version_git = fh.read().strip().split("=")[-1].replace("'", '') + version_git = version_git.lower().replace('v', '').replace(' ', '') version_msg = "# Do not edit, pipeline versioning governed by git tags!" - with open(version_py,"w") as fh: + with open(version_py, "w") as fh: msg = "{0}__version__ = '{1}'{0}".format(os.linesep, version_git) fh.write(version_msg + msg) return version_git diff --git a/setup.py b/setup.py index e8dd8796e..443fdd0f2 100644 --- a/setup.py +++ b/setup.py @@ -156,7 +156,7 @@ def updateversion(path=_HERE): try: version_git = subprocess.check_output(["git", "describe"]).rstrip().decode() - except Exception: + except subprocess.CalledProcessError: with open(version_py, 'r') as fh: version_git = fh.read().strip().split("=")[-1].replace("'", '') version_git = version_git.lower().replace('v', '') From 5cbbf7ccd8d6b45d8a40b820079c26a5f4e88987 Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Tue, 21 Jan 2020 17:29:56 +0100 Subject: [PATCH 154/168] [doc] updated gallery tuto: bf #329 --- .../tutorials/tuto_plot_gallery_fusion_machines.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/tutorials/tuto_plot_gallery_fusion_machines.py b/examples/tutorials/tuto_plot_gallery_fusion_machines.py index 20fbfab7b..4dcbd73fb 100644 --- a/examples/tutorials/tuto_plot_gallery_fusion_machines.py +++ b/examples/tutorials/tuto_plot_gallery_fusion_machines.py @@ -15,20 +15,20 @@ # `tofu` provides a geometry helper function that allows creating a # configuration with a single call. # -# Calling with empty arguments results in a default configuration. At the time -# of writing, this is ITER. -# By printing the `config` object, a text representation of its components is -# printed. This allows inspecting -# component names, number of sections, color or visibility. +# Some configurations are pre-defined, for example ITER's configuration. +# +# By printing the `config` object created, a text representation of its +# components is printed. This allows inspecting the component names, number +# of sections, color or visibility. -config = tf.geom.utils.create_config() # create default configuration +config = tf.geom.utils.create_config("ITER") # create ITER configuration print(config) ############################################################################### # To get a list of all available built-in configs, one has to know some details # about `tofu`. Configurations can be accessed by names (ITER, WEST, JET, etc). -print(tf.geom.utils._DCONFIG_TABLE.keys()) +print(tf.geom.utils.get_available_config()) ############################################################################### # With that being said, let's create a gallery of the "top 3" fusion machines From ebd494b5949c16d562eccfda7dd9c4d439aecfe5 Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Tue, 21 Jan 2020 20:37:55 +0100 Subject: [PATCH 155/168] [bf #331] raising exceptions when poly ill defined --- tofu/geom/_GG.pyx | 36 +++++++++++++++++++---------- tofu/geom/_basic_geom_tools.pxd | 1 + tofu/geom/_basic_geom_tools.pyx | 2 ++ tofu/geom/_comp.py | 9 +++++--- tofu/geom/_core.py | 40 +++++++++++++++++++-------------- 5 files changed, 56 insertions(+), 32 deletions(-) diff --git a/tofu/geom/_GG.pyx b/tofu/geom/_GG.pyx index 24dbd4dc2..26e5baeb8 100644 --- a/tofu/geom/_GG.pyx +++ b/tofu/geom/_GG.pyx @@ -188,16 +188,14 @@ def CoordShift(Pts, In='(X,Y,Z)', Out='(R,Z)', CrossRef=None): def Poly_isClockwise(np.ndarray[double,ndim=2] Poly): """ Assuming 2D closed Poly ! - TODO @LM : http://www.faqs.org/faqs/graphics/algorithms-faq/ - A slightly faster method is based on the observation that it isn't - necessary to compute the area. Find the lowest vertex (or, if - there is more than one vertex with the same lowest coordinate, - the rightmost of those vertices) and then take the cross product - of the edges fore and aft of it. Both methods are O(n) for n vertices, - but it does seem a waste to add up the total area when a single cross - product (of just the right edges) suffices. Code for this is - available at ftp://cs.smith.edu/pub/code/polyorient.C (2K). + Find the lowest vertex (or, if there is more than one vertex with + the same lowest coordinate, the rightmost of those vertices) and then + take the cross product of the edges before and after it. + Both methods are O(n) for n vertices, but it does seem a waste to add up + the total area when a single cross product (of just the right edges) + suffices. Code for this is available at + ftp://cs.smith.edu/pub/code/polyorient.C (2K). """ cdef double res cdef double[:,::1] mv_poly = np.ascontiguousarray(Poly) @@ -206,12 +204,23 @@ def Poly_isClockwise(np.ndarray[double,ndim=2] Poly): cdef double[::1] mvy = mv_poly[1,:] cdef int idmin = _bgt.find_ind_lowerright_corner(mvx, mvy, npts) cdef int idm1 = idmin - 1 - cdef int idp1 = (idmin + 1)%npts + cdef int idp1 = (idmin + 1) % npts + cdef str err_msg = "" if idmin == 0 : idm1 = npts - 1 res = mvx[idm1] * (mvy[idmin] - mvy[idp1]) + \ mvx[idmin] * (mvy[idp1] - mvy[idm1]) + \ mvx[idp1] * (mvy[idm1] - mvy[idmin]) + if abs(res) < _VSMALL: + err_msg += ("In Poly_isClockwise : \n" + + " Found lowest right point at index : " + + str(idmin) + + ", of coordinates :" + str(mvx[idmin]) + + ", " + str(mvy[idmin]) + ".\n" + + " The two neighboring points are : " + + str(idm1) + " and " + str(idp1) + ".") + print(err_msg) + raise Exception(err_msg) # not working return res < 0. @@ -274,8 +283,11 @@ def Poly_Order(np.ndarray[double,ndim=2] Poly, str order='C', Clock=False, if not np.allclose(poly[:,0],poly[:,-1], atol=_VSMALL): poly = np.concatenate((poly,poly[:,0:1]),axis=1) if poly.shape[0]==2 and not Clock is None: - if not Clock==Poly_isClockwise(poly): - poly = poly[:,::-1] + try: + if not Clock==Poly_isClockwise(poly): + poly = poly[:,::-1] + except Exception as excp: + raise excp if not close: poly = poly[:,:-1] if layout.lower()=='(n,cc)': diff --git a/tofu/geom/_basic_geom_tools.pxd b/tofu/geom/_basic_geom_tools.pxd index 99c5bb054..d61936605 100644 --- a/tofu/geom/_basic_geom_tools.pxd +++ b/tofu/geom/_basic_geom_tools.pxd @@ -1,6 +1,7 @@ # cython: boundscheck=False # cython: wraparound=False # cython: cdivision=True +# cython: initializedcheck=False # ################################################################################ # Utility functions for basic geometry : diff --git a/tofu/geom/_basic_geom_tools.pyx b/tofu/geom/_basic_geom_tools.pyx index edcb4f502..ba99e1dce 100644 --- a/tofu/geom/_basic_geom_tools.pyx +++ b/tofu/geom/_basic_geom_tools.pyx @@ -1,6 +1,8 @@ # cython: boundscheck=False # cython: wraparound=False # cython: cdivision=True +# cython: initializedcheck=False +# cimport cython from cython.parallel import prange diff --git a/tofu/geom/_comp.py b/tofu/geom/_comp.py index 5725d26ae..a00cb020d 100644 --- a/tofu/geom/_comp.py +++ b/tofu/geom/_comp.py @@ -34,9 +34,12 @@ def _Struct_set_Poly( """ Compute geometrical attributes of a Struct object """ # Make Poly closed, counter-clockwise, with '(cc,N)' layout and arrayorder - Poly = _GG.Poly_Order( - Poly, order="C", Clock=False, close=True, layout="(cc,N)", Test=True - ) + try: + Poly = _GG.Poly_Order( + Poly, order="C", Clock=False, close=True, layout="(cc,N)", Test=True + ) + except Exception as excp: + print(excp) assert Poly.shape[0] == 2, "Arg Poly must be a 2D polygon !" fPfmt = np.ascontiguousarray if arrayorder == "C" else np.asfortranarray diff --git a/tofu/geom/_core.py b/tofu/geom/_core.py index 4bacd3755..fc4c2c8bf 100644 --- a/tofu/geom/_core.py +++ b/tofu/geom/_core.py @@ -2203,8 +2203,8 @@ def _get_largs_dsino(): def _checkformat_inputs_Struct(self, struct, err=True): assert issubclass(struct.__class__, Struct) - C0 = struct.Id.Exp==self.Id.Exp - C1 = struct.Id.Type==self.Id.Type + C0 = struct.Id.Exp == self.Id.Exp + C1 = struct.Id.Type == self.Id.Type C2 = struct.Id.Name.isidentifier() C2 = C2 and '_' not in struct.Id.Name msgi = None @@ -3134,7 +3134,6 @@ def plot_phithetaproj_dist(self, refpt=None, ntheta=None, nphi=None, tit=tit, wintit=wintit, invertx=invertx, draw=draw) - def isInside(self, pts, In="(X,Y,Z)", log="any"): """ Return a 2D array of bool @@ -3728,7 +3727,7 @@ def _checkformat_inputs_dgeom(self, dgeom=None): if (isinstance(dgeom, self._dcases[k]['type']) and all([kk in dgeom.keys() # noqa for kk in self._dcases[k]['lk']]))] - if not len(lC)==1: + if not len(lC) == 1: lstr = [v['lk'] for v in self._dcases.values()] msg = "Arg dgeom must be either:\n" msg += " - dict with keys:\n" @@ -4141,7 +4140,8 @@ def _complete_dX12(self, dgeom): k = np.sum(DDb*(u - np.sqrt(sca2)*dgeom['u'][:, 1:]), axis=0) k = k / (1.0-sca2) - if k[0] > 0 and np.allclose(k, k[0], atol=1.e-3, rtol=1.e-6): + if k[0] > 0 and np.allclose(k, k[0], atol=1.e-3, + rtol=1.e-6): pinhole = dgeom['D'][:, 0] + k[0]*u[:, 0] dgeom['pinhole'] = pinhole @@ -5033,8 +5033,8 @@ def D(self): @property def u(self): - if (self._dgeom['u'] is not None - and self._dgeom['u'].shape[1] == self._dgeom['nRays']): + if self._dgeom['u'] is not None \ + and self._dgeom['u'].shape[1] == self._dgeom['nRays']: u = self._dgeom['u'] elif self.isPinhole: u = self._dgeom['pinhole'][:, None] - self._dgeom['D'] @@ -5127,7 +5127,7 @@ def _isLOS(cls): def _check_indch(self, ind, out=int): if ind is not None: ind = np.asarray(ind) - assert ind.ndim==1 + assert ind.ndim == 1 assert ind.dtype in [np.int64, np.bool_, np.long] if ind.dtype == np.bool_: assert ind.size == self.nRays @@ -5574,17 +5574,17 @@ def _kInOut_Isoflux_inputs_usr(self, lPoly, lVIn=None): if type(lPoly) is list: for ii in range(nPoly): # Check closed and anti-clockwise - if _GG.Poly_isClockwise(lPoly[ii]): - lPoly[ii] = lPoly[ii][:, ::-1] if not np.allclose(lPoly[ii][:, 0], lPoly[ii][:, -1]): lPoly[ii] = np.concatenate( (lPoly[ii], lPoly[ii][:, 0:1]), axis=-1 ) + try: + if _GG.Poly_isClockwise(lPoly[ii]): + lPoly[ii] = lPoly[ii][:, ::-1] + except Exception as excp: + print("For structure ", ii, " : ", excp) else: - for ii in range(nPoly): - # Check closed and anti-clockwise - if _GG.Poly_isClockwise(lPoly[ii]): - lPoly[ii] = lPoly[ii][:, ::-1] + # Check closed and anti-clockwise d = np.sum((lPoly[:, :, 0]-lPoly[:, :, -1])**2, axis=1) if np.allclose(d, 0.): pass @@ -5593,6 +5593,12 @@ def _kInOut_Isoflux_inputs_usr(self, lPoly, lVIn=None): else: msg = "All poly in lPoly should be closed or all non-closed!" raise Exception(msg) + for ii in range(nPoly): + try: + if _GG.Poly_isClockwise(lPoly[ii]): + lPoly[ii] = lPoly[ii][:, ::-1] + except Exception as excp: + print("For structure ", ii, " : ", excp) # Check lVIn if lVIn is None: @@ -5663,14 +5669,14 @@ def calc_kInkOut_Isoflux(self, lPoly, lVIn=None, Lim=None, # Compute intersections assert(self._method in ['ref', 'optimized']) - if self._method=='ref': + if self._method == 'ref': for ii in range(0, nPoly): largs, dkwd = self._kInOut_Isoflux_inputs([lPoly[ii]], lVIn=[lVIn[ii]]) out = _GG.SLOW_LOS_Calc_PInOut_VesStruct(*largs, **dkwd) # PIn, POut, kin, kout, VperpIn, vperp, IIn, indout = out[] kIn[ii, :], kOut[ii, :] = out[2], out[3] - elif self._method=="optimized": + elif self._method == "optimized": for ii in range(0, nPoly): largs, dkwd = self._kInOut_Isoflux_inputs([lPoly[ii]], lVIn=[lVIn[ii]]) @@ -6900,7 +6906,7 @@ def get_summary( # Prepare kout = self._dgeom["kOut"] indout = self._dgeom["indout"] - lS = self._dconfig["Config"].lStruct + # lS = self._dconfig["Config"].lStruct angles = np.arccos(-np.sum(self.u*self.dgeom['vperp'], axis=0)) # ar0 From a0f432bb0c53b33a591c1db6be62df7a689d3d9a Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Tue, 21 Jan 2020 20:45:31 +0100 Subject: [PATCH 156/168] [bf #331] black changes --- tofu/geom/_comp.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tofu/geom/_comp.py b/tofu/geom/_comp.py index a00cb020d..667aac2ae 100644 --- a/tofu/geom/_comp.py +++ b/tofu/geom/_comp.py @@ -35,9 +35,8 @@ def _Struct_set_Poly( # Make Poly closed, counter-clockwise, with '(cc,N)' layout and arrayorder try: - Poly = _GG.Poly_Order( - Poly, order="C", Clock=False, close=True, layout="(cc,N)", Test=True - ) + Poly = _GG.Poly_Order(Poly, order="C", Clock=False, close=True, + layout="(cc,N)", Test=True) except Exception as excp: print(excp) assert Poly.shape[0] == 2, "Arg Poly must be a 2D polygon !" From 9b83143d97bcf1c3af960d4c5b7cd4853655d9d4 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Wed, 22 Jan 2020 11:29:35 +0100 Subject: [PATCH 157/168] [Issue281_fork] Sligtly more explicit error message --- tofu/geom/_comp.py | 7 +++++-- tofu/version.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tofu/geom/_comp.py b/tofu/geom/_comp.py index 667aac2ae..a138d34d4 100644 --- a/tofu/geom/_comp.py +++ b/tofu/geom/_comp.py @@ -64,8 +64,11 @@ def _Struct_set_Poly( else: Vol, BaryV = _GG.Poly_VolAngTor(Poly) if Vol <= 0.0: - msg = "Pb. with volume computation for Ves object of type 'Tor' !" - msg = "\n Here Volume = " + str(Vol) + msg = ("Pb. with volume computation for Struct of type 'Tor' !\n" + + "\t- Vol = {}\n".format(Vol) + + "\t- Poly = {}\n\n".format(str(Poly)) + + " => Probably corrupted polygon\n" + + " => Please check polygon is not self-intersecting") raise Exception(msg) # Compute the non-normalized vector of each side of the Poly diff --git a/tofu/version.py b/tofu/version.py index e2eec41d8..2449f6818 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.2-a5-113-gcbcc34c7' +__version__ = '1.4.2b13-65-ga0f432bb' From 967e02a6ddbcc900db16b19979defbb5483924d0 Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Wed, 22 Jan 2020 13:49:33 +0100 Subject: [PATCH 158/168] [bf #331] corrected last point index when lowest right is 0 --- tofu/geom/_GG.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tofu/geom/_GG.pyx b/tofu/geom/_GG.pyx index 26e5baeb8..ae17ef8c5 100644 --- a/tofu/geom/_GG.pyx +++ b/tofu/geom/_GG.pyx @@ -207,7 +207,7 @@ def Poly_isClockwise(np.ndarray[double,ndim=2] Poly): cdef int idp1 = (idmin + 1) % npts cdef str err_msg = "" if idmin == 0 : - idm1 = npts - 1 + idm1 = npts - 2 res = mvx[idm1] * (mvy[idmin] - mvy[idp1]) + \ mvx[idmin] * (mvy[idp1] - mvy[idm1]) + \ mvx[idp1] * (mvy[idm1] - mvy[idmin]) From 8d67f90d284657934882d588c8a4eea715b53ebd Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Wed, 22 Jan 2020 16:08:00 +0100 Subject: [PATCH 159/168] [bf #331] checking if poly is in wrong order in isclockwise --- tofu/geom/_GG.pyx | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/tofu/geom/_GG.pyx b/tofu/geom/_GG.pyx index ae17ef8c5..c99f4488d 100644 --- a/tofu/geom/_GG.pyx +++ b/tofu/geom/_GG.pyx @@ -200,14 +200,27 @@ def Poly_isClockwise(np.ndarray[double,ndim=2] Poly): cdef double res cdef double[:,::1] mv_poly = np.ascontiguousarray(Poly) cdef int npts = mv_poly.shape[1] - cdef double[::1] mvx = mv_poly[0,:] - cdef double[::1] mvy = mv_poly[1,:] - cdef int idmin = _bgt.find_ind_lowerright_corner(mvx, mvy, npts) - cdef int idm1 = idmin - 1 - cdef int idp1 = (idmin + 1) % npts + cdef int ndim = mv_poly.shape[0] + cdef double[::1] mvx + cdef double[::1] mvy + cdef int idmin + cdef int idm1 + cdef int idp1 cdef str err_msg = "" + # Checking that Poly wasn't given in the shape (npts, ndim) + if ndim > npts: + mv_poly = np.ascontiguousarray(Poly.T) + npts = mv_poly.shape[1] + ndim = mv_poly.shape[0] + mvx = mv_poly[0,:] + mvy = mv_poly[1,:] + # Getting index of lower right corner and its neighbors + idmin = _bgt.find_ind_lowerright_corner(mvx, mvy, npts) + idm1 = idmin - 1 + idp1 = (idmin + 1) % npts if idmin == 0 : idm1 = npts - 2 + # Computing area of lower right triangle res = mvx[idm1] * (mvy[idmin] - mvy[idp1]) + \ mvx[idmin] * (mvy[idp1] - mvy[idm1]) + \ mvx[idp1] * (mvy[idm1] - mvy[idmin]) @@ -219,7 +232,6 @@ def Poly_isClockwise(np.ndarray[double,ndim=2] Poly): + ", " + str(mvy[idmin]) + ".\n" + " The two neighboring points are : " + str(idm1) + " and " + str(idp1) + ".") - print(err_msg) raise Exception(err_msg) # not working return res < 0. From c10784e56add75fe7d8bca568f372e76369b1980 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Thu, 23 Jan 2020 16:50:39 +0100 Subject: [PATCH 160/168] [Issue281] PEP8 Compliance --- tofu/geom/utils.py | 11 ++++++----- tofu/version.py | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tofu/geom/utils.py b/tofu/geom/utils.py index 90a2d52f0..f880fd889 100644 --- a/tofu/geom/utils.py +++ b/tofu/geom/utils.py @@ -819,10 +819,10 @@ def _create_config_testcase(config=None, returnas='object', ssbis, Expbis = '_'+ss+'.txt', '_Exp'+Exp+'_' ff = [fff for fff in ff if ssbis in fff and Expbis in fff] if len(ff) != 1: - msg = "No / several matching files\n" - msg += " Folder: %s\n"%path - msg += " Criteria: [%s, %s]\n"%(cc,ss) - msg += " Matching: "+"\n ".join(ff) + msg = ("No / several matching files\n" + + " Folder: {}\n".format(path) + + " Criteria: [{}, {}]\n".format(cc, ss) + + " Matching: "+"\n ".join(ff)) raise Exception(msg) pfe = os.path.join(path, ff[0]) @@ -831,7 +831,8 @@ def _create_config_testcase(config=None, returnas='object', Exp=dconfig[config]['Exp'], out=returnas) if returnas not in ['object', object]: - obj = ((ss,{'Poly':obj[0], 'pos':obj[1], 'extent':obj[2]}),) + obj = ((ss, {'Poly': obj[0], + 'pos': obj[1], 'extent': obj[2]}),) lS.append(obj) except Exception as err: msg = "Could not be loaded: {}".format(ff[0]) diff --git a/tofu/version.py b/tofu/version.py index 2449f6818..1775fee64 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.2b13-65-ga0f432bb' +__version__ = '1.4.2b13-70-gf5b8d06e' From e312f125631656cb9ffb87b2d012a2d55ed58531 Mon Sep 17 00:00:00 2001 From: Laura Mendoza Date: Fri, 24 Jan 2020 17:34:51 +0100 Subject: [PATCH 161/168] [doc] new aug geom --- examples/tutorials/tuto_plot_gallery_fusion_machines.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/tutorials/tuto_plot_gallery_fusion_machines.py b/examples/tutorials/tuto_plot_gallery_fusion_machines.py index 4dcbd73fb..2ecb2261a 100644 --- a/examples/tutorials/tuto_plot_gallery_fusion_machines.py +++ b/examples/tutorials/tuto_plot_gallery_fusion_machines.py @@ -34,6 +34,6 @@ # With that being said, let's create a gallery of the "top 3" fusion machines # provided by `tofu` to accelerate diagnostic development. -for fusion_machine in ['ITER', 'WEST', 'JET', 'NSTX']: +for fusion_machine in ['ITER', 'WEST', 'JET', 'NSTX', 'AUG']: config = tf.geom.utils.create_config(fusion_machine) config.plot() From e4c7c24392f96e1be16844c8cbade63d28eb4949 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Mon, 27 Jan 2020 15:30:40 +0100 Subject: [PATCH 162/168] [Issue335] descriptio_2d propagated to to_Plasma2D(), to_Cam() and to_Data(), and set to 1 when possible by default --- tofu/imas2tofu/_core.py | 56 ++++++++++++++++++++++++++++------------- tofu/version.py | 2 +- 2 files changed, 40 insertions(+), 18 deletions(-) diff --git a/tofu/imas2tofu/_core.py b/tofu/imas2tofu/_core.py index 6e941f810..2269e192d 100644 --- a/tofu/imas2tofu/_core.py +++ b/tofu/imas2tofu/_core.py @@ -2252,8 +2252,6 @@ def _get_t0(self, t0=None): def to_Config(self, Name=None, occ=None, description_2d=None, mobile=None, plot=True): lidsok = ['wall'] - if description_2d is None: - description_2d = 0 # --------------------------- # Preliminary checks on data source consistency @@ -2279,6 +2277,12 @@ def to_Config(self, Name=None, occ=None, occ = occ[0] indoc = np.nonzero(self._dids[ids]['occ'] == occ)[0][0] + if description_2d is None: + if len(self._dids[ids]['ids'][indoc].description_2d) >= 1: + description_2d = 1 + else: + description_2d = 0 + wall = self._dids[ids]['ids'][indoc].description_2d[description_2d] kwargs = dict(Exp=Exp, Type='Tor') @@ -2795,6 +2799,7 @@ def _get_dextra(self, dextra=None, fordata=False, nan=True, pos=None): def to_Plasma2D(self, tlim=None, dsig=None, t0=None, Name=None, occ=None, config=None, out=object, + description_2d=None, plot=None, plot_sig=None, plot_X=None, bck=True, dextra=None, nan=True, pos=None, shapeRZ=None): @@ -2852,7 +2857,8 @@ def to_Plasma2D(self, tlim=None, dsig=None, t0=None, # config if config is None: - config = self.to_Config(Name=Name, occ=occ, plot=False) + config = self.to_Config(Name=Name, occ=occ, + description_2d=description_2d, plot=False) # dextra d0d, dtime0 = self._get_dextra(dextra) @@ -3259,7 +3265,9 @@ def _to_Cam_Du(self, ids, lk, indch, nan=None, pos=None): def to_Cam(self, ids=None, indch=None, indch_auto=False, - Name=None, occ=None, config=None, plot=True, nan=True, pos=None): + description_2d=None, + Name=None, occ=None, config=None, + plot=True, nan=True, pos=None): # dsig geom = self._checkformat_Cam_geom(ids) @@ -3275,7 +3283,8 @@ def to_Cam(self, ids=None, indch=None, indch_auto=False, # config if config is None: - config = self.to_Config(Name=Name, occ=occ, plot=False) + config = self.to_Config(Name=Name, occ=occ, + description_2d=description_2d, plot=False) # dchans dchans = {} @@ -3389,7 +3398,8 @@ def _checkformat_Data_dsig(self, ids=None, dsig=None, data=None, X=None, def to_Data(self, ids=None, dsig=None, data=None, X=None, tlim=None, - indch=None, indch_auto=False, Name=None, occ=None, config=None, + indch=None, indch_auto=False, Name=None, occ=None, + config=None, description_2d=None, dextra=None, t0=None, datacls=None, geomcls=None, plot=True, bck=True, fallback_X=None, nan=True, pos=None, return_indch=False): @@ -3411,7 +3421,8 @@ def to_Data(self, ids=None, dsig=None, data=None, X=None, tlim=None, # config if config is None: - config = self.to_Config(Name=Name, occ=occ, plot=False) + config = self.to_Config(Name=Name, occ=occ, + description_2d=description_2d, plot=False) # dchans if indch is not None: @@ -3660,7 +3671,8 @@ def calc_signal(self, ids=None, dsig=None, tlim=None, t=None, res=None, q2dR=None, q2dPhi=None, q2dZ=None, Brightness=None, interp_t=None, newcalc=True, indch=None, indch_auto=False, Name=None, - occ_cam=None, occ_plasma=None, config=None, + occ_cam=None, occ_plasma=None, + config=None, description_2d=None, dextra=None, t0=None, datacls=None, geomcls=None, bck=True, fallback_X=None, nan=True, pos=None, plot=True, plot_compare=None, plot_plasma=None): @@ -3680,11 +3692,14 @@ def calc_signal(self, ids=None, dsig=None, tlim=None, t=None, res=None, if plot and plot_compare: data, indch = self.to_Data(ids, indch=indch, indch_auto=indch_auto, t0=t0, + config=config, + description_2d=description_2d, return_indch=True, plot=False) # Get camera cam = self.to_Cam(ids=ids, indch=indch, - Name=None, occ=occ_cam, config=config, + Name=None, occ=occ_cam, + config=config, description_2d=description_2d, plot=False, nan=True, pos=None) # Get relevant parameters @@ -3693,7 +3708,8 @@ def calc_signal(self, ids=None, dsig=None, tlim=None, t=None, res=None, # Get relevant plasma plasma = self.to_Plasma2D(tlim=tlim, dsig=dsig, t0=t0, - Name=None, occ=occ_plasma, config=cam.config, out=object, + Name=None, occ=occ_plasma, + config=cam.config, out=object, plot=False, dextra=dextra, nan=True, pos=None) # Intermediate computation if necessary @@ -3832,7 +3848,7 @@ def calc_signal(self, ids=None, dsig=None, tlim=None, t=None, res=None, def load_Config(shot=None, run=None, user=None, tokamak=None, version=None, - Name=None, occ=0, description_2d=0, plot=True): + Name=None, occ=0, description_2d=None, plot=True): didd = MultiIDSLoader() didd.add_idd(shot=shot, run=run, @@ -3845,7 +3861,8 @@ def load_Config(shot=None, run=None, user=None, tokamak=None, version=None, # occ ? def load_Plasma2D(shot=None, run=None, user=None, tokamak=None, version=None, - tlim=None, occ=None, dsig=None, ids=None, config=None, + tlim=None, occ=None, dsig=None, ids=None, + config=None, description_2d=None, Name=None, t0=None, out=object, dextra=None, plot=None, plot_sig=None, plot_X=None, bck=True): @@ -3871,13 +3888,15 @@ def load_Plasma2D(shot=None, run=None, user=None, tokamak=None, version=None, didd.add_ids(ids=lids, get=True) return didd.to_Plasma2D(Name=Name, tlim=tlim, dsig=dsig, t0=t0, - occ=occ, config=config, out=out, + occ=occ, config=config, + description_2d=description_2d, out=out, plot=plot, plot_sig=plot_sig, plot_X=plot_X, bck=bcki, dextra=dextra) def load_Cam(shot=None, run=None, user=None, tokamak=None, version=None, - ids=None, indch=None, config=None, occ=None, Name=None, plot=True): + ids=None, indch=None, config=None, description_2d=None, + occ=None, Name=None, plot=True): didd = MultiIDSLoader() didd.add_idd(shot=shot, run=run, @@ -3892,13 +3911,15 @@ def load_Cam(shot=None, run=None, user=None, tokamak=None, version=None, didd.add_ids(ids=lids, get=True) return didd.to_Cam(ids=ids, Name=Name, indch=indch, - config=config, occ=occ, plot=plot) + config=config, description_2d=description_2d, + occ=occ, plot=plot) def load_Data(shot=None, run=None, user=None, tokamak=None, version=None, ids=None, datacls=None, geomcls=None, indch_auto=True, tlim=None, dsig=None, data=None, X=None, indch=None, - config=None, occ=None, Name=None, dextra=None, + config=None, description_2d=None, + occ=None, Name=None, dextra=None, t0=None, plot=True, bck=True): didd = MultiIDSLoader() @@ -3921,7 +3942,8 @@ def load_Data(shot=None, run=None, user=None, tokamak=None, version=None, return didd.to_Data(ids=ids, Name=Name, tlim=tlim, t0=t0, datacls=datacls, geomcls=geomcls, dsig=dsig, data=data, X=X, indch=indch, - config=config, occ=occ, dextra=dextra, + config=config, description_2d=description_2d, + occ=occ, dextra=dextra, plot=plot, bck=bck, indch_auto=indch_auto) diff --git a/tofu/version.py b/tofu/version.py index 1775fee64..0a9485579 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.2b13-70-gf5b8d06e' +__version__ = '1.4.2b13-77-g822c9daa' From 375c9f343f496ef81d1f4d3e75414445cd9cf8e1 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Tue, 28 Jan 2020 11:03:45 +0100 Subject: [PATCH 163/168] [Issue335] Added docstr to Multi.get_data(), to_Config(), to_Plasma2D(), to_Cam(), to_Data() and calc_signal() --- tofu/imas2tofu/_core.py | 365 ++++++++++++++++++++++++++++++++++++++++ tofu/version.py | 2 +- 2 files changed, 366 insertions(+), 1 deletion(-) diff --git a/tofu/imas2tofu/_core.py b/tofu/imas2tofu/_core.py index 2269e192d..11e38caa1 100644 --- a/tofu/imas2tofu/_core.py +++ b/tofu/imas2tofu/_core.py @@ -2073,6 +2073,54 @@ def get_data(self, ids=None, sig=None, occ=None, If the ids has a field 'channel', indch is used to specify from which channel data shall be loaded (all by default) + Parameters + ---------- + ids: None / str + ids from which the data should be loaded + ids should be available (check self.get_summary()) + ids should be loaded if not available, using: + - self.add_ids() to add the ids + - self.open_get_close() to force loading if necessary + sig: None / str / list + shortcuts of signals to be loaded from the ids + Check available shortcuts using self.get_shortcuts(ids) + You can add custom shortcuts if needed (cf. self.add_shortcuts()) + sig can be a single str (shortcut) or a list of such + occ: None / int + occurence from which to load the data + indch: None / list / np.ndarray + If the data has channels, this lists / array of int indices can be + used to specify which channels to load from (all if None) + indt: None / list / np.ndarray + If data is time-dependent, the list / array of int indices can be + used to specify which time steps to load + stack: bool + Flag indicating whether common data (e.g.: data from different + channels) should be agregated / stacked into a single array + isclose: None / bool + Flag indicating whether the agregated data is a collection of + identical vectors, if which case it will be checked (np.isclose()) + and only a single vector will be kept + flatocc: bool + By default, the data is returned as a list for each occurence + If there is only one occ and flatocc = True, only the first element + of the list is returned + nan: bool + Flag indicating whether to check for abs(data) > 1.30 + All data is this case will be set to nan + Due to the fact IMAS default value is 1.e49 + pos: None / bool + Flag indicating whether the data should be positive (negative + values will be set to nan) + warn: bool + Flag indicating whether to print warning messages for data could + not be retrieved + + Return + ------ + dout: dict + Dictionnary containing the loaded data + """ return self._get_data(ids=ids, sig=sig, occ=occ, indch=indch, indt=indt, stack=stack, isclose=isclose, @@ -2251,6 +2299,18 @@ def _get_t0(self, t0=None): def to_Config(self, Name=None, occ=None, description_2d=None, mobile=None, plot=True): + """ Export the content of wall ids as a tofu Config object + + Choose the occurence (occ), and index (description_2d, cf. dd_doc) to + be exported. + Specify whether to pick from limiter or mobile + If not specified, will be decided automatically from the content + Optionally plot the result + + This requires that the wall ids was previously loaded. + If not run: + self.add_ids('wall') + """ lidsok = ['wall'] # --------------------------- @@ -2802,6 +2862,77 @@ def to_Plasma2D(self, tlim=None, dsig=None, t0=None, description_2d=None, plot=None, plot_sig=None, plot_X=None, bck=True, dextra=None, nan=True, pos=None, shapeRZ=None): + """ Export the content of some ids as a tofu Plasma2D object + + Some ids typically contain plasma 1d (radial) or 2d (mesh) profiles + They include for example ids: + - core_profiles + - core_sources + - edge_profiles + - edge_sources + - equilibrium + + tofu offers a class for handling multiple profiles characterizing a + plasma, it's called Plasma2D + This method automatically identifies the ids that may contain profiles, + extract all profiles (i.e.: all profiles identified by a shortcut, see + self.get_shortcuts()) and export everything to a fresh Plasma2D + instance. + + Parameters + ---------- + tlim: None / list + Restrict the loaded data to a time interval with tlim + if None, loads all time steps + dsig: None / dict + Specify exactly which data (shortcut) should be loaded by ids + If None, loads all available data + t0: None / float / str + Specify a time to be used as origin: + - None: absolute time vectors are untouched + - float : the roigin of all time vectors is set to t0 + - str : the origin is taken from an event in ids pulse_schedule + Name: None / str + Name to be given to the instance + If None, a default Name is built + occ: None / int + occurence to be used for loading the data + config: None / Config + Configuration (i.e.: tokamak geometry) to be used for the instance + If None, created from the wall ids with self.to_Config(). + out: type + class with which the output shall be returned + - object : as a Plasma2D instance + - dict: as a dict + description_2d: None / int + description_2d indiex to be used if the Config is to be built from + wall ids. See self.to_Config() + plot: None / bool + Flag whether to plot the result + plot_sig: None / str + shortcut of the signal to be plotted, if any + plot_X: None / str + shortcut of the abscissa against which to plot the signal, if any + bck: bool + Flag indicating whether to plot the grey envelop of the signal as a + background, if plot is True + dextra: None / dict + dict of extra signals (time traces) to be plotted, for context + shapeRZ: None / tuple + If provided, tuple indicating the order of 2d data arrays + associated to rectangular meshes + Only necessary when shape cannot be infered from data shape + - ('R', 'Z'): first dimension is R, second Z + - ('Z', 'R'): the other way around + + Args nan and pos are fed to self.get_data()i + + Return + ------ + plasma: dict / Plasma2D + dict or Plasma2D instance depending on out + + """ # dsig dsig = self._checkformat_Plasma2D_dsig(dsig) @@ -3268,6 +3399,60 @@ def to_Cam(self, ids=None, indch=None, indch_auto=False, description_2d=None, Name=None, occ=None, config=None, plot=True, nan=True, pos=None): + """ Export the content of a diagnostic ids as a tofu CamLos1D instance + + Some ids contain the geometry of a diagnostics + They typically have a 'channels' field + Generally in the form of a set of Lines of Sights (LOS) + They include for example ids: + - interferometer + - polarimeter + - bolometer + - soft_x_rays + - bremsstrahlung_visible + - spectrometer_visible + + tofu offers a class for handling sets fo LOS as a camera: CamLOS1D + This method extracts the geometry of the desired diagnostic (ids) and + exports it as a CamLOS1D instance. + + Parameters + ---------- + ids: None / str + Specify the ids (will be checked against known diagnostics ids) + Should have a 'channels' field + If None and a unique diagnostic ids has been added, set to this one + Name: None / str + Name to be given to the instance + If None, a default Name is built + occ: None / int + occurence to be used for loading the data + indch: None / list / array + If provided, array of int indices specifying which channels shall + be loaded (fed to self.get_data()) + indch_auto: bool + If True and indch is not provided, will try to guess which channels + can be loaded. If possible all channels are loaded by default, but + only if they have uniform data (same shape, i.e.: same time + vectors). In case of channels with non-uniform data, will try to + identify a sub-group of channels with uniform data + config: None / Config + Configuration (i.e.: tokamak geometry) to be used for the instance + If None, created from the wall ids with self.to_Config(). + description_2d: None / int + description_2d indiex to be used if the Config is to be built from + wall ids. See self.to_Config() + plot: None / bool + Flag whether to plot the result + + Args nan and pos are fed to self.get_data()i + + Return + ------ + cam: CamLOS1D + CamLOS1D instance + + """ # dsig geom = self._checkformat_Cam_geom(ids) @@ -3403,6 +3588,108 @@ def to_Data(self, ids=None, dsig=None, data=None, X=None, tlim=None, dextra=None, t0=None, datacls=None, geomcls=None, plot=True, bck=True, fallback_X=None, nan=True, pos=None, return_indch=False): + """ Export the content of a diagnostic ids as a tofu DataCam1D instance + + Some ids contain the geometry and data of a diagnostics + They typically have a 'channels' field + They include for example ids: + - interferometer + - polarimeter + - bolometer + - soft_x_rays + - bremsstrahlung_visible + - spectrometer_visible + - reflectometer_profile + - ece + - magnetics + - barometry + - neutron_diagnostics + + tofu offers a class for handling data: DataCam1D + If available, this method also loads the geometry using self.to_Cam() + on the same ids. + But it will load the data even if no geometry (LOS) is available. + This method extracts the data of the desired diagnostic (ids) and + exports it as a DataCam1D instance. + + Parameters + ---------- + ids: None / str + Specify the ids (will be checked against known diagnostics ids) + Should have a 'channels' field + If None and a unique diagnostic ids has been added, set to this one + Name: None / str + Name to be given to the instance + If None, a default Name is built + occ: None / int + occurence to be used for loading the data + indch: None / list / array + If provided, array of int indices specifying which channels shall + be loaded (fed to self.get_data()) + indch_auto: bool + If True and indch is not provided, will try to guess which channels + can be loaded. If possible all channels are loaded by default, but + only if they have uniform data (same shape, i.e.: same time + vectors). In case of channels with non-uniform data, will try to + identify a sub-group of channels with uniform data + dsig: None / dict + Specify exactly which data (shortcut) should be loaded by ids + If None, loads all available data + data: None / str + If dsig is not provided, specify the shortcut of the data to be + loaded (from channels) + X: None / str + If dsig is not provided, specify the shortcut of the data to be + used as abscissa + tlim: None / list + Restrict the loaded data to a time interval with tlim + if None, loads all time steps + config: None / Config + Configuration (i.e.: tokamak geometry) to be used for the instance + If None, created from the wall ids with self.to_Config(). + description_2d: None / int + description_2d indiex to be used if the Config is to be built from + wall ids. See self.to_Config() + dextra: None / dict + dict of extra signals (time traces) to be plotted, for context + t0: None / float / str + Specify a time to be used as origin: + - None: absolute time vectors are untouched + - float : the roigin of all time vectors is set to t0 + - str : the origin is taken from an event in ids pulse_schedule + datacls: None / str + tofu calss to be used for the data + - None : determined from tabulated info (self._didsdiag[ids]) + - str : should be a valid data class name from tofu.data + geomcls: None / False / str + tofu class to be used for the geometry + - False: geometry not loaded + - None : determined from tabulated info (self._didsdiag[ids]) + - str : should be a valid camera class name from tofu.geom + fallback_X: None / float + fallback value for X when X is nan + X[np.isnan(X)] = fallback_X + If None, set to 1.1*np.nanmax(X) + + return_indch: bool + Flag indicating whether to return also the indch + Useful if indch was determined automatically by indch_auto + plot: None / bool + Flag whether to plot the result + bck: bool + Flag indicating whether to plot the grey envelop of the signal as a + background, if plot is True + + Args nan and pos are fed to self.get_data()i + + Return + ------ + data: DataCam1D + DataCam1D instance + indch: np.ndarray + int array of indices of the loaded channels, returned only if + return_indch = True + """ # dsig datacls, geomcls, dsig = self._checkformat_Data_dsig(ids, dsig, @@ -3676,6 +3963,84 @@ def calc_signal(self, ids=None, dsig=None, tlim=None, t=None, res=None, dextra=None, t0=None, datacls=None, geomcls=None, bck=True, fallback_X=None, nan=True, pos=None, plot=True, plot_compare=None, plot_plasma=None): + """ Compute synthetic data for a diagnostics and export as DataCam1D object + + Some ids typically contain plasma 1d (radial) or 2d (mesh) profiles + They include for example ids: + - core_profiles + - core_sources + - edge_profiles + - edge_sources + - equilibrium + + From these profiles, tofu can computed syntheic data for a diagnostic + ids which provides a geometry (channels.line_of_sight). + tofu extracts the geometry, and integrates the desired profile along + the lines of sight (LOS), using 2D interpolation when necessary + + It requires: + - a diagnostic ids with geometry (LOS) + - an ids containing the 1d or 2d profile to be integrated + - if necessary, an intermediate ids to interpolate the 1d profile + to 2d (e.g.: equilibrium) + + For each ids, you need to specify: + - profile ids: + profile (signal) to be integrated + quantity to be used for 1d interpolation + - equilibrium / intermediate ids: + quantity to be used for 2d interpolation + (shall be the same dimension as quantity for 1d interp.) + + This method is a combination of self.to_Plasma2D() (used for extracting + profiles and equilibrium and for interpolation) and self.to_Cam() (used + for extracting diagnostic geometry) and to_Data() (used for exportig + computed result as a tofu DataCam1D instance. + + Args ids, dsig, tlim, occ_plasma (occ), nan, pos, plot_plasma (plot) + are fed to to_Plasma2D() + Args indch, indch_auto, occ_cam (occ), config, description_2d, are fed + to to_Cam() + Args Name, bck, fallback_X, plot, t0, dextra are fed to to_Data() + + Parameters + ---------- + t: None / float / np.ndarray + time at which the synthetic signal shall be computed + If None, computed for all available time steps + res: None / float + absolute spatial resolution (sampling steps) used for Line-of-Sight + intergation (in meters) + quant: None / str + Shortcut of the quantity to be integrated + ref1d: None / str + Shortcut of the quantity to be used as reference for 1d + interpolation + ref2d: None / str + Shortcut of the quantity to be used as reference for 2d + interpolation + q2dR: None / str + If integrating an anisotropic vector field (e.g. magnetic field) + q2dR if the shortcut of the R-component of the quantity + q2dPhi: None / str + If integrating an anisotropic vector field (e.g. magnetic field) + q2dPhi if the shortcut of the Phi-component of the quantity + q2dR: None / str + If integrating an anisotropic vector field (e.g. magnetic field) + q2dZ if the shortcut of the Z-component of the quantity + Brightness: bool + Flag indicating whether the result shall be returned as a + Brightness (i.e.: line integral) or an incident flux (Brightness x + Etendue), which requires the Etendue + plot_compare: bool + Flag indicating whether to plot the experimental data against the + computed synthetic data + Return + ------ + sig: DataCam1D + DataCam1D instance + + """ # Check / format inputs if plot is None: diff --git a/tofu/version.py b/tofu/version.py index 0a9485579..67650d9fc 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.2b13-77-g822c9daa' +__version__ = '1.4.2b13-78-ge4c7c243' From 038ef357b8d233bb3d239b5526de556f85da20a4 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Tue, 28 Jan 2020 11:06:39 +0100 Subject: [PATCH 164/168] [Issue335] PEP8 compliance --- tofu/imas2tofu/_core.py | 2 +- tofu/version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tofu/imas2tofu/_core.py b/tofu/imas2tofu/_core.py index 11e38caa1..430cd33f3 100644 --- a/tofu/imas2tofu/_core.py +++ b/tofu/imas2tofu/_core.py @@ -3963,7 +3963,7 @@ def calc_signal(self, ids=None, dsig=None, tlim=None, t=None, res=None, dextra=None, t0=None, datacls=None, geomcls=None, bck=True, fallback_X=None, nan=True, pos=None, plot=True, plot_compare=None, plot_plasma=None): - """ Compute synthetic data for a diagnostics and export as DataCam1D object + """ Compute synthetic data for a diagnostics and export as DataCam1D Some ids typically contain plasma 1d (radial) or 2d (mesh) profiles They include for example ids: diff --git a/tofu/version.py b/tofu/version.py index 67650d9fc..d8af0cf17 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.2b13-78-ge4c7c243' +__version__ = '1.4.2b13-79-g375c9f34' From f80016a169d4638abb4fd233c5c4326236fce407 Mon Sep 17 00:00:00 2001 From: "Laura S. Mendoza" Date: Tue, 28 Jan 2020 11:19:12 +0100 Subject: [PATCH 165/168] [Issue #337] replaced Poly_Order by format_poly --- tofu/geom/_GG.pyx | 44 ++++++++------------------- tofu/geom/_comp.py | 7 ++--- tofu/tests/tests01_geom/tests01_GG.py | 24 +++++++-------- 3 files changed, 28 insertions(+), 47 deletions(-) diff --git a/tofu/geom/_GG.pyx b/tofu/geom/_GG.pyx index c99f4488d..47a2f401f 100644 --- a/tofu/geom/_GG.pyx +++ b/tofu/geom/_GG.pyx @@ -236,18 +236,17 @@ def Poly_isClockwise(np.ndarray[double,ndim=2] Poly): return res < 0. -def Poly_Order(np.ndarray[double,ndim=2] Poly, str order='C', Clock=False, - close=True, str layout='(cc,N)', - str layout_in=None, Test=True): +def format_poly(np.ndarray[double,ndim=2] poly, str order='C', Clock=False, + close=True, Test=True): """ - Return a polygon Poly as a np.ndarray formatted according to parameters + Return a polygon poly as a np.ndarray formatted according to parameters Parameters ---------- - Poly np.ndarray or list Input polygon under from of (cc,N) or - or tuple (N,cc) np.ndarray (where cc = 2 or 3, the - number of coordinates and N points), or - list or tuple of vertices + poly np.ndarray or list Input np.ndarray of shape (cc,N) + or tuple (where cc = 2 or 3, the number of + coordinates and N points), or + list or tuple of vertices of a polygon order str Flag indicating whether the output np.ndarray shall be C-contiguous ('C') or Fortran-contiguous ('F') @@ -260,9 +259,6 @@ def Poly_Order(np.ndarray[double,ndim=2] Poly, str order='C', Clock=False, cating whether the output array shall be closed (True, ie: last point==first point) or not closed (False) - layout str Flag indicating whether the output - np.ndarray shall be of shape '(cc,N)' - or '(N,cc)' Test bool Flag indicating whether the inputs should be tested for conformity, default: True @@ -271,27 +267,15 @@ def Poly_Order(np.ndarray[double,ndim=2] Poly, str order='C', Clock=False, poly np.ndarray Output formatted polygon """ if Test: - assert (2 in np.shape(Poly) or 3 in np.shape(Poly)), \ - "Arg Poly must contain the 2D or 3D coordinates of at least 3 points!" - assert max(np.shape(Poly))>=3, ("Arg Poly must contain the 2D or 3D", - " coordinates of at least 3 points!") + assert (poly.shape[0] == 2 or poly.shape[0] == 3), \ + ("Arg poly must contain the 2D or 3D coordinates of N points." + " And be shaped in the form (dim, N).") + assert poly.shape[1]>=3, ("Arg poly must contain the 2D or 3D", + " coordinates of at least 3 points!") assert order.lower() in ['c','f'], "Arg order must be in ['c','f']!" assert type(Clock) is bool, "Arg Clock must be a bool!" assert type(close) is bool, "Arg close must be a bool!" - assert layout.lower() in ['(cc,n)','(n,cc)'], \ - "Arg layout must be in ['(cc,n)','(n,cc)']!" - assert layout_in is None or layout_in.lower() in ['(cc,n)','(n,cc)'],\ - "Arg layout_in must be None or in ['(cc,n)','(n,cc)']!" - - if np.shape(Poly)==(3,3): - assert not layout_in is None, \ - ("Could not resolve the input layout of Poly because shape==(3,3)", - " Please specify if input is in '(cc,n)' or '(n,cc)' format!") - poly = np.array(Poly).T if layout_in.lower()=='(n,cc)' \ - else np.array(Poly) - else: - poly = np.array(Poly).T if min(np.shape(Poly))==Poly.shape[1]\ - else np.array(Poly) + if not np.allclose(poly[:,0],poly[:,-1], atol=_VSMALL): poly = np.concatenate((poly,poly[:,0:1]),axis=1) if poly.shape[0]==2 and not Clock is None: @@ -302,8 +286,6 @@ def Poly_Order(np.ndarray[double,ndim=2] Poly, str order='C', Clock=False, raise excp if not close: poly = poly[:,:-1] - if layout.lower()=='(n,cc)': - poly = poly.T poly = np.ascontiguousarray(poly) if order.lower()=='c' \ else np.asfortranarray(poly) return poly diff --git a/tofu/geom/_comp.py b/tofu/geom/_comp.py index a138d34d4..f445dc755 100644 --- a/tofu/geom/_comp.py +++ b/tofu/geom/_comp.py @@ -35,8 +35,8 @@ def _Struct_set_Poly( # Make Poly closed, counter-clockwise, with '(cc,N)' layout and arrayorder try: - Poly = _GG.Poly_Order(Poly, order="C", Clock=False, close=True, - layout="(cc,N)", Test=True) + Poly = _GG.format_poly(Poly, order="C", Clock=False, close=True, + Test=True) except Exception as excp: print(excp) assert Poly.shape[0] == 2, "Arg Poly must be a 2D polygon !" @@ -81,12 +81,11 @@ def _Struct_set_Poly( Vin = Vin / np.hypot(Vin[0, :], Vin[1, :])[np.newaxis, :] Vin = fPfmt(Vin) - poly = _GG.Poly_Order( + poly = _GG.format_poly( Poly, order=arrayorder, Clock=Clock, close=False, - layout="(cc,N)", Test=True, ) diff --git a/tofu/tests/tests01_geom/tests01_GG.py b/tofu/tests/tests01_geom/tests01_GG.py index b0437ff4e..456b31d4a 100644 --- a/tofu/tests/tests01_geom/tests01_GG.py +++ b/tofu/tests/tests01_geom/tests01_GG.py @@ -113,33 +113,33 @@ def test02_Poly_CLockOrder(): # Test arbitrary 2D polygon Poly = np.array([[0.,1.,1.,0.],[0.,0.,1.,1.]]) - P = GG.Poly_Order(Poly, order='C', Clock=False, close=True, - layout='(N,cc)', layout_in=None, Test=True) - assert all([np.allclose(P[0,:],P[-1,:]), P.shape==(5,2), + P = GG.format_poly(Poly, order='C', Clock=False, close=True, + Test=True) + assert all([np.allclose(P[:,0],P[:,-1]), P.shape==(2,5), not GG.Poly_isClockwise(P), P.flags['C_CONTIGUOUS'], not P.flags['F_CONTIGUOUS']]) - P = GG.Poly_Order(Poly, order='F', Clock=True, close=False, - layout='(cc,N)', layout_in=None, Test=True) + P = GG.format_poly(Poly, order='F', Clock=True, close=False, + Test=True) assert all([not np.allclose(P[:,0],P[:,-1]), P.shape==(2,4), GG.Poly_isClockwise(np.concatenate((P,P[:,0:1]),axis=1)), not P.flags['C_CONTIGUOUS'], P.flags['F_CONTIGUOUS']]) # Test arbitrary 3D polygon Poly = np.array([[0.,1.,1.,0.],[0.,0.,1.,1.],[0.,0.,0.,0.]]) - P = GG.Poly_Order(Poly, order='C', Clock=False, close=False, - layout='(N,cc)', layout_in=None, Test=True) - assert all([not np.allclose(P[0,:],P[-1,:]), P.shape==(4,3), + P = GG.format_poly(Poly, order='C', Clock=False, close=False, + Test=True) + assert all([not np.allclose(P[:,0],P[:,-1]), P.shape==(3,4), P.flags['C_CONTIGUOUS'], not P.flags['F_CONTIGUOUS']]) - P = GG.Poly_Order(Poly, order='F', Clock=True, close=True, - layout='(cc,N)', layout_in=None, Test=True) + P = GG.format_poly(Poly, order='F', Clock=True, close=True, + Test=True) assert all([np.allclose(P[:,0],P[:,-1]), P.shape==(3,5), not P.flags['C_CONTIGUOUS'], P.flags['F_CONTIGUOUS']]) def test03_Poly_VolAngTor(): Poly = np.array([[1.,1.5,2.,2.,2.,1.5,1.],[0.,0.,0.,0.5,1.,1.,1.]]) - Poly = GG.Poly_Order(Poly, order='C', Clock=False, close=True, - layout='(cc,N)', Test=True) + Poly = GG.format_poly(Poly, order='C', Clock=False, close=True, + Test=True) V, B = GG.Poly_VolAngTor(Poly) assert V==1.5 assert np.allclose(B,[7./(3.*1.5),0.5]) From b560c3961103b44f1da105bac57c3452cb9a6a5e Mon Sep 17 00:00:00 2001 From: "Laura S. Mendoza" Date: Tue, 28 Jan 2020 11:25:12 +0100 Subject: [PATCH 166/168] pep8 speaks changes --- tofu/geom/_comp.py | 2 +- tofu/tests/tests01_geom/tests01_GG.py | 22 ++++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/tofu/geom/_comp.py b/tofu/geom/_comp.py index f445dc755..5faaa396e 100644 --- a/tofu/geom/_comp.py +++ b/tofu/geom/_comp.py @@ -36,7 +36,7 @@ def _Struct_set_Poly( # Make Poly closed, counter-clockwise, with '(cc,N)' layout and arrayorder try: Poly = _GG.format_poly(Poly, order="C", Clock=False, close=True, - Test=True) + Test=True) except Exception as excp: print(excp) assert Poly.shape[0] == 2, "Arg Poly must be a 2D polygon !" diff --git a/tofu/tests/tests01_geom/tests01_GG.py b/tofu/tests/tests01_geom/tests01_GG.py index 456b31d4a..015e08007 100644 --- a/tofu/tests/tests01_geom/tests01_GG.py +++ b/tofu/tests/tests01_geom/tests01_GG.py @@ -114,25 +114,27 @@ def test02_Poly_CLockOrder(): # Test arbitrary 2D polygon Poly = np.array([[0.,1.,1.,0.],[0.,0.,1.,1.]]) P = GG.format_poly(Poly, order='C', Clock=False, close=True, - Test=True) - assert all([np.allclose(P[:,0],P[:,-1]), P.shape==(2,5), + Test=True) + assert all([np.allclose(P[:,0], P[:,-1]), P.shape==(2, 5), not GG.Poly_isClockwise(P), P.flags['C_CONTIGUOUS'], not P.flags['F_CONTIGUOUS']]) P = GG.format_poly(Poly, order='F', Clock=True, close=False, - Test=True) - assert all([not np.allclose(P[:,0],P[:,-1]), P.shape==(2,4), - GG.Poly_isClockwise(np.concatenate((P,P[:,0:1]),axis=1)), + Test=True) + assert all([not np.allclose(P[:, 0], P[:, -1]), P.shape==(2, 4), + GG.Poly_isClockwise(np.concatenate((P, P[:,0:1]), axis=1)), not P.flags['C_CONTIGUOUS'], P.flags['F_CONTIGUOUS']]) # Test arbitrary 3D polygon - Poly = np.array([[0.,1.,1.,0.],[0.,0.,1.,1.],[0.,0.,0.,0.]]) + Poly = np.array([[0., 1., 1., 0.], + [0., 0., 1., 1.], + [0., 0., 0., 0.]]) P = GG.format_poly(Poly, order='C', Clock=False, close=False, - Test=True) - assert all([not np.allclose(P[:,0],P[:,-1]), P.shape==(3,4), + Test=True) + assert all([not np.allclose(P[:, 0], P[:, -1]), P.shape==(3, 4), P.flags['C_CONTIGUOUS'], not P.flags['F_CONTIGUOUS']]) P = GG.format_poly(Poly, order='F', Clock=True, close=True, - Test=True) - assert all([np.allclose(P[:,0],P[:,-1]), P.shape==(3,5), + Test=True) + assert all([np.allclose(P[:, 0], P[:, -1]), P.shape==(3, 5), not P.flags['C_CONTIGUOUS'], P.flags['F_CONTIGUOUS']]) From fbc07eb74ed17d0b2726e2aeec1b94a170e98851 Mon Sep 17 00:00:00 2001 From: "Laura S. Mendoza" Date: Tue, 28 Jan 2020 11:26:42 +0100 Subject: [PATCH 167/168] pep8 speaks changes --- tofu/tests/tests01_geom/tests01_GG.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tofu/tests/tests01_geom/tests01_GG.py b/tofu/tests/tests01_geom/tests01_GG.py index 015e08007..01eb2ab67 100644 --- a/tofu/tests/tests01_geom/tests01_GG.py +++ b/tofu/tests/tests01_geom/tests01_GG.py @@ -115,13 +115,13 @@ def test02_Poly_CLockOrder(): Poly = np.array([[0.,1.,1.,0.],[0.,0.,1.,1.]]) P = GG.format_poly(Poly, order='C', Clock=False, close=True, Test=True) - assert all([np.allclose(P[:,0], P[:,-1]), P.shape==(2, 5), + assert all([np.allclose(P[:, 0], P[:, -1]), P.shape == (2, 5), not GG.Poly_isClockwise(P), P.flags['C_CONTIGUOUS'], not P.flags['F_CONTIGUOUS']]) P = GG.format_poly(Poly, order='F', Clock=True, close=False, Test=True) - assert all([not np.allclose(P[:, 0], P[:, -1]), P.shape==(2, 4), - GG.Poly_isClockwise(np.concatenate((P, P[:,0:1]), axis=1)), + assert all([not np.allclose(P[:, 0], P[:, -1]), P.shape == (2, 4), + GG.Poly_isClockwise(np.concatenate((P, P[:, 0:1]), axis=1)), not P.flags['C_CONTIGUOUS'], P.flags['F_CONTIGUOUS']]) # Test arbitrary 3D polygon @@ -130,18 +130,18 @@ def test02_Poly_CLockOrder(): [0., 0., 0., 0.]]) P = GG.format_poly(Poly, order='C', Clock=False, close=False, Test=True) - assert all([not np.allclose(P[:, 0], P[:, -1]), P.shape==(3, 4), + assert all([not np.allclose(P[:, 0], P[:, -1]), P.shape == (3, 4), P.flags['C_CONTIGUOUS'], not P.flags['F_CONTIGUOUS']]) P = GG.format_poly(Poly, order='F', Clock=True, close=True, Test=True) - assert all([np.allclose(P[:, 0], P[:, -1]), P.shape==(3, 5), + assert all([np.allclose(P[:, 0], P[:, -1]), P.shape == (3, 5), not P.flags['C_CONTIGUOUS'], P.flags['F_CONTIGUOUS']]) def test03_Poly_VolAngTor(): Poly = np.array([[1.,1.5,2.,2.,2.,1.5,1.],[0.,0.,0.,0.5,1.,1.,1.]]) Poly = GG.format_poly(Poly, order='C', Clock=False, close=True, - Test=True) + Test=True) V, B = GG.Poly_VolAngTor(Poly) assert V==1.5 assert np.allclose(B,[7./(3.*1.5),0.5]) From 5b11c7b30e3b0668475e017152326b83d72ea5f5 Mon Sep 17 00:00:00 2001 From: VEZINET Didier Date: Tue, 28 Jan 2020 13:41:50 +0100 Subject: [PATCH 168/168] [Issue335] Typos --- tofu/imas2tofu/_core.py | 12 ++++++------ tofu/version.py | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tofu/imas2tofu/_core.py b/tofu/imas2tofu/_core.py index 430cd33f3..d029ed350 100644 --- a/tofu/imas2tofu/_core.py +++ b/tofu/imas2tofu/_core.py @@ -2905,7 +2905,7 @@ class with which the output shall be returned - object : as a Plasma2D instance - dict: as a dict description_2d: None / int - description_2d indiex to be used if the Config is to be built from + description_2d index to be used if the Config is to be built from wall ids. See self.to_Config() plot: None / bool Flag whether to plot the result @@ -2925,7 +2925,7 @@ class with which the output shall be returned - ('R', 'Z'): first dimension is R, second Z - ('Z', 'R'): the other way around - Args nan and pos are fed to self.get_data()i + Args nan and pos are fed to self.get_data() Return ------ @@ -3440,12 +3440,12 @@ def to_Cam(self, ids=None, indch=None, indch_auto=False, Configuration (i.e.: tokamak geometry) to be used for the instance If None, created from the wall ids with self.to_Config(). description_2d: None / int - description_2d indiex to be used if the Config is to be built from + description_2d index to be used if the Config is to be built from wall ids. See self.to_Config() plot: None / bool Flag whether to plot the result - Args nan and pos are fed to self.get_data()i + Args nan and pos are fed to self.get_data() Return ------ @@ -3648,7 +3648,7 @@ def to_Data(self, ids=None, dsig=None, data=None, X=None, tlim=None, Configuration (i.e.: tokamak geometry) to be used for the instance If None, created from the wall ids with self.to_Config(). description_2d: None / int - description_2d indiex to be used if the Config is to be built from + description_2d index to be used if the Config is to be built from wall ids. See self.to_Config() dextra: None / dict dict of extra signals (time traces) to be plotted, for context @@ -3680,7 +3680,7 @@ def to_Data(self, ids=None, dsig=None, data=None, X=None, tlim=None, Flag indicating whether to plot the grey envelop of the signal as a background, if plot is True - Args nan and pos are fed to self.get_data()i + Args nan and pos are fed to self.get_data() Return ------ diff --git a/tofu/version.py b/tofu/version.py index d8af0cf17..cd4ac7d9e 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.2b13-79-g375c9f34' +__version__ = '1.4.2b13-80-g038ef357'