21cmfast / 21cmFAST

Official repository for 21cmFAST: a code for generating fast simulations of the cosmological 21cm signal
MIT License
56 stars 37 forks source link

C build reorganisation #359

Open daviesje opened 3 months ago

daviesje commented 3 months ago

This issue is essentially mirror of #135 for the C backend. Currently the C backend is all compiled from GenerateICs.c which directly includes all of the .c and .h files sequentially, and specifically exposes everything in 21cmFAST.h and Globals.h to the python package. This makes it difficult to control dependencies between files, specify the scope of variables and functions, and will also make most linters fairly upset. We should reorganize the C backend to be separated into files with narrower scope (for example both ps.c and UsefulFunctions.c are way too broad at the moment), and we should define header files for each to control how they are shared amongst the backend.

We should discuss the specifics of what this will look like, but as the model grows it will become important that the codebase is easy to navigate and extend.