<commit_before>
"""Interactive pyaccel module

Use this module to define variables and functions to be globally available when
using

    'from pyaccel.interactive import *'

Names starting with an underscore ('_') will not be exported. In addition to
the objects defined here, all objects in pyaccel with the '@interactive'
decorator will also be available. In order to use this decorator in a pyaccel
module, import it from pyaccel.utils with

    'from pyaccel.utils import interactive'
"""

import numpy as np
import matplotlib.pyplot as plt
import pyaccel as _pyaccel
import sirius.SI_V07 as _sirius_si


plt.ion()

create_accelerator = _sirius_si.create_accelerator

rx = 0
px = 1
ry = 2
py = 3
dl = 4
de = 5

__all__ = [name for name in dir() if not name.startswith('_')]

for f in _pyaccel.utils.interactive_list:
    name = f['name']
    module = getattr(_pyaccel, f['module'].split('.')[1])
    globals()[name] = getattr(module, name)
    __all__.append(name)

print('Names defined in pyaccel.interactive: ' + ', '.join(__all__) + '.\n')
print('Function create_accelerator from ' + _sirius_si.__name__ + '.')<commit_msg>Add pyaccel version information to interactive<commit_after>
"""Interactive pyaccel module

Use this module to define variables and functions to be globally available when
using

    'from pyaccel.interactive import *'

Names starting with an underscore ('_') will not be exported. In addition to
the objects defined here, all objects in pyaccel with the '@interactive'
decorator will also be available. In order to use this decorator in a pyaccel
module, import it from pyaccel.utils with

    'from pyaccel.utils import interactive'
"""

import numpy as np
import matplotlib.pyplot as plt
import pyaccel as _pyaccel
import sirius.SI_V07 as _sirius_si


plt.ion()

pyaccel_version = _pyaccel.__version__
create_accelerator = _sirius_si.create_accelerator

rx = 0
px = 1
ry = 2
py = 3
dl = 4
de = 5

__all__ = [name for name in dir() if not name.startswith('_')]

for f in _pyaccel.utils.interactive_list:
    name = f['name']
    module = getattr(_pyaccel, f['module'].split('.')[1])
    globals()[name] = getattr(module, name)
    __all__.append(name)

print('Names defined in pyaccel.interactive: ' + ', '.join(__all__) + '.\n')
print('Function create_accelerator from ' + _sirius_si.__name__ + '.')
{'fraction_non_alphanumeric': 0.09862778730703259, 'fraction_numerical': 0.007718696397941681, 'mean_word_length': 4.450934579439252, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3340306', 'n_tokens_mistral': 788, 'n_tokens_neox': 758, 'n_words': 269}