Skip to content

Refactor classy-family codes into common approach #567

Description

@santiagocasas

📝 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestmaintenanceRelated to maintaining the code base

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions