desy-ml / cheetah

Fast and differentiable particle accelerator optics simulation for reinforcement learning and optimisation applications.
https://cheetah-accelerator.readthedocs.io
GNU General Public License v3.0
30 stars 13 forks source link

Establish testing #7

Closed jank324 closed 1 year ago

jank324 commented 1 year ago

🚀 Feature Request

Cheetah needs some sort of software tests that ensure everything works correctly and the computed results agree with other simulations such as Ocelot and ASTRA. Ideally, these would also test that Cheetah remains fast.

Motivation

So far I have been using Notebooks in the test directory to roughly make sure that Cheetah still works when I changed things. This is obviously terrible, as it does not test everything, many of the Notebooks are out of date and it is a lot of work to run.

cr-xu commented 1 year ago

Now that Felix is working on improving the code, establishing unit tests becomes more prominent so that we could have a CI/CD pipeline for PRs.

I'll try to add more tests in the upcoming weeks.

jank324 commented 1 year ago

Agreed! I've already talked to him that this is definitely something we should focus on next.

jank324 commented 1 year ago

We should use pytest for testing

jank324 commented 1 year ago

Btw, the test directory already has a couple of notebooks that I have used for testing. Many of them can probably be translated to "proper" pytest tests.