Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
54f15ae
np.Nan->np.nan
prasad-sawantdesai Mar 17, 2026
a373d66
Merge pull request #16 from prasad-sawantdesai/fix-numpy-nan-issue
olivhoenen Mar 20, 2026
527eb52
Merge branch 'main' into develop
olivhoenen Mar 23, 2026
cb47065
added separatrix, contour center, and magnetic axes with clockable op…
prasad-sawantdesai Mar 26, 2026
837a4df
Merge pull request #18 from prasad-sawantdesai/fix/plotequicomp_issue…
prasad-sawantdesai Mar 26, 2026
7bc37fa
added quantities and spacing between plots
prasad-sawantdesai Mar 27, 2026
8759cdb
fixed integration with machine description
prasad-sawantdesai Mar 27, 2026
1b927c9
fixed colorbars position
prasad-sawantdesai Mar 27, 2026
7538154
fix color of separatrix
prasad-sawantdesai Mar 27, 2026
5d0d18d
remove legend for quantities
prasad-sawantdesai Mar 27, 2026
cd82599
fixed formatting
prasad-sawantdesai Mar 27, 2026
847b356
added documetation about tkinter installation
prasad-sawantdesai Mar 27, 2026
c5a3299
Add boundary overlays (outline, separatrix, x-points, strike-points, …
prasad-sawantdesai Mar 30, 2026
09ea0b8
do not join strike points and rename labels
prasad-sawantdesai Mar 30, 2026
0381773
changed the marker for current center
prasad-sawantdesai Mar 30, 2026
dfa98ea
reverted rho option and use of IMAS constants
prasad-sawantdesai Mar 31, 2026
e332fcb
fixed formatting issue
prasad-sawantdesai Mar 31, 2026
0ba5b0e
contour_tree implementation DD4
prasad-sawantdesai Mar 31, 2026
26bd780
removed boundary and made separatrix black
prasad-sawantdesai Mar 31, 2026
d3e566c
fix: correct psi 2D grid orientation for rectangular equilibrium grid…
prasad-sawantdesai Apr 1, 2026
d570da9
Merge branch 'iterorganization:develop' into feature/add_separatrix_a…
prasad-sawantdesai May 4, 2026
61e1fb9
add CODEOWNERS
olivhoenen Jun 2, 2026
204c942
fix ci plan on bamboo (#25)
prasad-sawantdesai Jun 2, 2026
1090085
ci: add dependabot.yml to update github-actions (#24)
Louwrensth Jun 2, 2026
e57c1ab
Merge branch 'iterorganization:develop' into feature/add_separatrix_a…
prasad-sawantdesai Jun 2, 2026
37663b7
Bump the actions-deps group with 4 updates
dependabot[bot] Jun 2, 2026
b189ded
use polycollection from matplotlib and use cells instead of nodes (#22)
prasad-sawantdesai Jun 4, 2026
ef439cf
fix: correct electron power calculation and improve plot visibility (…
ZijianBian Jun 4, 2026
58b6352
added lazy=True and fixed bug in reading data
prasad-sawantdesai Jun 11, 2026
094c40f
magnetic_axis +, current center + , geometric axis x and separatrix …
prasad-sawantdesai Jun 11, 2026
0cd9c11
for DD3 read values from boundary x_point and strike_point
prasad-sawantdesai Jun 11, 2026
e46a8f2
plot rho2d with transpose
prasad-sawantdesai Jun 12, 2026
9c650a2
show URI on top left corner
prasad-sawantdesai Jun 12, 2026
863e09b
Do not show quantities at the start and make it visible/invisible bas…
prasad-sawantdesai Jun 12, 2026
d3246f9
add buttons to clear overlay show legends inside to save space and ba…
prasad-sawantdesai Jun 12, 2026
2be598a
added overlay CLI argument
prasad-sawantdesai Jun 12, 2026
1c13e23
fixed comment
prasad-sawantdesai Jun 12, 2026
890fa34
Feature/show shape and terminal plot in idsprint (#28)
prasad-sawantdesai Jun 12, 2026
692ead8
fixed provenance
prasad-sawantdesai Jun 12, 2026
10229bb
provenance if passed in center. do not show same uri if --md passed. …
prasad-sawantdesai Jun 15, 2026
612add8
removed unused import
prasad-sawantdesai Jun 15, 2026
afdc00b
read boundary/outline
prasad-sawantdesai Jun 15, 2026
d45066d
added plotting script provennace as title
prasad-sawantdesai Jun 15, 2026
d64ed81
Merge branch 'develop' into feature/add_separatrix_and_magnetic_axes_…
prasad-sawantdesai Jun 15, 2026
25d7bef
removed provenance flag and always showed title
prasad-sawantdesai Jun 15, 2026
a06d803
added --no-provenance
prasad-sawantdesai Jun 19, 2026
301de7f
fixed units, -p to --profiles,remove y axis labels
prasad-sawantdesai Jun 19, 2026
7745398
plot machine description with psi when using --no-overlay -md
prasad-sawantdesai Jun 19, 2026
aaec5d8
fix multiple URIs to single one if IDSes are coming from same data en…
prasad-sawantdesai Jun 19, 2026
2595404
show boundary/outline if present
prasad-sawantdesai Jun 22, 2026
497a33c
generalized provenance info in plotting scripts
prasad-sawantdesai Jun 22, 2026
7ff222f
fixed yaml file to latest version and autoconvert+false
prasad-sawantdesai Jun 22, 2026
5cca20d
Bump actions/checkout from 6 to 7 in the actions-deps group
dependabot[bot] Jun 23, 2026
a812a52
show labels with indices, if more than 20 labels then show first and …
prasad-sawantdesai Jun 22, 2026
c2a8497
Feature/add separatrix and magnetic axes in plotequilibrium (#20)
prasad-sawantdesai Jul 2, 2026
a663b95
Merge branch 'develop' into Generalize-the---no-provenance-option-to-…
prasad-sawantdesai Jul 2, 2026
9ebd166
removed duplicate --no-provenance arguement
prasad-sawantdesai Jul 2, 2026
a2c31c8
plot_rho -> plot_phi internal variable
prasad-sawantdesai Jul 2, 2026
3f97eb7
Merge pull request #31 from prasad-sawantdesai/Generalize-the---no-pr…
olivhoenen Jul 2, 2026
5a6ecaf
Feature/allow custom matplotlib backend (#33)
prasad-sawantdesai Jul 3, 2026
4f98020
Bump actions/setup-python from 6 to 7 in the actions-deps group
dependabot[bot] Jul 21, 2026
4f03438
Let matplotlib choose its default backend (#35)
prasad-sawantdesai Jul 24, 2026
17074e1
Fix/incorrect handling of error/warning when idslist is applied to a …
prasad-sawantdesai Jul 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# CODEOWNERS: Controls automatic assignment of reviewers for pull requests.
# -----------------------------------------------------------------------------
# When a pull request modifies files matching a pattern, the listed code owners will be requested as reviewers.
# Each line is a file pattern followed by one or more code owners (users or teams) who must review changes to that file.
# Do not edit unless specifically mandated to do so.

# Global/fallback and technical modifications.
* @SimonPinches @olivhoenen @prasad-sawantdesai
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: 2
updates:
# Enable version updates for Github Actions
- package-ecosystem: "github-actions"
# Look for `/.github/workflows` and `/action.yml` or `.yaml`
directory: "/"
# Check for updates once a week
schedule:
interval: "weekly"
# Group actions version bumps into a single PR
groups:
actions-deps:
patterns:
- "*"

4 changes: 2 additions & 2 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:

steps:
- name: Checkout IDStools sources
uses: actions/checkout@v4
uses: actions/checkout@v7

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v7
with:
# until saxonche is available in 3.13
# https://saxonica.plan.io/issues/6561
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
name: Build distribution
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v7
with:
# until saxonche is available in 3.13
# https://saxonica.plan.io/issues/6561
Expand All @@ -25,7 +25,7 @@ jobs:
- name: Build a binary wheel and a source tarball
run: python3 -m build .
- name: Store the distribution packages
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: python-package-distributions
path: dist/
Expand All @@ -43,7 +43,7 @@ jobs:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
uses: actions/download-artifact@v8
with:
name: python-package-distributions
path: dist/
Expand All @@ -63,7 +63,7 @@ jobs:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
uses: actions/download-artifact@v8
with:
name: python-package-distributions
path: dist/
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v7
with:
python-version: '3.11'
cache: 'pip'
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test_with_pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v7

- name: Set up Python ${{ matrix.python-version }}

uses: actions/setup-python@v4
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
- name: Display Python version
Expand All @@ -40,31 +40,31 @@ jobs:
TEST_PROFILE: ci

- name: Upload coverage report ${{ matrix.python-version }}
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: coverage-report-${{ matrix.python-version }}
path: htmlcov
if-no-files-found: warn

- name: Upload coverage XML ${{ matrix.python-version }}
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: coverage-xml-${{ matrix.python-version }}
path: coverage.xml
if-no-files-found: warn

- name: Upload test report ${{ matrix.python-version }}
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: test-report-${{ matrix.python-version }}
path: junit.xml
if-no-files-found: warn

- name: Upload test output logs ${{ matrix.python-version }}
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: test-output-${{ matrix.python-version }}
path: test_output.log
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/verify_with_sphinx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:

steps:
- name: Checkout IDStools sources
uses: actions/checkout@v4
uses: actions/checkout@v7

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v7
with:
# until saxonche is available in 3.13
# https://saxonica.plan.io/issues/6561
Expand Down Expand Up @@ -50,7 +50,7 @@ jobs:

- name: Upload Sphinx documentation as artifact
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: sphinx-documentation
path: docs/build/html/
Expand Down
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,20 @@ plotequilibrium --uri "imas:mdsplus?user=public;pulse=134174;run=117;database=IT

## Requirements

- Python ≥ 3.8
- IMAS Python Access Layer (`imas-python`)
- Python ≥ 3.10

### Installed automatically via pip
- NumPy, Matplotlib, Pandas
- Rich (for enhanced terminal output)

### Requires separate installation
- **Tkinter** — usually bundled with Python but may require system packages:
- Linux (Debian/Ubuntu): `sudo apt install python3-tk`
- Linux (RHEL/CentOS/Rocky): `sudo dnf install python3-tkinter`
- Windows: included in the [python.org](https://www.python.org/downloads/) installer ("tcl/tk and IDLE" component, enabled by default)
- macOS (python.org installer): included by default
- macOS (Homebrew): `brew install python-tk` (or `brew install python-tk@3.x` for a specific version)

## Documentation

Full documentation is available at the project repository. Each tool includes built-in help:
Expand Down
2 changes: 1 addition & 1 deletion ci-sdcc/st00-header.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ shopt -s expand_aliases
#print hostname
hostname -f

IMAS_EXISTS=$(module -r -t list 2>&1 | grep -E "IMAS-AL-Core|IMAS-Core" | head -n 1)
IMAS_EXISTS=$(module -r -t list 2>&1 | grep -E "IMAS-Core" | head -n 1)
if [ -n "$IMAS_EXISTS" ]; then
echo "> Found already loaded IMAS Module : $IMAS_EXISTS"
ACCESS_LAYER_VERSION=$(echo "$AL_VERSION" | cut -d '.' -f 1)
Expand Down
2 changes: 1 addition & 1 deletion ci-sdcc/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ getIMASCoreModuleName() {
DD_VERSION="$3"
fi
#Semantic versioning
IMASVERSIONSLIST=$(module -t avail IMAS-AL-Core/ 2>&1 | grep -E "^IMAS-AL-Core/$ACCESS_LAYER_VERSION\.[0-9]+\.[0-9]+-$TOOLCHAIN_VERSION")
IMASVERSIONSLIST=$(module -t avail IMAS-Core/ 2>&1 | grep -E "^IMAS-Core/$ACCESS_LAYER_VERSION\.[0-9]+\.[0-9]+-$TOOLCHAIN_VERSION")

if [[ $TOOLCHAIN_VERSION == *"intel"* ]]; then
CORE_MODULE_VERSION=$(echo "$IMASVERSIONSLIST" | grep "intel" | sort -rV | head -n 1)
Expand Down
2 changes: 1 addition & 1 deletion docs/source/cheatsheet.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ This cheat sheet provides quick reference of commonly used commands in IDStools.
| | |
| | $ plotequilibrium --uri "imas:mdsplus?user=public;pulse=134173;run=2326;database=TEST;version=3" |
| | -md "imas:mdsplus?user=public;pulse=111001;run=103;database=ITER_MD;version=3#pf_active" |
| | "imas:hdf5?user=public;pulse=116000;run=4;database=ITER_MD;version=3#wall" --rho |
| | "imas:hdf5?user=public;pulse=116000;run=4;database=ITER_MD;version=3#wall" --phi |
| | |
+----------------------------+------------------------------------------------------------------------------------------------------------------------------+
| *plotequicomp* | Shows plasma equilibrium and quantities related with it |
Expand Down
22 changes: 12 additions & 10 deletions docs/source/idsprint.rst
Original file line number Diff line number Diff line change
Expand Up @@ -183,16 +183,18 @@ It can also save generated figures to a specified directory or the default locat

$ idsprint --uri "imas:mdsplus?user=public;pulse=122481;run=1;database=ITER;version=3#edge_profiles/ggd[:]/electrons/density[1].values" -p

$ idsprint --uri "imas:mdsplus?user=public;pulse=134174;run=117;database=ITER;version=3#core_profiles/profiles_1d(:)/electrons/temperature" -p
$ idsprint --uri "imas:mdsplus?user=public;pulse=134174;run=117;database=ITER;version=3#core_profiles/profiles_1d(:)/electrons/temperature" -p

.. image:: _static/images/idsprint_1.png
:alt: image not found
:align: center
$ idsprint --uri "imas:mdsplus?user=public;pulse=134174;run=117;database=ITER;version=3#summary/time"

.. image:: _static/images/idsprint_2.png
:alt: image not found
:align: center
.. image:: _static/images/idsprint_1.png
:alt: image not found
:align: center

.. image:: _static/images/idsprint_3.png
:alt: image not found
:align: center
.. image:: _static/images/idsprint_2.png
:alt: image not found
:align: center

.. image:: _static/images/idsprint_3.png
:alt: image not found
:align: center
51 changes: 51 additions & 0 deletions docs/source/jupyter.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#######################
Jupyter notebook usage
#######################

IDStools command-line tools can also be used directly from Jupyter notebooks.
Import ``idstools`` once in the notebook kernel to register the IDStools
commands as IPython line magics:

.. code-block:: python

import idstools

After that, commands such as ``idsprint`` and ``plotequilibrium`` can be
called with ``%``:

.. code-block:: python

%idsprint -u "imas:hdf5?path=/work/imas/shared/imasdb/ITER/3/134174/117#core_profiles/profiles_1d[0]/electrons/temperature" -p

.. code-block:: python

%plotequilibrium -u "imas:hdf5?path=/work/imas/shared/imasdb/ITER/3/100507/5"


******************************
Interactive Matplotlib plots
******************************

For interactive Matplotlib figures in Jupyter, use the ``ipympl`` backend. If
``ipympl`` is installed in the same Python environment as IDStools, the backend
can be selected with Matplotlib's notebook magic before plotting:

.. code-block:: python

%matplotlib widget
import idstools

%idsprint -u "imas:hdf5?path=/work/imas/shared/imasdb/ITER/3/134174/117#core_profiles/profiles_1d[0]/electrons/temperature" -p

Alternatively, the backend can be selected through the IDStools ``--rc``
option before Matplotlib has been imported in the current kernel:

.. code-block:: python

import idstools

%idsprint -u "imas:hdf5?path=/work/imas/shared/imasdb/ITER/3/134174/117#core_profiles/profiles_1d[0]/electrons/temperature" -p --rc "backend='module://ipympl.backend_nbagg'"

.. code-block:: python

%plotequilibrium -u "imas:hdf5?path=/work/imas/shared/imasdb/ITER/3/100507/5" --rc "backend='module://ipympl.backend_nbagg'"
21 changes: 15 additions & 6 deletions docs/source/plotequilibrium.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,17 @@
#################

*plotequilibrium* script shows plasma equilibrium. Optionally it also
shows pf coils position and toroidal flux.
shows PF coil positions and a toroidal-flux contour overlay.
`refer data dictionary <https://imas-data-dictionary.readthedocs.io/en/latest/>`_.

``--phi`` overlays contours of the toroidal magnetic flux Φ(R,Z) [Wb] read directly from
``equilibrium/time_slice/profiles_2d/phi``:

.. math::

\Phi(R,Z) \quad [\mathrm{Wb}]


************************
Syntax plotequilibrium
************************
Expand All @@ -19,10 +27,11 @@ shows pf coils position and toroidal flux.

.. code-block:: bash

$ plotequilibrium --uri "imas:mdsplus?user=public;pulse=134174;run=117;database=ITER;version=3" --rho -md pf_active wall --plots
$ plotequilibrium --uri "imas:mdsplus?user=public;pulse=134174;run=117;database=ITER;version=3" --rho -md "imas:mdsplus?user=public;pulse=111001;run=103;database=ITER_MD;version=3#pf_active" "imas:mdsplus?user=public;pulse=116000;run=4;database=ITER_MD;version=3#wall"
$ plotequilibrium --uri "imas:mdsplus?user=public;pulse=134173;run=2326;database=TEST;version=3" --rho --md "imas:mdsplus?user=public;pulse=111001;run=103;database=ITER_MD;version=3#pf_active" "imas:hdf5?user=public;pulse=116000;run=4;database=ITER_MD;version=3#wall"

$ plotequilibrium --uri "imas:mdsplus?user=public;pulse=134174;run=117;database=ITER;version=3" --phi -md pf_active wall --profiles
$ plotequilibrium --uri "imas:mdsplus?user=public;pulse=134174;run=117;database=ITER;version=3" --phi -md "imas:mdsplus?user=public;pulse=111001;run=103;database=ITER_MD;version=3#pf_active" "imas:mdsplus?user=public;pulse=116000;run=4;database=ITER_MD;version=3#wall"
$ plotequilibrium --uri "imas:mdsplus?user=public;pulse=134173;run=2326;database=TEST;version=3" --phi --md "imas:mdsplus?user=public;pulse=111001;run=103;database=ITER_MD;version=3#pf_active" "imas:hdf5?user=public;pulse=116000;run=4;database=ITER_MD;version=3#wall"
$ plotequilibrium --uri "imas:hdf5?path=/work/imas/shared/imasdb/ITER/3/100507/5" --md "imas:hdf5?path=/work/imas/shared/imasdb/ITER_MD/3/116000/5#wall" --profiles --no-provenance

.. image:: _static/images/plotequilibrium.png
:alt: image not found
:align: center
Expand All @@ -33,4 +42,4 @@ shows pf coils position and toroidal flux.

.. image:: _static/images/plotequilibrium3.png
:alt: image not found
:align: center
:align: center
1 change: 1 addition & 0 deletions docs/source/tools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ Following are the different command line tools available in the
ids_manipulation_tools
database_tools
scenariodb_tools
jupyter
14 changes: 6 additions & 8 deletions idstools/compute/core_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,8 @@ def get_single_and_total_electrons_ions_waveforms(self, time_slice):
# single_power_waveform = dict() # waveform
# single_particles_waveform = dict() # waveform
time_length = len(self.ids.time)
total_power_waveform = np.zeros(time_length)
total_particles_waveform = np.zeros(time_length)
total_ion_power_waveform = np.zeros(time_length)
total_ion_particles_waveform = np.zeros(time_length)
single_power_waveform = {}
single_particles_waveform = {}
dict_single_and_total_electrons_waveforms = self.get_single_and_total_electrons_waveforms(time_slice)
Expand Down Expand Up @@ -398,16 +398,14 @@ def get_single_and_total_electrons_ions_waveforms(self, time_slice):
if total_ion_power < 0:
total_ion_power = 0.0

total_power_waveform[time_index] = (
total_electron_power_waveform[time_index] + electrons_power + total_ion_power
)
total_particles_waveform[time_index] = (
total_electron_particles_waveform[time_index] + electrons_particles
) + total_ion_particles
total_ion_power_waveform[time_index] += total_ion_power
total_ion_particles_waveform[time_index] += total_ion_particles
single_power_waveform[source_index].append(electrons_power + total_ion_power)
single_particles_waveform[source_index].append(electrons_particles + total_ion_particles)
single_power_waveform[source_index] = np.array(single_power_waveform[source_index])
single_particles_waveform[source_index] = np.array(single_particles_waveform[source_index])
total_power_waveform = total_electron_power_waveform + total_ion_power_waveform
total_particles_waveform = total_electron_particles_waveform + total_ion_particles_waveform
return {
"total_power_waveform": total_power_waveform,
"total_particles_waveform": total_particles_waveform,
Expand Down
Loading
Loading