Installation and setup
Installation
You can install the latest development version of Megatop directly from GitHub.
Note
Megatop depends on NaMaster. The method above will compile that package on your machine, and assumes you have installed its dependencies. Otherwise, we suggest installing it from conda-forge beforehand.
Check the NaMaster documentation for more information.
Tip
Spherical harmonic transforms use ducc under the hood. For best performance, it is recommended to compile this package from source by adding --no-binary ducc0 (see https://gitlab.mpcdf.mpg.de/mtr/ducc#installation for details).
Most of the pipeline steps use MPI.
To run those, you will need the mpi4py package, an optional dependency.
Refer to the mpi4py documentation for more information.
To use Snakemake to orchestrate the pipeline (recommended, requires Python >= 3.11):
Both extras can be combined:
Development
You should clone the repository and install in editable mode with the dev dependency group.
The dev group includes pytest for testing.
You can simply run the tests with
Code quality checks
Our pre-commit hooks run automatically via GitHub actions. To run them locally, you can follow these steps.
- Install
prekfollowing the documentation. -
Install hooks with
-
That's it! Every commit will trigger the code quality checks.
Tip
You can run hooks on demand with prek run.