{"id":24773383,"url":"https://github.com/jcgoran/coffe","last_synced_at":"2025-10-11T22:30:40.576Z","repository":{"id":65824220,"uuid":"124378720","full_name":"JCGoran/coffe","owner":"JCGoran","description":"The public repository for the code COFFE","archived":false,"fork":false,"pushed_at":"2024-10-16T09:30:23.000Z","size":5139,"stargazers_count":7,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-25T15:38:47.393Z","etag":null,"topics":["correlation-functions","cosmology","covariance-matrix","galaxy-clustering"],"latest_commit_sha":null,"homepage":"https://jcgoran.github.io/coffe/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JCGoran.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-08T10:57:16.000Z","updated_at":"2024-10-16T09:28:15.000Z","dependencies_parsed_at":"2024-10-18T00:44:51.485Z","dependency_job_id":"2130589e-0e5d-40b8-808b-ecfa8c9af749","html_url":"https://github.com/JCGoran/coffe","commit_stats":{"total_commits":468,"total_committers":3,"mean_commits":156.0,"dds":"0.0064102564102563875","last_synced_commit":"536e13fe49cfcde7b7e0193a8df7e8c803de6d43"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/JCGoran/coffe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JCGoran%2Fcoffe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JCGoran%2Fcoffe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JCGoran%2Fcoffe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JCGoran%2Fcoffe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JCGoran","download_url":"https://codeload.github.com/JCGoran/coffe/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JCGoran%2Fcoffe/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279009071,"owners_count":26084549,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["correlation-functions","cosmology","covariance-matrix","galaxy-clustering"],"created_at":"2025-01-29T04:47:31.565Z","updated_at":"2025-10-11T22:30:39.758Z","avatar_url":"https://github.com/JCGoran.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# COFFE v3\n\nThis is the public repository for the code COFFE (COrrelation Function Full-sky Estimator), which can be used to compute the following quantities in linear perturbation theory:\n\n* full-sky and flat-sky 2-point correlation function (2PCF) of galaxy number counts, taking into account all of the effects (density, RSD, lensing, etc.)\n* full-sky and flat-sky multipoles of the 2PCF\n* redshift-averaged multipoles of the 2PCF\n* flat-sky Gaussian covariance matrix of the multipoles of the 2PCF\n* flat-sky Gaussian covariance matrix of the redshift-averaged multipoles of the 2PCF\n\nThe relevant theoretical papers are:\n\n* [The full-sky relativistic correlation function and power spectrum of galaxy number counts: I. Theoretical aspects, arXiv:1708.00492](https://arxiv.org/abs/1708.00492)\n* [COFFE: a code for the full-sky relativistic galaxy correlation function, arXiv:1806.11090](https://arxiv.org/abs/1806.11090)\n* [The flat-sky approximation to galaxy number counts - redshift space correlation function, arXiv:2011.01878](https://arxiv.org/abs/2011.01878)\n\n## Installation\n\n### From pip\n\nIf you are on Linux or MacOS, the latest version of COFFE can be installed using:\n\n```sh\npip install coffe\n```\n\nNote that Windows is not officially supported.\n\nIf you wish to install the development version of COFFE, please refer to the section below.\n\n### Development version\n\n**NOTE**: the use of a virtual environment (such as Python's [venv](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment)) is highly recommended.\n\n#### Prerequisites \n\nIf you would like to install the development version, you will need to first have the following:\n\n* a C compiler, compatible with the C99 standard\n* a Python interpreter, version 3.8 or above\n* [GSL](https://www.gnu.org/software/gsl/) (GNU Scientific Library) and the corresponding headers, version 2.1 or above (available as `libgsl-dev` on Debian-based, and as `gsl-devel` on RHEL/CentOS-based distros)\n* [FFTW](http://www.fftw.org/download.html) and the corresponding headers, version 3 or above (available as `libfftw3-dev` on Debian-based, and as `fftw-devel` on RHEL/CentOS-based distros)\n* [libconfig](http://hyperrealm.github.io/libconfig/)\n\nThen clone this repository:\n\n```sh\ngit clone --recurse-submodules https://github.com/JCGoran/coffe\n```\n\nthen change directory to it:\n\n```sh\ncd coffe\n```\n\n#### Linux (CentOS/RHEL based)\n\nRun the script:\n\n```sh\nbash scripts/install_other.sh gsl fftw libconfig\n```\n\n#### Linux (Debian/Ubuntu based)\n\nRun the following command:\n\n```sh\nsudo apt install libgsl-dev libfftw3-dev libconfig-dev\n```\n\nand follow the instructions from the prompt.\n\n#### MacOS (Homebrew)\n\nYou can install the necessary prerequisites using Homebrew:\n\n```sh\nbrew install gsl fftw libconfig\n```\n\n**NOTE**: as a technical aside, Homebrew-installed packages (whether installed as pre-build binaries or from source) are built for the current version of your operating system. This means that they **CANNOT** be used to create a redistributable Python wheel, i.e. a wheel that works on any older version of MacOS.\n\n#### MacOS (Conan)\n\nAs an alternative to Homebrew, one can use Conan to build the dependencies.\n\nFirst install Conan using:\n\n```sh\npip install conan\n```\n\nThen, generate a profile:\n\n```sh\nconan profile detect --force\n```\n\nFinally, install all of the dependencies in the `_build` directory:\n\n```sh\nconan install . --output-folder=_build --build=missing\n```\n\nNote that this may take a while as the packages are usually built from source.\n\n**IMPORTANT NOTE**: Due to the fact that newer Apple devices have dual architectures (both `arm64` and `x86_64`), it is recommended to not mix these together, i.e. you should re-run _all_ of the above in clean `arm64` and `x86_64` environments (terminals) in separate COFFE directories to avoid any issues.\n\n#### Installing CLASS and CUBA\n\nCOFFE also depends on the CLASS and CUBA libraries, which are not available on Homebrew or Conan, or the default Linux package repositories.\nTo install them, one needs to install `automake`, either via Homebrew (`brew install automake`) or via some other package manager.\nThey can then be built and installed by running:\n\n```sh\nbash scripts/install_other.sh class cuba\n```\n\nThis will install the two packages in the directories `/opt/cuba_[ARCH]` and `/opt/class_public_[ARCH]`, where arch is either `x86_64` or `arm64` depending on your CPU architecture.\n\n#### Installing COFFE\n\nNow that the prerequisites are installed, you can install COFFE using:\n\n```sh\npip install .\n```\n\nIf you would additionally like to install all of the various tools for testing, generating docs, and development, you can additionally run:\n\n```sh\npip install '.[all]'\n```\n\n## Documentation\n\nThe documentation for the latest version is available [here](https://jcgoran.github.io/coffe/).\nTo build the documentation, you can run `bash scripts/generate_docs.sh`, after which the documentation will be available under `docs/`.\n\n## Bug reports and feature requests\n\nPlease use the [issue tracker](https://github.com/JCGoran/coffe/issues) to submit any bug reports and feature requests.\n\n## License\n\nCOFFE is licensed under the GNU GPL 3.0. See the [LICENSE](LICENSE) file for more information.\n\n## Citations\n\nIf you use COFFE in a publication, we kindly ask that you cite the original paper describing the code, located at [arXiv:1806.11090](https://arxiv.org/abs/1806.11090).\nA `bibTeX` entry is provided below for convenience.\n```\n@article{coffe:v1,\n      author         = \"Tansella, Vittorio and Jelic-Cizmek, Goran and Bonvin,\n                        Camille and Durrer, Ruth\",\n      title          = \"{COFFE: a code for the full-sky relativistic galaxy\n                        correlation function}\",\n      year           = \"2018\",\n      eprint         = \"1806.11090\",\n      archivePrefix  = \"arXiv\",\n      primaryClass   = \"astro-ph.CO\",\n      SLACcitation   = \"%%CITATION = ARXIV:1806.11090;%%\"\n}\n```\n\n## Development\n\n## Testing COFFE\n\nIf you would like to test COFFE, you can do so in two ways: using either `pytest`, or `cmake` (deprecated).\n\n### Testing with pytest\n\nTo run the tests via `pytest`, first install COFFE using the instructions above, and then run:\n\n```sh\npython -m pytest tests/\n```\n\n### Testing with `cmake` (deprecated)\n\nIf you do not want to build COFFE using `pip install`, you can instead use `cmake`, which is installable via `pip install cmake`. To do so, follow all of the above instructions, but instead of doing `pip install .`, you can instead do:\n\n```sh\nmkdir build\ncd build\ncmake -DCMAKE_INSTALL_PREFIX=./install -DCOFFE_ENABLE_PYTHON=ON -DCOFFE_ENABLE_CLASS=ON -DCOFFE_ENABLE_CUBA=ON -DCOFFE_ENABLE_MATHOPTS=ON -DCOFFE_ENABLE_TESTS=ON ..\n```\n\nIn case of issues with missing detection of GSL, FFTW, etc., which can happen when using Conan on MacOS, you can use:\n\n```sh\ncmake -DCMAKE_INSTALL_PREFIX=./install -DCOFFE_ENABLE_PYTHON=ON -DCOFFE_ENABLE_CLASS=ON -DCOFFE_ENABLE_CUBA=ON -DCOFFE_ENABLE_MATHOPTS=ON -DCOFFE_ENABLE_TESTS=ON -DCMAKE_TOOLCHAIN_FILE=../_build/conan_toolchain.cmake -DCOFFE_PYTHON_MINOR_VERSION=[VERSION] ..\n```\n\nwhere you must replace `[VERSION]` with whatever minor version of Python you are using (for instance, when using Python 3.9, replace `[VERSION]` with `9`).\nThen you can build COFFE tests using:\n\n```sh\nmake\n```\n\n**NOTE**: if you have Ninja installed, you can additionally pass `-G Ninja` to the above `cmake` command, and then run `ninja build` instead of `make`.\n\nFinally, run the tests using:\n\n```sh\nctest\n```\n\n### Building Python wheels\n\nThe building of wheels is done using the [`cibuildwheel`](https://cibuildwheel.readthedocs.io/en/stable/) utility.\nTo install it, run:\n\n```sh\npip install cibuildwheel\n```\n\n#### Linux\n\nBuilding of wheels on Linux requires a container engine like [Docker](https://docs.docker.com/engine/install/) or [Podman](https://podman.io/docs/installation).\nOnce one of those is installed, the wheels can be built using:\n\n```sh\ncibuildwheel --platform linux\n```\n\nThe wheels will then be available in the `wheelhouse` subdirectory, and can then be uploaded to PyPI.\n\n#### MacOS\n\nThe MacOS wheels require an [official Python installer](https://www.python.org/downloads/macos/); the ones from Homebrew, Conda, etc. will most likely not work.\nTo build the wheels, run:\n\n```sh\ncibuildwheel --platform macos\n```\n\nThe wheels will then be available in the `wheelhouse` subdirectory, and can then be uploaded to PyPI.\n\n**IMPORTANT NOTE**: when building a wheel using `cibuildwheel`, the version of COFFE in the output can be surprising; to avoid any issues, it is best to specify the explicit version using:\n\n```sh\nexport SETUPTOOLS_SCM_PRETEND_VERSION=[VERSION]\n```\n\nwhere `[VERSION]` is the version number you want to tag this version of COFFE (for instance, `3.0.2`).\n\n**IMPORTANT NOTE 2**: if you installed GSL, FFTW, or libconfig via Brew, make sure to unlink them first using:\n\n```sh\nbrew unlink gsl fftw libconfig\n```\n\nbecause otherwise `cibuildwheel` (or rather, `auditwheel`) may complain about mismatching OS versions.\n\n### Releasing Python wheels\n\nTo automate the tedious task of building the wheels, they are now setup in the CI.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcgoran%2Fcoffe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjcgoran%2Fcoffe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcgoran%2Fcoffe/lists"}