📝 Issue Summary
The CLASS, hi_class, mochi_class and MGCLASS cosmology codes (backends) do very similar things, but they currently contain much of the same code in separate files, repeating ~600 lines of code.
This makes the code harder to maintain. When we fix a bug or improve one backend, we may need to repeat the same change in the other backend. It also makes it easier for the two implementations to behave differently by accident.
✅ Expected Outcome
Create a common internal approach for the CLASS-family backends.
The shared code should handle the common parts, such as:
- Cosmological parameter preparation
- Neutrino handling
- Background quantities
- Power-spectrum calculations
- Common tests
The backend-specific code should remain responsible for features that are different between CLASS and hi_class, especially modified-gravity options.
The public CLOE interfaces should not change. Existing Background and Perturbations users should continue to work as before.
🔄 Steps to Reproduce (if applicable)
Start by refactoring the CLASS and hi_class backends. Future CLASS-family backends, such as MGCLASS and MOCHI, should be able to use the same approach
📌 Additional Notes
Needs to be discussed in the maintainers team and with the classy-family developers.
📝 Issue Summary
The CLASS, hi_class, mochi_class and MGCLASS cosmology codes (backends) do very similar things, but they currently contain much of the same code in separate files, repeating ~600 lines of code.
This makes the code harder to maintain. When we fix a bug or improve one backend, we may need to repeat the same change in the other backend. It also makes it easier for the two implementations to behave differently by accident.
✅ Expected Outcome
Create a common internal approach for the CLASS-family backends.
The shared code should handle the common parts, such as:
The backend-specific code should remain responsible for features that are different between CLASS and hi_class, especially modified-gravity options.
The public CLOE interfaces should not change. Existing
BackgroundandPerturbationsusers should continue to work as before.🔄 Steps to Reproduce (if applicable)
Start by refactoring the CLASS and hi_class backends. Future CLASS-family backends, such as MGCLASS and MOCHI, should be able to use the same approach
📌 Additional Notes
Needs to be discussed in the maintainers team and with the classy-family developers.