Skip to content

slaclab/lcls-tools

Repository files navigation

This repo is now ARCHIVED. Please see slac-tools for future developments.

About

Various tools to support high level application development at LCLS using python. This is an effort to maintain a single repo that can be referenced for development.

lcls-tools

Python tools for LCLS:

  • Device API (profile monitors, SC cavities, stoppers, magnets, etc...)
  • Data processing and fitting tools
  • Image collection and processing tools
  • Beam calculations (emittance, solenoid alignment corrections, etc...)

Organization

Files should be organized by their function and be as modular as possible. See model-view-control programming style. First, if the code is general enough to be used on both LCLS and LCLS-II, it belongs in the lcls-tools/common directory. If the code specific to LCLS or LCLS-II, use the normalconducting and superconducting directories respectively. Functions used to analyze data, belongs in the common/data_analysis directory.

Rules of contribution

  • Try to make your code readable
  • Add comments whenever possible
  • Try your best to adhere to style guidelines set forth in PEP8
    • One of the automated checks for each PR is linting with ruff and pre-commit hooks and will fail otherwise. You can install pre-commit with pip install pre-commit and then run pre-commit install in the root of the repository, then run pre-commit run --all-files to check all files before pushing to the repo.
  • Try to be idiomatic.
  • Add tests (unittest is currently used, please use unit tests at a bare minimum)
  • Focus on extensibility (don't put a bunch of modules/classes into one file or directory, if you can avoid it)
  • Try to understand the purpose of each tool and do not overcomplicate with business logic that can live in an application. These should be small and useful tools/apis with well understood and firm contracts between the api and the user

Python 3

Python 3.10 or higher is required.

Dependencies and Installation

For a local development install, clone the repository and run the following commands:

pip install -e .

If you'd like to install the meme package requirement as well, run the following to install through HTTPS

pip install -e ".[meme]"

or the following to install through SSH

pip install -e ".[meme-ssh]"

The full list of dependencies can be found in the requirements.txt file.

About

Python tools for LCLS: post processing data, PV handling, pulling archive settings, etc.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages