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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,6 @@ doc/source/auto_examples/

# do not commit nose tests files
*.noseids

# no pip wheel metadata
pip-wheel-metadata/
3 changes: 1 addition & 2 deletions examples/tutorials/tuto_plot_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think PEP8 will complain on line length, but it's no big deal

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment as Didier.

"""

# The following imports matplotlib, preferably using a
Expand Down
38 changes: 38 additions & 0 deletions examples/tutorials/tuto_plot_gallery_fusion_machines.py
Original file line number Diff line number Diff line change
@@ -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()