Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
c69784a
bugfix for zero-length girders
kparasch Dec 9, 2025
a4a088f
bugfix of tau in atlattice
kparasch Dec 12, 2025
094076f
add configuration of injection in yaml
kparasch Dec 12, 2025
1198223
make warning appear only when there is warning
kparasch Dec 15, 2025
58a1d76
injection conf vars were not float
kparasch Dec 15, 2025
a945d6f
avoid division by zero and raise warning
kparasch Dec 16, 2025
266f411
chromaticity correction (only cheating for now)
kparasch Dec 16, 2025
15b21d1
bugfix in trajectory bba config
kparasch Dec 18, 2025
3a299f0
tuning method to randomly modify last horizontal and vertical correct…
kparasch Dec 19, 2025
bd3b5f3
cheat tune also with integer part
kparasch Jan 6, 2026
c41b63b
add knob method in magnet settings and c minus calculation (first tes…
kparasch Jan 6, 2026
24a1796
enable usage of closed orbit guess
kparasch Jan 7, 2026
10f89c9
rdt calculation
kparasch Jan 7, 2026
cbae9f8
rename tune.trim_tune to tune.trim
kparasch Jan 7, 2026
58b7b37
change nan value to 0
kparasch Jan 7, 2026
a5ad71f
changed functions to use tune.trim instead of tune.trim_tune
kparasch Jan 7, 2026
1bd6bfc
attach information to each control according to what it is supposed t…
kparasch Jan 7, 2026
1c15e65
linear normal form for the calculation of c-minus
kparasch Jan 8, 2026
5ad1f5c
knobdata class and cminus tuning tool
kparasch Jan 8, 2026
9781db6
sort controls update using the control info
kparasch Jan 9, 2026
0536503
config of c_minus
kparasch Jan 9, 2026
5033161
pydantic BaseModel extension with save_as function
kparasch Jan 9, 2026
e40cb74
some info printing about knobs
kparasch Jan 9, 2026
b97f56d
Merge pull request #15 from kparasch/rdt
kparasch Jan 9, 2026
daed621
orbit bba changes
kparasch Jan 16, 2026
5d97085
missing SC
kparasch Jan 22, 2026
a37d92d
Merge branch 'ebs_MDT' into BigMerge
kparasch Jan 22, 2026
496dc3b
zersum argument missing
kparasch Jan 22, 2026
01a838d
remove actions
kparasch Jan 22, 2026
bb1506f
Merge branch 'main' into BigMerge
kparasch Jan 22, 2026
d8193eb
bump version
kparasch Jan 22, 2026
38ec14f
trajectory bba
kparasch Jan 26, 2026
6d8f283
Merge branch 'main' into BigMerge
kparasch Jan 30, 2026
ece96d7
Merge branch 'ebs_MDT' into BigMerge
kparasch Jan 30, 2026
1121374
fix in import error and other unused imports
kparasch Feb 6, 2026
6531d05
move response_matrix
kparasch Feb 9, 2026
e622379
adapt rm for coupling
kparasch Feb 9, 2026
2f36a39
split interfaces
kparasch Feb 9, 2026
61c6ca8
move imports of response matrix
kparasch Feb 9, 2026
e29394a
trajectory response matrix measurement with app
kparasch Feb 9, 2026
6d44ad7
use app in measure orbit response matrix
kparasch Feb 9, 2026
f3a6c44
trim down
kparasch Feb 9, 2026
c9cbc51
use dispersion app
kparasch Feb 9, 2026
99afcd6
code formatting
kparasch Feb 9, 2026
35a42d5
use logger instead of print
kparasch Feb 9, 2026
27e627b
bugfix on responsematrix warning
kparasch Feb 10, 2026
c1c2c39
configuration on tune from yaml file and control of tune with knobs
kparasch Feb 10, 2026
e359cb1
checks to not discard inverse matrix cache unnecessarily
kparasch Feb 10, 2026
1c7960b
app for correct_injection
kparasch Feb 10, 2026
e72b43f
option for single plane BBA
kparasch Feb 10, 2026
f3b5e90
options to get raw orbit data (for bba)
kparasch Feb 10, 2026
c8e0af2
single plane bba
kparasch Feb 10, 2026
c140ddd
use app for trajectory bba
kparasch Feb 10, 2026
89ce448
app orbit correction
kparasch Feb 10, 2026
9a6e798
bba and subtract_reference also in orbit interface
kparasch Feb 10, 2026
2be31f2
orbit bba to use app, and moved analysis function in apps. to tidy up…
kparasch Feb 10, 2026
262d6c8
moved pySC/tuning/tools.py to pySC/apps
kparasch Feb 11, 2026
26ca3d9
trim down a bit the defaults
kparasch Feb 12, 2026
e3aa5f4
centralized analysis for bba
kparasch Feb 12, 2026
d0db9d6
remove unused things
kparasch Feb 12, 2026
eb56c10
this was not fully removed before
kparasch Feb 12, 2026
f468092
use ResponseMatrix.matrix instead of ResponseMatrix.RM
kparasch Feb 12, 2026
f3ba56e
remove some more legacy code
kparasch Feb 12, 2026
670b9d0
rename new_simulated_commissioning to simulated_commissioning
kparasch Feb 12, 2026
ee17746
first major version!
kparasch Feb 12, 2026
e9943f7
import apps also in pySC
kparasch Feb 12, 2026
b49eeb5
update readme
kparasch Feb 12, 2026
2d8b793
logging format fix and remove unused variable
kparasch Feb 12, 2026
59279c9
np.concatenate
oscarxblanco Feb 2, 2026
92a1f5f
Merge branch 'main' into BigMerge
kparasch Feb 12, 2026
8ccc6ff
remove comment
kparasch Feb 12, 2026
df9d4b6
file was forgotten unsaved
kparasch Feb 13, 2026
2676411
gain missing !
kparasch Feb 13, 2026
359389b
small simplifcation
kparasch Feb 13, 2026
5eb16d0
optimization, do not initialize at each SC validation
kparasch Feb 13, 2026
a620cd2
small bugfix
kparasch Feb 16, 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
35 changes: 31 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,37 @@
# pySC
Python Simulated Commissioning toolkit for synchrotrons, inspired by [SC](https://github.com/ThorstenHellert/SC) which is written in Matlab.

Python Simulated Commissioning toolkit for synchrotrons.

## Installing

```bash
git clone https://github.com/kparasch/pySC
cd pySC
pip install -e .
pip install accelerator-commissioning
```

## Importing specific modules

Intended way of importing a pySC functionality:

```
from pySC import SimulatedCommissioning
from pySC import generate_SC

from pySC import ResponseMatrix

from pySC import orbit_correction
from pySC import measure_bba
from pySC import measure_ORM
from pySC import measure_dispersion

from pySC import pySCInjectionInterface
from pySC import pySCOrbitInterface

# the following disables rich progress bars (doesn't work well with )
from pySC import disable_pySC_rich
disable_pySC_rich()
```


## Acknowledgements

This toolkit was inspired by [SC](https://github.com/ThorstenHellert/SC) which is written in Matlab.
31 changes: 24 additions & 7 deletions pySC/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,43 @@

"""

__version__ = "0.4.5"
__version__ = "1.0.0"

from .core.new_simulated_commissioning import SimulatedCommissioning
from .core.simulated_commissioning import SimulatedCommissioning
from .configuration.generation import generate_SC
from .tuning.response_matrix import ResponseMatrix

from .apps.response_matrix import ResponseMatrix
from .apps.measurements import orbit_correction
from .apps.measurements import measure_bba
from .apps.measurements import measure_ORM
from .apps.measurements import measure_dispersion
from .tuning.pySC_interface import pySCInjectionInterface, pySCOrbitInterface
import logging
import sys

logging.basicConfig(
#format='%(asctime)s.%(msecs)03d:%(levelname)s:%(name)s:\t%(message)s',
format="{asctime} | {levelname} | {message}",
datefmt="%d %b% %Y, %H:%M:%S",
datefmt="%d %b %Y, %H:%M:%S",
level=logging.INFO,
style='{',
stream=sys.stdout
)

def disable_pySC_rich():
from .tuning import response_measurements
from .apps import response
response_measurements.DISABLE_RICH = True
response.DISABLE_RICH = True

# This is needed to avoid circular imports.
# Firstly the type of SC is hinted to avoid importing SimulatedCommissioning:
# class pySCOrbitInterface(AbstractInterface):
# SC: "SimulatedCommissioning" = Field(repr=False)
#
# Then, the model_rebuild is triggered here to complete the pydantic model,
# and allow validation.
# for this to be triggered, one needs to import pySC or to import from pySC
# (i.e. from pySC import ...)
# to validate a pySCInjectionInterface/pySCOrbitInterface object, one should
# already have a SimulatedCommissioning object. To acquire the SimulatedCommissioning,
# the model_rebuild is "almost certainly"? triggered.
pySCInjectionInterface.model_rebuild()
pySCOrbitInterface.model_rebuild()
Loading