diff --git a/.gitignore b/.gitignore index a94e3bed3..e382e1279 100644 --- a/.gitignore +++ b/.gitignore @@ -70,3 +70,6 @@ doc/source/auto_examples/ # do not commit nose tests files *.noseids + +# no pip wheel metadata +pip-wheel-metadata/ diff --git a/examples/tutorials/tuto_plot_basic.py b/examples/tutorials/tuto_plot_basic.py index 5f4a63265..ca804088d 100644 --- a/examples/tutorials/tuto_plot_basic.py +++ b/examples/tutorials/tuto_plot_basic.py @@ -2,8 +2,7 @@ Getting started: 5 minutes tutorial for `tofu` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -This is a tutorial that aims to get a new user a little familiar with tofu's - structure. +This is a tutorial that aims to get a new user a little familiar with tofu's structure. """ # The following imports matplotlib, preferably using a diff --git a/examples/tutorials/tuto_plot_gallery_fusion_machines.py b/examples/tutorials/tuto_plot_gallery_fusion_machines.py new file mode 100644 index 000000000..ebadfeb12 --- /dev/null +++ b/examples/tutorials/tuto_plot_gallery_fusion_machines.py @@ -0,0 +1,38 @@ +""" +A gallery of Fusion Machines +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +This tutorial functions as a gallery of fusion machines that can easily be loaded with `tofu`. +""" + +############################################################################### +# We start by importing `tofu`. + +import tofu as tf + +############################################################################### +# `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. + +config = tf.geom.utils.create_config() +print(config) + +############################################################################### +# To get a list of all available built-in configs, one has to know some details about `tofu`. +# Configurations can either be accessed by names (ITER, WEST, JET). + +print(tf.geom.utils._DCONFIG_TABLE.keys()) + +############################################################################### +# With that being said, let's create a gallery of the "top 3" fusion machines provided by `tofu` to accelerate +# diagnostic development. + +import matplotlib.pyplot as plt + +fig, ax = plt.subplots() +for fusion_machine in ['ITER', 'WEST', 'JET']: + config = tf.geom.utils.create_config(fusion_machine) + config.plot() \ No newline at end of file