Skip to main content

Tools for Simons Observatory work with spt3g_software

Project description

GitHub Workflow Status (branch) Documentation Status https://coveralls.io/repos/github/simonsobs/so3g/badge.svg?branch=master https://img.shields.io/badge/dockerhub-latest-blue PyPI Package

Glue functions and new classes for SO work in the spt3g paradigm.

Installation from Binary Packages

If you are just “using” so3g and not actively modifying the source, simply install the binary wheels from PyPI:

pip install so3g

Building from Source

When developing the so3g code, you will need to build from source. There are two methods documented here: (1) using a conda environment to provide python and all compiled dependencies and (2) using a virtualenv for python and OS packages for compiled dependencies. In both cases, the compiled dependencies include:

  • A C++ compiler supporting the c++17 standard

  • BLAS / LAPACK

  • Boost (at least version 1.87 for numpy-2 compatibility)

  • GSL

  • libFLAC

Building with Conda Tools

This method is the most reliable, since we will be using a self-consistent set of dependencies and the same compilers that were used to build those. First, ensure that you have a conda base environment that uses the conda-forge channels. The easiest way to get this is to use the “mini-forge” installer (https://github.com/conda-forge/miniforge).

Once you have the conda “base” environment installed, create a new environment for Simons Observatory work. We force the python version to 3.12, since the default (3.13) is still missing some of our dependencies:

conda create -n simons python==3.12 # <- Only do this once
conda activate simons

Now install all of our dependencies (except for spt3g):

conda install --file conda_dev_requirements.txt

Next, choose how to install spt3g.

Bundled SPT3G

If you are just testing a quick change, you can use pip to install so3g. This will download a copy of spt3g and bundle it into the the installed package. The downside is that every time you run pip, it will re-build all of spt3g and so3g under the hood with cmake:

pip install -vv .

Separate SPT3G

If you are going to be developing so3g and repeatedly building it, you probably want to install spt3g once. See the instructions from that package to download and install. When building, you can install into your conda environment like this:

cd spt3g_software
mkdir -p build
cd build
cmake \
    -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} \
    -DCMAKE_C_COMPILER=${CC} \
    -DCMAKE_CXX_COMPILER=${CXX} \
    -DPython_ROOT_DIR=${CONDA_PREFIX} \
    ..
make -j 4 install
# Copy the python package into place
cp -r ./spt3g ${CONDA_PREFIX}/lib/python3.12/site-packages/

When building so3g against a stand-alone version of spt3g, you need to use cmake directly:

cd so3g
mkdir -p build
cd build
cmake \
    -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} \
    -DCMAKE_C_COMPILER=${CC} \
    -DCMAKE_CXX_COMPILER=${CXX} \
    -DPython_ROOT_DIR=${CONDA_PREFIX} \
    -DBLAS_LIBRARIES='-L${CONDA_PREFIX}/lib -lopenblas -fopenmp' \
    ..
make -j 4 install

Building with OS Packages

Another option is to use a virtualenv for python packages and use the compilers and libraries from your OS to provide so3g dependencies. Install dependencies, for example:

apt install \
    libboost-all-dev \
    libopenblas-openmp-dev \
    libflac-dev \
    libgsl-dev \
    libnetcdf-dev

Then activate your virtualenv. Next you should install to someplace in your library search path. Note that the commands below will not work unless you change the install prefix to a user-writable directory (or make install with sudo). You should decide where you want to install and make sure that the location is in your PATH and LD_LIBRARY_PATH:

cd spt3g_software
mkdir -p build
cd build
cmake \
    -DCMAKE_INSTALL_PREFIX=/usr/local \
    ..
make -j 4 install
# Copy the python package into place
cp -r ./spt3g ${CONDA_PREFIX}/lib/python3.12/site-packages/

And similarly for so3g:

cd so3g
mkdir -p build
cd build
cmake \
    -DCMAKE_INSTALL_PREFIX=/usr/local \
    -DBLAS_LIBRARIES='-lopenblas -fopenmp' \
    ..
make -j 4 install

Testing

The unit tests are not installed with the so3g package, so in order to run them you must have a git checkout of so3g (even if you installed so3g from a pre-built wheel).

After installing the so3g package, you can run the unit tests by passing the path to the test directory to the pytest command:

pytest /path/to/so3g/test

You can run specific tests by calling them directly:

python3 -m unittest /path/to/so3g/test/test_indexed

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

