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

so3g-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (30.5 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

so3g-0.2.0-cp312-cp312-macosx_14_0_arm64.whl (30.1 MB view details)

Uploaded CPython 3.12 macOS 14.0+ ARM64

so3g-0.2.0-cp312-cp312-macosx_13_0_x86_64.whl (35.8 MB view details)

Uploaded CPython 3.12 macOS 13.0+ x86-64

so3g-0.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (30.7 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

so3g-0.2.0-cp311-cp311-macosx_14_0_arm64.whl (30.3 MB view details)

Uploaded CPython 3.11 macOS 14.0+ ARM64

so3g-0.2.0-cp311-cp311-macosx_13_0_x86_64.whl (36.0 MB view details)

Uploaded CPython 3.11 macOS 13.0+ x86-64

so3g-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (30.7 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

so3g-0.2.0-cp310-cp310-macosx_14_0_arm64.whl (30.3 MB view details)

Uploaded CPython 3.10 macOS 14.0+ ARM64

so3g-0.2.0-cp310-cp310-macosx_13_0_x86_64.whl (35.9 MB view details)

Uploaded CPython 3.10 macOS 13.0+ x86-64

so3g-0.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (30.7 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

so3g-0.2.0-cp39-cp39-macosx_13_0_x86_64.whl (36.0 MB view details)

Uploaded CPython 3.9 macOS 13.0+ x86-64

File details

Details for the file so3g-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for so3g-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f367019cb03c355f15fb193441f0e0abffa37fdb2e54ac3c97d185f9c1c4d857
MD5 2e71a2f6ccb67f3fea5c2ccebbfb4b1c
BLAKE2b-256 add0b3bfe1e6fb1e1a853b3bae00cf1cb3fdcf4b3fdc624d2857461c6529ad57

See more details on using hashes here.

Provenance

The following attestation bundles were made for so3g-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_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.0-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for so3g-0.2.0-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 4b8ecbdffabe0ae1b6f3a6452a831f7db28dd4f89f0d221dcf9ea85b4cb7794d
MD5 7137d25939b1caa6879c164d89fcda1d
BLAKE2b-256 a1d9375c4d186df66fa3a1048a28cc60cce1ea7219fc4abee6ab52d168c96c4f

See more details on using hashes here.

Provenance

The following attestation bundles were made for so3g-0.2.0-cp312-cp312-macosx_14_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.0-cp312-cp312-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for so3g-0.2.0-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 660bbe2f1d55c7471863a3031a6f26905af9da8c68a1aaa02396191cb3d106e3
MD5 67dc021a815b40670e10480390c9e6d7
BLAKE2b-256 7153c597f9975068c13c19f2c09e8f22eb3d9426de0300c14ae08b70b402b588

See more details on using hashes here.

Provenance

The following attestation bundles were made for so3g-0.2.0-cp312-cp312-macosx_13_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.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for so3g-0.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f3738f5ec5e439a9287747dee5ebd06e401862866456808fb4ae1da334a290ea
MD5 da7cc64ffff7359f9c55ac1ba7d353ce
BLAKE2b-256 03914ae98186c0ba6ce9ca0200482c95574395d2714726878f9cb88d2cf97162

See more details on using hashes here.

Provenance

The following attestation bundles were made for so3g-0.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_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.0-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for so3g-0.2.0-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 d26f1b7c07c98004b97cf616556b81f8f4e2d1968e5538bccee0b56e62b4457b
MD5 3947479f39950c22933bbc87a047ce96
BLAKE2b-256 9a6b1067971e621419bc6fe8d5816b1b929efb30991099c53719731443ea479a

See more details on using hashes here.

Provenance

The following attestation bundles were made for so3g-0.2.0-cp311-cp311-macosx_14_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.0-cp311-cp311-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for so3g-0.2.0-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 3c10eb23031c2cba3da120b161b765cc6de324e87ac21acf25eca0494228e800
MD5 73bcb818884afe4c6612c79a848766d4
BLAKE2b-256 9f9ad2dc4b9aa0152c0a5ac852698d524574e0f6b6873258a0d4e40daae07fb0

See more details on using hashes here.

Provenance

The following attestation bundles were made for so3g-0.2.0-cp311-cp311-macosx_13_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.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for so3g-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 20d486d66b1de21a1b1a61965969657be6057f7e9672db36af9f046ba3300dd9
MD5 fe8ff30049585a4393697fa53600323b
BLAKE2b-256 c11e4722af18c0725a1de2a43a7c5ba490ee8b37722b7d746be1b9439aec7638

See more details on using hashes here.

Provenance

The following attestation bundles were made for so3g-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_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.0-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for so3g-0.2.0-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 4a52cc736360f6c37f1b00c8f4b0bc91a11311a0caa49988fdb8aa0aaab3da0d
MD5 23e357baf5c87338e6759e56fd8ca6f5
BLAKE2b-256 56901564019041765641f58aeb674752b21734eb7f8a971a73a49f86ba510e4f

See more details on using hashes here.

Provenance

The following attestation bundles were made for so3g-0.2.0-cp310-cp310-macosx_14_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.0-cp310-cp310-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for so3g-0.2.0-cp310-cp310-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 2c319e6aa573f05a4bf430d06ab4ac369e73e99fc3204cd422e08081825ec08c
MD5 358325033a2e91bf79429f252e2bd0a3
BLAKE2b-256 6f3d9c21b209f5a976bfbbd99f0f839b7328a0e0c7a614a3564c6e355993e5a6

See more details on using hashes here.

Provenance

The following attestation bundles were made for so3g-0.2.0-cp310-cp310-macosx_13_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.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for so3g-0.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 97bb8e5766fa21a72efbfd92badd582424c7fbe43755d86d81626bf86ab78d39
MD5 96abe81a47b1a80b5ea836f33d877a7e
BLAKE2b-256 51c81a7b62b6fccef5dadbd5da1c57b2c32316b658fd40e2da097938b4a14123

See more details on using hashes here.

Provenance

The following attestation bundles were made for so3g-0.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_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.0-cp39-cp39-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for so3g-0.2.0-cp39-cp39-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 0989445aed0345152bdcacb0f1c852742d475086ec7e86d3dc6d84e659a82ea7
MD5 b4ac3682addd2e430fabf1a13ce5e2d7
BLAKE2b-256 cf7daf22f121c9ca3138d4ec8d304447934ed1ea3545b9fb5baebe2e32f65efd

See more details on using hashes here.

Provenance

The following attestation bundles were made for so3g-0.2.0-cp39-cp39-macosx_13_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.

Supported by

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