Skip to content
Merged
Changes from all commits
Commits
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
42 changes: 22 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ This project implements the PALS schema in a file-agnostic way, mirrored in data
The corresponding serialized files (and optionally, also the corresponding Python objects) can be human-written, human-read, and automatically validated.

PALS files follow a schema and readers can error out on issues.
Not every PALS implementation needs to be as detailed as this reference implementation in Python.
Nonetheless, you can use this implementation to convert between differnt file formats or to validate a file before reading it with your favorite YAML/JSON/TOML/XML/... library in your programming language of choice.
Not every PALS implementation needs to be as detailed as the reference implementation in Python.
This implementation can be used to convert between different file formats or to validate a file before reading it with your favorite YAML/JSON/TOML/XML/... library in your programming language of choice.

This will enable us to:
- exchange lattices between codes;
Expand All @@ -40,16 +40,22 @@ Preliminary roadmap:

1. Define the PALS schema, using Pydantic.
2. Document the API.
3. Reference implementation in Python.
3.1. Attract additional reference implementations in other languages.
4. Add supporting helpers, which can import existing MAD-X, Elegant, SXF files.
4.1. Try to be as feature complete as possible in these importers.
5. Reuse the reference implementations and implement readers in community codes for beamline modeling (e.g., the [BLAST codes](https://blast.lbl.gov)).
3. Develop a reference implementation in Python. Attract additional reference implementations in other languages.
5. Add supporting helpers, which can import existing MAD-X, Elegant, SXF files. Be as feature complete as possible in these importers.
6. Reuse the reference implementations and implement readers in community codes for beamline modeling (e.g., the [BLAST codes](https://blast.lbl.gov)).


## How to run the tests and examples locally
## For users

In order to run the tests and examples locally, please follow these steps:
You can install this Python implementation of PALS via ``pip install pals-schema``. Package releases can be found [here](https://pypi.org/project/pals-schema/).

Once installed, you can run the examples available in the [examples](https://github.com/campa-consortium/pals-python/tree/main/examples) directory to verify that the package was installed correctly.

If you wish to run the unit tests available in the [tests](https://github.com/campa-consortium/pals-python/tree/main/tests) directory, please install the package via ``pip install pals-schema[test]`` to make sure that all additional dependencies (e.g., ``pytest``) are installed correctly.

## For developers

In order to develop and test this Python implementation locally, please follow these steps:

1. Create a conda environment from the `environment.yml` file:
```bash
Expand All @@ -60,14 +66,10 @@ In order to run the tests and examples locally, please follow these steps:
conda activate pals-python
```
Please double check the environment name in the `environment.yml` file.
3. Run the tests locally:
```bash
pytest tests -v
```
The command line option `-v` increases the verbosity of the output.
You can also use the command line option `-s` to display any test output directly in the console (useful for debugging).
Please refer to [pytest's documentation](https://docs.pytest.org/en/stable/) for further details on the available command line options and/or run `pytest --help`.
4. Run the examples locally (e.g., `fodo.py`):
```bash
python examples/fodo.py
```

Once you have created the environment with all the required dependencies, you can run the examples available in the [examples](https://github.com/campa-consortium/pals-python/tree/main/examples) directory.

You can also run the unit tests available in the [tests](https://github.com/campa-consortium/pals-python/tree/main/tests) directory via ``pytest tests -v``.
Here, the command line option `-v` increases the verbosity of the output.
You can also use the command line option `-s` to display any test output directly in the console (useful for debugging).
Please refer to [pytest's documentation](https://docs.pytest.org/en/stable/) for further details on the available command line options and/or run `pytest --help`.