Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
3dde4eb
Honour lattice_names when a linker is configured (#429)
GamelinAl Sep 17, 2026
6091ea7
Merge pull request #431 from python-accelerator-middle-layer/429-latt…
GamelinAl Sep 17, 2026
eff076c
Added an error throw for setting magnet with zero length.
gubaidulinvadim Sep 17, 2026
b2848d2
Force length=1.0 if the element is thin, assuming that integrated str…
gubaidulinvadim Sep 18, 2026
40016c2
Config example for BPM
gubaidulinvadim Sep 18, 2026
776acb6
Updated to have a custom Configuration section
gubaidulinvadim Sep 18, 2026
a39b074
Configuration example for diagnostics
gubaidulinvadim Sep 18, 2026
938a582
Configuration example for RF
gubaidulinvadim Sep 18, 2026
bb7d2aa
Configuration example for tuning tools
gubaidulinvadim Sep 18, 2026
1ef4e48
Addded example config for magnets and magnet models
gubaidulinvadim Sep 18, 2026
96c83e1
Merge pull request #441 from python-accelerator-middle-layer/issue-44…
gubaidulinvadim Sep 18, 2026
7fdf3de
Update logo to version which renders correctly.
TeresiaOlsson Sep 18, 2026
1471da4
Implement suggestion in #360
GamelinAl Sep 18, 2026
72b3351
Merge pull request #448 from python-accelerator-middle-layer/update-logo
gubaidulinvadim Sep 18, 2026
741b9da
Test new config for documentation
GamelinAl Sep 23, 2026
fc06a59
Merge pull request #453 from python-accelerator-middle-layer/447-docs…
GamelinAl Sep 24, 2026
b4dffed
Merge pull request #435 from python-accelerator-middle-layer/fix-zero…
GamelinAl Sep 24, 2026
cdec557
Complete magnet holder navigation (#373)
gupichon-soleil Sep 16, 2026
3a8a897
Add a public diagnostic holder
gupichon-soleil Sep 17, 2026
5a7fea8
Add a public tuning and measurement tool holder
gupichon-soleil Sep 17, 2026
86928b2
Move BPM holders under DiagnosticHolder
gupichon-soleil Sep 18, 2026
895d651
Unify name/wildcard/regex lookup and miss-behavior across holders
gupichon-soleil Sep 18, 2026
b458038
Unify name/wildcard/regex lookup and miss-behavior across holders
gupichon-soleil Sep 18, 2026
b229b01
Support ~ exclusion patterns in the public list-of-patterns resolver
gupichon-soleil Sep 21, 2026
4f4c017
Correction of pattern parsing
gupichon-soleil Sep 24, 2026
ca492f7
Correction of pattern parsing for order and auto typing
gupichon-soleil Sep 24, 2026
f576343
Fix aggregator crash when a set operation auto-types to a CFM or seri…
gupichon-soleil Sep 24, 2026
279fea0
Add a test for array order
GamelinAl Sep 24, 2026
db35db7
Normalize list-selection order to configuration order across every ho…
gupichon-soleil Sep 28, 2026
e1fa687
Remove ElementHolder backward-compatible tool aliases per review
gupichon-soleil Sep 28, 2026
24d9743
template variation 2
kparasch Sep 28, 2026
314ca97
Merge pull request #455 from python-accelerator-middle-layer/elementh…
gupichon Sep 30, 2026
2144ec4
no longer serializing into a dictionary. Instead walking through dict…
kparasch Sep 30, 2026
e9d1cf5
Cleaner way of registering templates
kparasch Sep 30, 2026
26669b9
Catch RecursionError in case it is caused by excessive recursive temp…
kparasch Sep 30, 2026
0f7c180
Change to instance-based template managers that are attached to the c…
kparasch Sep 30, 2026
957d2c2
add tests for templates
kparasch Sep 30, 2026
da31172
Allow templates with zero arguments.
kparasch Sep 30, 2026
d4721f7
docstring improvement
kparasch Sep 30, 2026
702bda3
fix typehints
kparasch Sep 30, 2026
4ef3b78
rename template_codes to template_configs
kparasch Sep 30, 2026
49a49a5
Allow for BPM with a single position
GamelinAl Oct 1, 2026
6f3d0f5
Fix SerializedMagnets attachment to a control system (#458)
GamelinAl Oct 1, 2026
18f8e62
ElementHolder.get() resolves named arrays of any type; drop supersede…
gupichon-soleil Oct 1, 2026
5ec15ea
Remove ElementHolder.get_chromaticity_monitor/get_bba, superseded by …
gupichon-soleil Oct 1, 2026
5a9cb5c
Merge pull request #462 from python-accelerator-middle-layer/elementh…
gupichon Oct 2, 2026
b93d97d
Moving BPMs to diagnostics
gupichon-soleil Oct 5, 2026
59bbb47
Rename file resolver to include.
TeresiaOlsson Oct 5, 2026
951e2d7
Merge pull request #464 from python-accelerator-middle-layer/moving-b…
gupichon Oct 5, 2026
41790b6
Remove support for automatic inclusion of files with specific file ex…
TeresiaOlsson Oct 5, 2026
836eb54
Update example configurations to new syntax.
TeresiaOlsson Oct 5, 2026
a44e04a
Merge pull request #459 from python-accelerator-middle-layer/457-bpm-…
GamelinAl Oct 6, 2026
b28e3d5
Merge pull request #460 from python-accelerator-middle-layer/458-seri…
GamelinAl Oct 6, 2026
12a9153
Merge pull request #465 from python-accelerator-middle-layer/include-…
gubaidulinvadim Oct 6, 2026
28c4b15
Merge remote-tracking branch 'origin/main' into 199-elementholder-api…
GamelinAl Oct 7, 2026
bad4edc
Fix dt4acc_twin_smoke test to resolve catalog via ConfigurationManage…
gupichon-soleil Oct 7, 2026
6f9d7f1
Merge pull request #430 from python-accelerator-middle-layer/199-elem…
gupichon Oct 7, 2026
1fcfb64
Support for transfer line
JeanLucPons Oct 8, 2026
1b3c17f
Fix typing
JeanLucPons Oct 8, 2026
b11fdaf
Merge pull request #466 from python-accelerator-middle-layer/transfer…
JeanLucPons Oct 8, 2026
620bb9c
Fix TL2 tests, usage of ThinMPolePass and corrected calibration factor
JeanLucPons Oct 8, 2026
c7cf416
Merge pull request #467 from python-accelerator-middle-layer/fix-tl2-…
JeanLucPons Oct 8, 2026
4d9e014
Update action comments
JeanLucPons Oct 13, 2026
5d90404
Merge pull request #476 from python-accelerator-middle-layer/update-a…
JeanLucPons Oct 13, 2026
188e764
Merge pull request #456 from python-accelerator-middle-layer/feature/…
gubaidulinvadim Oct 15, 2026
d939f7e
Revert "Feature: template in configuration file, 2nd variation"
gubaidulinvadim Oct 15, 2026
c37d636
Merge pull request #484 from python-accelerator-middle-layer/revert-4…
gubaidulinvadim Oct 15, 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
20 changes: 7 additions & 13 deletions docs/source/_static/_logo/pyaml-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions docs/source/_static/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@
.api-generation {
display: none;
}

.pyaml-member-summary td p {
margin-bottom: 0;
}
56 changes: 54 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html


import re

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

Expand Down Expand Up @@ -32,16 +34,66 @@
autodoc_typehints_format = "short"
# autosummary_generate_overwrite = False
# autosummary_ignore_module_all = False
autoclass_content = "both" # include both class docstring and __init__
# Class docstrings document the constructor parameters; __init__ docstrings are not rendered.
autoclass_content = "class"

napoleon_use_rtype = False # More legible
# napoleon_numpy_docstring = False # Force consistency, leave only Google
# napoleon_custom_sections = [("Returns", "params_style")]
napoleon_custom_sections = ["Configuration"]

templates_path = ["_templates"]
exclude_patterns = []


# -- Class docstring "Methods"/"Attributes" sections ---------------------------
# Class docstrings list their methods and attributes so that ``help(obj)`` is
# self-contained. autodoc already documents each member from its own docstring,
# so on the rendered page the ``.. method::`` / ``.. attribute::`` blocks that
# napoleon emits for these sections are collapsed into a linked summary table
# instead of a second full description of every member.

_MEMBER_DIRECTIVE = re.compile(r"^\.\. (method|attribute):: (\S[^(]*)")
_SUMMARY_TITLES = {"attribute": ("Attributes", "attr"), "method": ("Methods", "meth")}


def _read_member_block(lines, i):
"""Return ``(kind, member, description, next_index)`` for the directive at ``lines[i]``."""
kind, member = _MEMBER_DIRECTIVE.match(lines[i]).groups()
description = []
i += 1
while i < len(lines) and (not lines[i].strip() or lines[i].startswith(" ")):
text = lines[i].strip()
if text and not text.startswith(":"): # skip directive options such as ``:type:``
description.append(text)
i += 1
return kind, member.strip(), " ".join(description), i


def summarize_member_sections(app, what, name, obj, options, lines):
if what != "class":
return
out = []
i = 0
while i < len(lines):
if not _MEMBER_DIRECTIVE.match(lines[i]):
out.append(lines[i])
i += 1
continue
kind = _MEMBER_DIRECTIVE.match(lines[i]).group(1)
title, role = _SUMMARY_TITLES[kind]
out += [f".. rubric:: {title}", "", ".. list-table::", " :widths: 30 70", " :class: pyaml-member-summary", ""]
while i < len(lines) and (m := _MEMBER_DIRECTIVE.match(lines[i])) and m.group(1) == kind:
_, member, description, i = _read_member_block(lines, i)
out += [f" * - :py:{role}:`~{name}.{member}`", f" - {description}"]
out.append("")
lines[:] = out


def setup(app):
# Run after napoleon (default priority 500), which produces the member directives.
app.connect("autodoc-process-docstring", summarize_member_sections, priority=600)


# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

Expand Down
2 changes: 1 addition & 1 deletion examples/other_examples/ControlSystem/tango/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ controls:
name: live
data_folder: /data/store
devices:
- type: pyaml.bpm.bpm
- type: pyaml.diagnostics.bpm.bpm
name: BPM_C01-01
x_pos: srdiag/bpm/c01-01/SA_HPosition
y_pos: srdiag/bpm/c01-01/SA_VPosition
2 changes: 1 addition & 1 deletion examples/other_examples/ControlSystem/tango/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
sr = Accelerator.load("config.yaml")

# print the BPM position
bpm = sr.live.bpm.get("BPM_C01-01") # bpm is a BPM
bpm = sr.live.diagnostic.bpm.get("BPM_C01-01") # bpm is a BPM
print(bpm.positions.get())

# Direct access to control system
Expand Down
4 changes: 2 additions & 2 deletions examples/other_examples/ORM_Tango_server/ORM.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ def orbit_callback(self, action: int, cdata):

def orm_run(self):
# On design sleep 10ms to allow thread schedule
self.SR.design.orm.measure(callback=orbit_callback, sleep_between_meas=0.01)
self.orm_data = self.SR.design.orm.get()
self.SR.design.tool.orm.measure(callback=orbit_callback, sleep_between_meas=0.01)
self.orm_data = self.SR.design.tool.orm.get()
self.set_status(f"Ready to scan: {self.ConfigFileName}")
self.set_state(DevState.ON)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,6 @@ def unit(self) -> str:

# Main code
sr = Accelerator.from_dict(acc_config)
tm1 = sr.live.get_betatron_tune_monitor("MY_TUNE_MONITOR")
tm1 = sr.live.diagnostic.get("MY_TUNE_MONITOR")
print(tm1.tune.get())
print(tm1.frequency.get())
209 changes: 12 additions & 197 deletions examples/use_cases/01-tune_correction.ipynb

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions examples/use_cases/01-tune_correction.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
# In[4]:


tune_monitor = SR.get_betatron_tune_monitor("BETATRON_TUNE")
tune_monitor = SR.diagnostic.get("BETATRON_TUNE")
print(f"Current tune: {tune_monitor.tune.get()}")
print(tune_monitor) # string representation

Expand Down Expand Up @@ -112,14 +112,14 @@

# ### Standard tune correction tool
#
# `SR.tune` is the `DEFAULT_TUNE_CORRECTION` tool. `SR.trm` is the `DEFAULT_TUNE_RESPONSE_MATRIX` tool.
# `SR.tool.tune` is the `DEFAULT_TUNE_CORRECTION` tool. `SR.tool.trm` is the `DEFAULT_TUNE_RESPONSE_MATRIX` tool.
#
# Before correcting the tune you need a response matrix. It can be measured (below) or loaded from a previously saved file.

# In[7]:


print(SR.tune) # string representation
print(SR.tool.tune) # string representation


# #### Measuring the tune response matrix
Expand All @@ -145,36 +145,36 @@ def tune_callback(action: int, cb_data: dict):
# In[9]:


if SR.tune.response_matrix is None:
SR.trm.measure(sleep_between_step=wait_time, callback=tune_callback)
SR.trm.save(CONFIG_DIR / "trm.json")
if SR.tool.tune.response_matrix is None:
SR.tool.trm.measure(sleep_between_step=wait_time, callback=tune_callback)
SR.tool.trm.save(CONFIG_DIR / "trm.json")

SR.tune.load(CONFIG_DIR / "trm.json")
SR.tool.tune.load(CONFIG_DIR / "trm.json")
print("Response matrix loaded.")
print(SR.trm) # string representation
print(SR.tool.trm) # string representation


# #### Correcting the tune
#
# `SR.tune.set([qx, qy])` runs the correction iteratively. The `iter` parameter controls
# `SR.tool.tune.set([qx, qy])` runs the correction iteratively. The `iter` parameter controls
# the number of iterations and `wait_time` the settling time between each iteration.

# In[10]:


print(f"Tune before correction: {SR.tune.readback()}")
print(f"Tune before correction: {SR.tool.tune.readback()}")

qx, qy = 0.19, 0.28
print(f"\nSetting tune to [{qx}, {qy}]")
SR.tune.set([qx, qy], iter=10, wait_time=wait_time)
print(f"Tune after correction: {SR.tune.readback()}")
SR.tool.tune.set([qx, qy], iter=10, wait_time=wait_time)
print(f"Tune after correction: {SR.tool.tune.readback()}")

qx, qy = 0.21, 0.30
print(f"\nSetting tune to [{qx}, {qy}]")
SR.tune.set([qx, qy], iter=10, wait_time=wait_time)
print(f"Tune after correction: {SR.tune.readback()}")
SR.tool.tune.set([qx, qy], iter=10, wait_time=wait_time)
print(f"Tune after correction: {SR.tool.tune.readback()}")

print(SR.tune) # string representation
print(SR.tool.tune) # string representation


# In[ ]:
2 changes: 1 addition & 1 deletion examples/use_cases/02-chromaticity_measurement.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
}
],
"source": [
"chroma_monitor = SR.get_chromaticity_monitor(\"CHROMATICITY_MONITOR\")\n",
"chroma_monitor = SR.tool.get(\"CHROMATICITY_MONITOR\")\n",
"\n",
"chroma_monitor.measure(\n",
" callback=chroma_callback,\n",
Expand Down
2 changes: 1 addition & 1 deletion examples/use_cases/02-chromaticity_measurement.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def chroma_callback(action: int, cb_data: dict):
# In[17]:


chroma_monitor = SR.get_chromaticity_monitor("CHROMATICITY_MONITOR")
chroma_monitor = SR.tool.get("CHROMATICITY_MONITOR")

chroma_monitor.measure(
callback=chroma_callback,
Expand Down
Loading
Loading