Skip to content

Commit

Permalink
Added cpp extensions, tests, hooks cpp and markdown linters; removed …
Browse files Browse the repository at this point in the history
…poetry, added setuptools; massive cleanups; updated README.md; bumped version
  • Loading branch information
anand-avinash committed Mar 12, 2024
1 parent 3ec7d24 commit 169c39a
Show file tree
Hide file tree
Showing 33 changed files with 2,178 additions and 2,876 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
test_examples/
.vscode

### List below was sourced from <https://github.com/github/gitignore/blob/main/Python.gitignore>

Expand Down
14 changes: 13 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,16 @@ repos:
- id: MkDocsbuild
name: Building the markdown documentation with `mkdocs build`
entry: bash -c 'mkdocs build'
language: system
language: system

- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v17.0.6
hooks:
- id: clang-format
args: [--style=LLVM]

- repo: https://github.com/DavidAnson/markdownlint-cli2
rev: v0.12.1
hooks:
- id: markdownlint-cli2
args: [--fix]
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
recursive-include extern *
49 changes: 45 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,50 @@
# BrahMap

An optimal map-making package for LiteBIRD, based on [COSMOMAP2](https://github.com/giuspugl/COSMOMAP2), described in [*Puglisi et al (2018)*](https://doi.org/10.1051/0004-6361/201832710)
<!-- markdownlint-disable MD033 -->
<font color="red"> **This project is currently under active development!!!** </font>
<!-- markdownlint-disable MD033 -->

[Documentation](https://anand-avinash.github.io/BrahMap/)
`BrahMap` is an optimal map-making framework for the future CMB experiments,
based on [COSMOMAP2](https://github.com/giuspugl/COSMOMAP2), as described in
[*Puglisi et al (2018)*](https://doi.org/10.1051/0004-6361/201832710).

After cloning for the first time, run `pre-commit install`.
`BrahMap` is written Python with C++ extension handling the heavy computation.
It implements GLS map-making with PCG solver, taking into account the
block-band diagonal noise correlation matrix. This implementation offers
solvers of I, QU, and IQU maps.

<font color="red"> UNDER DEVELOPMENT!!! </font>
Go to the [quick start guide](quick_start.md) for a quick introduction to
map-making with `BrahMap`. Refer to the [API reference](api_references.md)
for a completer reference to `BrahMap` API.

## Installation

`BrahMap` can be installed with the following steps:

```shell
# Clone the repository
git clone https://github.com/anand-avinash/BrahMap.git

cd BrahMap

# Install the package
pip install .

# Alternatively, do an editable installation for development purpose
# followed by `pre-commit` install
pip install -e .
pre-commit install
```

### Notes

`BrahMap` uses [Setuptools](https://setuptools.pypa.io/en/latest/index.html)
to build the C++ extensions. By default, it creates the command for compilation
by collecting
[several environment variables](https://setuptools.pypa.io/en/latest/index.html).
To change the compiler for the building the C++ extension, supply the
compiler name via `CC` or `CXX` variables:

```shell
CC=clang++ pip install .
```
4 changes: 0 additions & 4 deletions brahmap/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# from .interfaces import *
# from .utilities import *
# from .linop import *

from . import interfaces, utilities, linop

__all__ = [
Expand Down
28 changes: 0 additions & 28 deletions brahmap/interfaces/__init__.py
Original file line number Diff line number Diff line change
@@ -1,45 +1,17 @@
from .deflationlib import (
arnoldi,
build_hess,
build_Z,
run_krypy_arnoldi,
find_ritz_eigenvalues,
)
from .linearoperators import (
GroundFilterLO,
calculate,
calculatestar,
FilterLO,
globalprocsfilter,
SparseLO,
ToeplitzLO,
WeightingLO,
BlockLO,
BlockDiagonalLO,
BlockDiagonalPreconditionerLO,
InverseLO,
CoarseLO,
DeflationLO,
)

__all__ = [
"arnoldi",
"build_hess",
"build_Z",
"run_krypy_arnoldi",
"find_ritz_eigenvalues",
"GroundFilterLO",
"calculate",
"calculatestar",
"FilterLO",
"globalprocsfilter",
"SparseLO",
"ToeplitzLO",
"WeightingLO",
"BlockLO",
"BlockDiagonalLO",
"BlockDiagonalPreconditionerLO",
"InverseLO",
"CoarseLO",
"DeflationLO",
]
234 changes: 0 additions & 234 deletions brahmap/interfaces/deflationlib.py

This file was deleted.

Loading

0 comments on commit 169c39a

Please sign in to comment.