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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Contents

How to install tofu <installation.rst>
A guide to contributing to tofu <contributing.rst>
A list of all different device configurations available (ITER, WEST, JET, ...) <auto_examples/tutorials/tuto_plot_gallery_fusion_machines.rst>
Tutorials and examples <auto_examples/index.rst>

* How to create / handle a diagnostic geometry
Expand Down
27 changes: 14 additions & 13 deletions examples/tutorials/tuto_plot_gallery_fusion_machines.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
A gallery of Fusion Machines
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This tutorial functions as a gallery of fusion machines that can easily be loaded with `tofu`.
This tutorial functions as a gallery of fusion machines that can easily be
loaded with `tofu`.
"""

###############################################################################
Expand All @@ -11,28 +12,28 @@
import tofu as tf

###############################################################################
# `tofu` provides a geometry helper function that allows creating a configuration with a single call.
# `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
# 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()
config = tf.geom.utils.create_config() # create default configuration
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).
# 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())

###############################################################################
# With that being said, let's create a gallery of the "top 3" fusion machines provided by `tofu` to accelerate
# diagnostic development.
# 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()
config.plot()