Additional tools for particle accelerator data analysis and machine information

Overview

PyLHC Tools

Cron Testing Code Climate coverage Code Climate maintainability (percentage) GitHub last commit GitHub release

This package is a collection of useful scripts and tools for the Optics Measurements and Corrections group (OMC) at CERN.

Documentation

Getting Started

This package is Python 3.7+ compatible, and can be installed through pip:

pip install pylhc

One can also install from VCS:

git clone https://github.com/pylhc/PyLHC
pip install /path/to/PyLHC

Or simply from the online master branch, which is stable:

pip install git+https://github.com/pylhc/PyLHC.git#egg=pylhc

After installing, scripts can be run with either python -m pylhc.SCRIPT --FLAG ARGUMENT or by calling the .py files directly.

Note: some scripts access functionality only available on the CERN Technical Network. To use those, you should make sure to install the relevant extra dependencies with pip install path/to/Pylhc[cern].

Description

This package provides tools for particle accelerator data analysis, simulations management and machine information extraction; complementing the optics measurement analysis tools of the omc3 package.

Functionality

  • Forced DA Analysis - Script to analyse forced DA. (forced_da_analysis.py)
  • Machine Settings Info - Prints an overview over the machine settings at a given time. (machine_settings_info.py)
  • BSRT Logger and BSRT Analysis - Saves data coming straight from LHC BSRT FESA class and allows subsequent analysis. (bsrt_logger.py & bsrt_analysis.py )
  • BPM Calibration Factors - Compute the BPM calibration factors using ballistic optics. Two methods are available: using the beta function and using the dispersion. (bpm_calibration.py)

Quality checks

  • Unit and accuracy tests are run automatically through CI Github Actions. See our workflows in this readme.
  • Additional checks for code-complexity, design-rules, test-coverage and duplication are made through CodeClimate.
  • Pull requests implementing functionality or fixes are merged into the master branch after passing CI, and getting a reviewer's approval.

Changelog

See the CHANGELOG file.

Hints for Developers

In case you want to contribute to PyLHC's development, you should install it in editable mode:

git clone https://github.com/pylhc/PyLHC
pip install --editable PyLHC

You can install extra dependencies (as defined in setup.py) suited to your use case with the following commands:

pip install --editable PyLHC[cern]
pip install --editable PyLHC[test]
pip install --editable PyLHC[test,doc]
pip install --editable PyLHC[all]

Open an issue, make your changes in a branch and submit a pull request.

Authors

  • pyLHC/OMC-Team - Working Group - pyLHC

License

This project is licensed under the GNU GPLv3 License - see the LICENSE file for details.

