Installation

Installation#

You can install PySRW with pip. It is highly recommended to install this package on a dedicated virtual environment, to avoid conflicts with other modules.

If you work within the CERN acc-py distribution, you can create a virtual environment following the instructions (CERN network only), activate it, and then fetch the latest released version of PySRW from the acc-py internal repository

pip install pysrw

Otherwise, you can use your own Python environment and install the package directly from GitLab

pip install git+https://gitlab.cern.ch/dbutti/pysrw.git

The installation may take several minutes, as it requires compiling the SRW libraries from source. Once completed, you can verify the correct installation by importing the module

import pysrw as srw

Development#

If you wish to edit this module, you can download the GitLab repository locally

git clone git+https://gitlab.cern.ch/dbutti/pysrw.git <path_to_folder>

To set up the package in your development environment, consider installing it in edit mode, including the extra development requirements (e.g. pytest)

pip install -e <path_to_folder>/[dev]

You can utilize (and expand) the provided test suite to ensure the module’s flawless development

pytest <path_to_folder>/pysrw/tests

Todo

Currently, the tests only verify the successful installation and import of the module. These will be expanded to create a comprehensive test suite covering most of PySRW’s functionalities.

Contributing#

Any contributions are welcome! Please feel free to report bugs, suggest new features, or propose new examples to add to the gallery.

If you have any feedback or requests regarding the module, you can either open a GitLab issue or mail the author.