so3g-0.2.6-cp313-cp313-manylinux_2_28_x86_64.whl (32.8 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

so3g-0.2.6-cp313-cp313-macosx_15_0_x86_64.whl (38.8 MB view details)

Uploaded CPython 3.13macOS 15.0+ x86-64

so3g-0.2.6-cp313-cp313-macosx_15_0_arm64.whl (32.8 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

so3g-0.2.6-cp312-cp312-manylinux_2_28_x86_64.whl (32.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

so3g-0.2.6-cp312-cp312-macosx_15_0_x86_64.whl (38.8 MB view details)

Uploaded CPython 3.12macOS 15.0+ x86-64

so3g-0.2.6-cp312-cp312-macosx_15_0_arm64.whl (32.8 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

so3g-0.2.6-cp311-cp311-manylinux_2_28_x86_64.whl (33.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

so3g-0.2.6-cp311-cp311-macosx_15_0_x86_64.whl (39.0 MB view details)

Uploaded CPython 3.11macOS 15.0+ x86-64

so3g-0.2.6-cp311-cp311-macosx_15_0_arm64.whl (33.0 MB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

so3g-0.2.6-cp310-cp310-manylinux_2_28_x86_64.whl (33.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

so3g-0.2.6-cp310-cp310-macosx_15_0_x86_64.whl (39.0 MB view details)

Uploaded CPython 3.10macOS 15.0+ x86-64

so3g-0.2.6-cp310-cp310-macosx_15_0_arm64.whl (33.0 MB view details)

Uploaded CPython 3.10macOS 15.0+ ARM64

File details

Details for the file so3g-0.2.6-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for so3g-0.2.6-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a65cb98f64795c97f5fc9aacf6860e79dc95a5e0e216fdaf92e7daf043d21856
MD5 7f960e784031591463a9eab4050b05b8
BLAKE2b-256 05a7c0fdda3040dea1296586161aeafeabffdba0e81809563bc7bba3b5cb018d

See more details on using hashes here.

Provenance

The following attestation bundles were made for so3g-0.2.6-cp313-cp313-manylinux_2_28_x86_64.whl:

Publisher: wheels.yml on simonsobs/so3g

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file so3g-0.2.6-cp313-cp313-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for so3g-0.2.6-cp313-cp313-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 bf597eb55fa922271313067c7a952596f4eda9d1235ab5b0a618e0d166d7d421
MD5 4d5ffce5a5e826a099f016a173e1efd0
BLAKE2b-256 efd432299f7dc6569e4293f0c07902996bc997ad2cfff8aae986cf712857e676

See more details on using hashes here.

Provenance

The following attestation bundles were made for so3g-0.2.6-cp313-cp313-macosx_15_0_x86_64.whl:

Publisher: wheels.yml on simonsobs/so3g

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file so3g-0.2.6-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for so3g-0.2.6-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 9f39a030d3835edf493ee410c823cefa2a2f0a748d07e989063444146e2f318f
MD5 69fa33930ff070dbc174372abb077ee0
BLAKE2b-256 4035a16f6ba247d81a3fd53f5687d76939b87d470e0e8a1f9f9507a0cfdb4129

See more details on using hashes here.

Provenance

The following attestation bundles were made for so3g-0.2.6-cp313-cp313-macosx_15_0_arm64.whl:

Publisher: wheels.yml on simonsobs/so3g

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file so3g-0.2.6-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for so3g-0.2.6-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 79a5e5a68345dc9b0cc9bb146dc6ebe5bc2d50c1adec8d0b27d3a81db950bab0
MD5 624bd2622d7b9fd23b17dc4f0cf926c3
BLAKE2b-256 3d3b38df2b99c41bf177a57ba4877567c5c7f0bb642f74454c81b0208b85be88

See more details on using hashes here.

Provenance

The following attestation bundles were made for so3g-0.2.6-cp312-cp312-manylinux_2_28_x86_64.whl:

Publisher: wheels.yml on simonsobs/so3g

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file so3g-0.2.6-cp312-cp312-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for so3g-0.2.6-cp312-cp312-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 c2751bb74d3e5d6a2b84952c49ec9383d45515b29529f157d84bdebf47ea7755
MD5 893e0fd9b026ed91cd73ef79da9eb39e
BLAKE2b-256 d94a830827a0eefb24d62020104bb2dc8e34a0a5a5c3b38836650a74b5983710

See more details on using hashes here.

Provenance

The following attestation bundles were made for so3g-0.2.6-cp312-cp312-macosx_15_0_x86_64.whl:

Publisher: wheels.yml on simonsobs/so3g

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file so3g-0.2.6-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for so3g-0.2.6-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 e1c61d2d72ee1a0abcd6a07c026c3159d2c66c5c85183be30a7872438eca2a94
MD5 6e324c38b8450b600aa1c0e81ffaa584
BLAKE2b-256 5f1842d3a156a1da3e6824e5d72d58a435af0977b1d1cd84cb9b2ade21d714e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for so3g-0.2.6-cp312-cp312-macosx_15_0_arm64.whl:

Publisher: wheels.yml on simonsobs/so3g

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file so3g-0.2.6-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for so3g-0.2.6-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a1b2dcc857bc44933651131077f41d14675bbadcb0dc05a532dfa7e19c447edc
MD5 56c8ba259bfd2604169e0222ec8b9ccf
BLAKE2b-256 80868d73993b598aa2d07c0eab5e221fe228f14c5ae7ac79c9d22a783245fd12

See more details on using hashes here.

Provenance

The following attestation bundles were made for so3g-0.2.6-cp311-cp311-manylinux_2_28_x86_64.whl:

Publisher: wheels.yml on simonsobs/so3g

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file so3g-0.2.6-cp311-cp311-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for so3g-0.2.6-cp311-cp311-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 01b83a9fb72a452046c876bbba3fcc34dae80f123e393b406198c7aa0f459c00
MD5 500577394fa121323d783cc708d52ae2
BLAKE2b-256 0d2ce4804ee9af7a9aa03670b7ddf146ed5eff69f21e78a4c179ac1c5973b3f0

See more details on using hashes here.

Provenance

The following attestation bundles were made for so3g-0.2.6-cp311-cp311-macosx_15_0_x86_64.whl:

Publisher: wheels.yml on simonsobs/so3g

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file so3g-0.2.6-cp311-cp311-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for so3g-0.2.6-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 13a12370a75ef825fe3b33e813a384ed4792a6f0931a8d6ae91f0967555f2e67
MD5 ec788e35302385eed71a08e47a61f517
BLAKE2b-256 3199992a759226bd288c9b4959e6a15dc79bb2917a04270c904219c29b9dab17

See more details on using hashes here.

Provenance

The following attestation bundles were made for so3g-0.2.6-cp311-cp311-macosx_15_0_arm64.whl:

Publisher: wheels.yml on simonsobs/so3g

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file so3g-0.2.6-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for so3g-0.2.6-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5b7834c886588f8c5a49fde632c37a3b44c393910b9b71f386414972606dadfa
MD5 c5116ba6769630edf06448aad6ee4a60
BLAKE2b-256 e159b5379b07cfbfba1938da79e9656bd656b79f1f389cb84f796294c74ab596

See more details on using hashes here.

Provenance

The following attestation bundles were made for so3g-0.2.6-cp310-cp310-manylinux_2_28_x86_64.whl:

Publisher: wheels.yml on simonsobs/so3g

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file so3g-0.2.6-cp310-cp310-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for so3g-0.2.6-cp310-cp310-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 a4402bd625ecb7ac47b6971de5dc5279ff4f3dede7630fc1f833e9215b9f1fe5
MD5 460c9a6789033e368a607e11a361f482
BLAKE2b-256 e557cd54b1c30f57d959dafe5257b8344ea9b360f9cff2491bf6e5a89c124cdd

See more details on using hashes here.

Provenance

The following attestation bundles were made for so3g-0.2.6-cp310-cp310-macosx_15_0_x86_64.whl:

Publisher: wheels.yml on simonsobs/so3g

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file so3g-0.2.6-cp310-cp310-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for so3g-0.2.6-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 d7f37b06e42b2dcb2d9539447413713d26b91674993463f10c3908fa8e6912c0
MD5 781aa76009ad380bd46dd7f06f0e57e3
BLAKE2b-256 54c25c7a3a73281237885275508e49ceed1895b0b6ca61d2d51b8d68697b0873

See more details on using hashes here.

Provenance

The following attestation bundles were made for so3g-0.2.6-cp310-cp310-macosx_15_0_arm64.whl:

Publisher: wheels.yml on simonsobs/so3g

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page