Comments
  • BPM Calibration

    BPM Calibration

    opened by Mael-Le-Garrec 5
  • Properly organise extra dependencies for the CERN GPN

    Properly organise extra dependencies for the CERN GPN

    This is essentially https://github.com/pylhc/omc3/issues/272 applied to this package. I will also rename the extra from tech to cern as agreed in https://github.com/pylhc/omc3/pull/273.

    Enhancement Feature Release 
    opened by fsoubelet 2
  • Refactor for consistency

    Refactor for consistency

    Refactor for consistency with other pylhc packages, which should close #41

    There's some imports changes in there from Pycharm's optimize imports, but the important changes are in setup.py and conf.py. Includes dependencies version updates.

    Important change regarding pyjapc, which is not kept up-to-date on PyPI (and installing from master can mess things up badly in builds): it is now declared as an extra dependency ([tech]) as we discussed on Mattermost, but this can still change. Tbd in this PR.

    Moving to GA will be in another issue / PR.

    opened by fsoubelet 2
  • Update setup for consistency with pylhc packages

    Update setup for consistency with pylhc packages

    Would also be a good time to think about the dependencies' versions.

    Since we're all fine with pandas 1.x in other packages, we probably shouldn't require 0.25.x here.

    Enhancement 
    opened by fsoubelet 2
  • SDDS update for llong

    SDDS update for llong

    Hi,

    The new format for sdds files often uses llong format. I was able to use your code with the following modifications : classes.py, line 17-19 : add llong format (>i8, 8, int) reader.py line 139 : convert num_dims to int -> int(num_dims)

    Thank you for the good work! Is there any plan to add ascii compatibility?

    opened by pbelange 2
  • LSA knob to MAD-X script converter

    LSA knob to MAD-X script converter

    Adds a script which can take an LSA knob and an optics it is defined for to create both a definition TFS file and a MAD-X script which will reproduce the knob in simulations.

    The script can also be fed a text file with many knobs definitions as well as their trim values, and run for all of these knobs. See examples in the module docstring.

    opened by fsoubelet 1
  • Remove submitter scripts

    Remove submitter scripts

    Closes #71

    Removed:

    • Entrypoint scripts for job_submitter and autosix
    • The htc and sixdesk_tools modules
    • Tests for the above
    • Documentation files for the modules and the entrypoints
    • Mentions in the README
    Release Request 
    opened by fsoubelet 1
  • Import ABCs from the proper modules

    Import ABCs from the proper modules

    Current job_submitter raises the following:

    DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3,and in 3.9 it will stop working
      from collections import OrderedDict, Iterable
    

    Should be a very quick change to become compliant (the warning is for Iterable only though).

    Enhancement 
    opened by fsoubelet 1
  • Fix lsa to madx writer

    Fix lsa to madx writer

    • LSA to MADX sign convention
    • Better trim naming
    • check madx names for allowed characters
    • option to init all variables
    • machine settings info takes ISO time
    opened by JoschD 0
  • CI Updates

    CI Updates

    Update to the CI workflows making use of the newer versions of certain official worflows.

    • Caching and cache management left to the setup-python action
    • Properly call pip as module everywhere
    • Do not run the build (and build check) twice in the publish repo
    CI/CD 
    opened by fsoubelet 0
  • Rewrite Forced_DA to da_analysis

    Rewrite Forced_DA to da_analysis

    Allow input of measurements from blown-up beams, (single) kicked beams and excited beams (forced da) via switches.

    • add missing formulas
    • input to be checked for heated (no kick)
    • input also nominal emittance (HL-LHC)
    opened by JoschD 0
  • add script to calculate RDT from tracking data

    add script to calculate RDT from tracking data

    complementary to metaclass/opticsclass, create script which takes PTC trackone data and returns processed RDTs

    compared to omc3 RDT reconstruction, no px reconstruction necessary

    Enhancement 
    opened by mihofer 3
Releases(0.7.4)
  • 0.7.4(Oct 19, 2022)

    Path release 0.7.4:

    Changes in Machine Settings Info

    • Default behaviour for no knobs given(no --knobs or knobs=None): extract None.
    • Old behaviour of extracting all restored by giving knobs = ["all"] (CLI: --knobs all)
    • Option ["default"] available for default knobs as used in OMC3. (CLI: --knobs default)
    • Additional debug logging

    What's Changed

    • Machine settings debug logging and knobs by @JoschD in https://github.com/pylhc/PyLHC/pull/105

    Full Changelog: https://github.com/pylhc/PyLHC/compare/0.7.3...0.7.4

    Source code(tar.gz)
    Source code(zip)
  • 0.7.3(Oct 11, 2022)

    Release 0.7.3 is a patch release which fixes:

    • LSA to MADX sign convention
    • Better trim naming
    • check madx names for allowed characters
    • option to init all variables
    • machine settings info takes ISO time

    What's Changed

    • CI Updates by @fsoubelet in https://github.com/pylhc/PyLHC/pull/103
    • Fix lsa to madx writer by @JoschD in https://github.com/pylhc/PyLHC/pull/104

    Full Changelog: https://github.com/pylhc/PyLHC/compare/0.7.2...0.7.3

    Source code(tar.gz)
    Source code(zip)
  • 0.7.2(May 31, 2022)

    Release 0.7.2 brings a fix to the lsa_to_madx module, ensuring it does not make the user run into a MAD-X bug later on when using the created knobs.

    Fixed:

    • Trim variables generated in the MAD-X script will make sure not to be longer than 47 characters (hard MAD-X limit), nor start with an underscore or a digit.

    What's Changed

    • Fix: MAD-X Variable Name Length Limit by @fsoubelet in https://github.com/pylhc/PyLHC/pull/102

    Full Changelog: https://github.com/pylhc/PyLHC/compare/0.7.1...0.7.2

    Source code(tar.gz)
    Source code(zip)
  • 0.7.1(May 23, 2022)

    Release 0.7.1 brings a fix to the lsa_to_madx module.

    Fixed:

    • Will not attempt to write to disk knobs that were not found by LSA in the provided optics.

    What's Changed

    • Fix: Do not attempt to write when knob isn't found in LSA optics by @fsoubelet in https://github.com/pylhc/PyLHC/pull/101

    Full Changelog: https://github.com/pylhc/PyLHC/compare/0.7.0...0.7.1

    Source code(tar.gz)
    Source code(zip)
  • 0.7.0(May 23, 2022)

    Release 0.7.0 contains the following changes:

    Added:

    • Added a new module, pylhc.lsa_to_madx, with functionality to parse LSA knobs from the command line or a text file, retrieve relevant information from LSA and create MAD-X files with the commands necessary to reproduce these knobs in simulations. This is of particular use when trying to reproduce a specific machine configuration in simulations.

    What's Changed

    • LSA knob to MAD-X script converter by @fsoubelet in https://github.com/pylhc/PyLHC/pull/100

    Full Changelog: https://github.com/pylhc/PyLHC/compare/0.6.2...0.7.0

    Source code(tar.gz)
    Source code(zip)
  • 0.6.2(Apr 23, 2022)

    Release 0.6.2 adds a flag to the info functionality of pylhc.kickgroups to display a copy-pastable list of kick files once can use in the GUI to load them all at once.

    What's Changed

    • Kickgroups file list by @JoschD and @fsoubelet in https://github.com/pylhc/PyLHC/pull/99

    Full Changelog: https://github.com/pylhc/PyLHC/compare/0.6.1...0.6.2

    Source code(tar.gz)
    Source code(zip)
  • 0.6.1(Apr 22, 2022)

    Release 0.6.1 brings a fix to the kickgroups module.

    Fixed:

    • Correctly detect the plane of the excitationSettings being read.
    • Better handling of kickgroups with no kickfiles.

    Changed:

    • The command-line commands have been renamed to list and info.

    What's Changed

    • fix by @JoschD in https://github.com/pylhc/PyLHC/pull/98

    Full Changelog: https://github.com/pylhc/PyLHC/compare/0.6.0...0.6.1

    Source code(tar.gz)
    Source code(zip)
  • 0.6.0(Apr 22, 2022)

    Release 0.6.0 contains the following changes:

    Added:

    • Added a new module, pylhc.kickgroups, with functionality to query available kickgroup files from a location, retrieve information of a given kickgroup, and retrieve relevant information for all kicks in a kickgroup. It can be called as a script (python -m pylhc.kickgroups) to printout copy-pastable information to put in the OMC logbook.

    What's Changed

    • Added KickGroup Infos by @JoschD and @fsoubelet in https://github.com/pylhc/PyLHC/pull/97

    Full Changelog: https://github.com/pylhc/PyLHC/compare/v0.5.0...0.6.0

    Source code(tar.gz)
    Source code(zip)
  • v0.5.0(Apr 20, 2022)

    What's Changed

    • Cron workflow fix by @fsoubelet in https://github.com/pylhc/PyLHC/pull/95
    • Removed IRNL RDT Correction by @JoschD in https://github.com/pylhc/PyLHC/pull/96 which can now be found as its own package in https://github.com/pylhc/irnl_rdt_correction

    Full Changelog: https://github.com/pylhc/PyLHC/compare/0.4.2...v0.5.0

    Source code(tar.gz)
    Source code(zip)
  • 0.4.2(Mar 31, 2022)

  • v0.4.1(Feb 20, 2022)

    Minor bugfixes in machine_settings_info.

    • Added:

      • time and start_time can now be given as AccDatetime-objects.
    • Fixed:

      • trims variable is initialized as None. Was not initialized if no trims were found, but used later on.
    Source code(tar.gz)
    Source code(zip)
  • v0.4.0(Feb 16, 2022)

    What's Changed

    • Add Zenodo DOI to README by @fsoubelet in https://github.com/pylhc/PyLHC/pull/89
    • Adds check for non-existing knobs by @JoschD in https://github.com/pylhc/PyLHC/pull/90
    • Update CI by @fsoubelet in https://github.com/pylhc/PyLHC/pull/91
    • Lsa with timerange by @JoschD in https://github.com/pylhc/PyLHC/pull/92

    Release 0.4.0 brings the trim-history option to the machine-info extractor. To enable this, one needs to provide a start_time. The return values are now organized into a dictionary.

    Full Changelog: https://github.com/pylhc/PyLHC/compare/0.3.0...v0.4.0

    Source code(tar.gz)
    Source code(zip)
  • 0.3.0(Nov 16, 2021)

    Release 0.3.0 brings the following:

    Added:

    • Non-linear correction script for the (HL)LHC Insertion Regions Resonance Driving Terms, including feed-down effects.

    Changed:

    • The package's license has been moved from GPLv3 to MIT.

    Note: if one wishes to extend the IRNL correction script to a different accelerator, there are valuable pointers in the following PR comment.

    Source code(tar.gz)
    Source code(zip)
  • 0.2.0(Nov 3, 2021)

    This is the first release of pylhc since its omc3 dependency is available on PyPI.

    Added:

    • BPM calibration script to get calibration factors from different BPMs
    • Proper mocking of CERN TN packages (functionality imported from omc3)

    Changed:

    • Minimum required tfs-pandas version is now 3.0.2
    • Minimum required generic-parser version is now 1.0.8
    • Minimum required omc3 version is now 0.2.0
    • Extras related to the CERN TN are now installed with python -m pip install pylhc[cern]

    Removed:

    • The HTCondor and AutoSix functionality have been removed and extracted to another package at https://github.com/pylhc/submitter
    Source code(tar.gz)
    Source code(zip)
  • 0.1.0(Dec 11, 2020)

    • Added:

      • Job submitter script to easily generate and schedule jobs through HTCondor.
      • Autosix script to easily generate and submit parametric SixDesk studies through HTCondor.
      • Script to analyse forced dynamic aperture data.
      • Scripts for logging and analysis of LHC BSRT data.
      • Utility modules supporting functionality for the above scripts.
    • Changed:

      • License moved to GNU GPLv3 to comply with the use of the omc3 package.
    • Miscellaneous:

      • Introduced extra dependencies tailored to different use cases of the package.
      • Reworked package organisation for consistency.
      • Set minimum requirements versions.
      • Moved CI/CD setup to Github Actions.
      • Improved testing and test coverage.
    Source code(tar.gz)
    Source code(zip)
Owner
PyLHC
Organisation for the OMC Team at CERN
PyLHC
MIR Cheatsheet - Survival Guidebook for MIR Researchers in the Lab

MIR Cheatsheet - Survival Guidebook for MIR Researchers in the Lab

SeungHeonDoh 3 Jul 02, 2022
ToeholdTools is a Python package and desktop app designed to facilitate analyzing and designing toehold switches, created as part of the 2021 iGEM competition.

ToeholdTools Category Status Repository Package Build Quality A library for the analysis of toehold switch riboregulators created by the iGEM team Cit

0 Dec 01, 2021
GWpy is a collaboration-driven Python package providing tools for studying data from ground-based gravitational-wave detectors

GWpy is a collaboration-driven Python package providing tools for studying data from ground-based gravitational-wave detectors. GWpy provides a user-f

GWpy 342 Jan 07, 2023
Monitor the stability of a pandas or spark dataframe ⚙︎

Population Shift Monitoring popmon is a package that allows one to check the stability of a dataset. popmon works with both pandas and spark datasets.

ING Bank 403 Dec 07, 2022
A data analysis using python and pandas to showcase trends in school performance.

A data analysis using python and pandas to showcase trends in school performance. A data analysis to showcase trends in school performance using Panda

Jimmy Faccioli 0 Sep 07, 2021
A forecasting system dedicated to smart city data

smart-city-predictions System prognostyczny dedykowany dla danych inteligentnych miast Praca inżynierska realizowana przez Michała Stawikowskiego and

Kevin Lai 1 Nov 08, 2021
Containerized Demo of Apache Spark MLlib on a Data Lakehouse (2022)

Spark-DeltaLake-Demo Reliable, Scalable Machine Learning (2022) This project was completed in an attempt to become better acquainted with the latest b

8 Mar 21, 2022
Zipline, a Pythonic Algorithmic Trading Library

Zipline is a Pythonic algorithmic trading library. It is an event-driven system for backtesting. Zipline is currently used in production as the backte

Quantopian, Inc. 15.7k Jan 07, 2023
Exploratory data analysis

Exploratory data analysis An Exploratory data analysis APP TAPIWA CHAMBOKO 🚀 About Me I'm a full stack developer experienced in deploying artificial

tapiwa chamboko 1 Nov 07, 2021
Flenser is a simple, minimal, automated exploratory data analysis tool.

Flenser Have you ever been handed a dataset you've never seen before? Flenser is a simple, minimal, automated exploratory data analysis tool. It runs

John McCambridge 79 Sep 20, 2022
Karate Club: An API Oriented Open-source Python Framework for Unsupervised Learning on Graphs (CIKM 2020)

Karate Club is an unsupervised machine learning extension library for NetworkX. Please look at the Documentation, relevant Paper, Promo Video, and Ext

Benedek Rozemberczki 1.8k Jan 09, 2023
An Integrated Experimental Platform for time series data anomaly detection.

Curve Sorry to tell contributors and users. We decided to archive the project temporarily due to the employee work plan of collaborators. There are no

Baidu 486 Dec 21, 2022
fds is a tool for Data Scientists made by DAGsHub to version control data and code at once.

Fast Data Science, AKA fds, is a CLI for Data Scientists to version control data and code at once, by conveniently wrapping git and dvc

DAGsHub 359 Dec 22, 2022
Python script to automate the plotting and analysis of percentage depth dose and dose profile simulations in TOPAS.

topas-create-graphs A script to automatically plot the results of a topas simulation Works for percentage depth dose (pdd) and dose profiles (dp). Dep

Sebastian Schäfer 10 Dec 08, 2022
MDAnalysis is a Python library to analyze molecular dynamics simulations.

MDAnalysis Repository README [*] MDAnalysis is a Python library for the analysis of computer simulations of many-body systems at the molecular scale,

MDAnalysis 933 Dec 28, 2022
The Spark Challenge Student Check-In/Out Tracking Script

The Spark Challenge Student Check-In/Out Tracking Script This Python Script uses the Student ID Database to match the entries with the ID Card Swipe a

1 Dec 09, 2021
Project under the certification "Data Analysis with Python" on FreeCodeCamp

Sea Level Predictor Assignment You will anaylize a dataset of the global average sea level change since 1880. You will use the data to predict the sea

Bhavya Gopal 3 Jan 31, 2022
NumPy aware dynamic Python compiler using LLVM

Numba A Just-In-Time Compiler for Numerical Functions in Python Numba is an open source, NumPy-aware optimizing compiler for Python sponsored by Anaco

Numba 8.2k Jan 07, 2023
A Python package for modular causal inference analysis and model evaluations

Causal Inference 360 A Python package for inferring causal effects from observational data. Description Causal inference analysis enables estimating t

International Business Machines 506 Dec 19, 2022
Full automated data pipeline using docker images

Create postgres tables from CSV files This first section is only relate to creating tables from CSV files using postgres container alone. Just one of

1 Nov 21, 2021