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.2-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.2-cp312-cp312-macosx_14_0_arm64.whl (32.8 MB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

so3g-0.2.2-cp312-cp312-macosx_13_0_x86_64.whl (38.8 MB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

so3g-0.2.2-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.2-cp311-cp311-macosx_14_0_arm64.whl (33.0 MB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

so3g-0.2.2-cp311-cp311-macosx_13_0_x86_64.whl (39.0 MB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

so3g-0.2.2-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.2-cp310-cp310-macosx_14_0_arm64.whl (33.0 MB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

so3g-0.2.2-cp310-cp310-macosx_13_0_x86_64.whl (39.0 MB view details)

Uploaded CPython 3.10macOS 13.0+ x86-64

so3g-0.2.2-cp39-cp39-manylinux_2_28_x86_64.whl (33.0 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

so3g-0.2.2-cp39-cp39-macosx_13_0_x86_64.whl (39.0 MB view details)

Uploaded CPython 3.9macOS 13.0+ x86-64

File details

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

File metadata

File hashes

Hashes for so3g-0.2.2-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8ebcd8c149ee69269faef1418a9dbe2037e0d5c76fa95da3ecae7fb47d0adb5f
MD5 3422053a4606ed7cbc2da825795036c3
BLAKE2b-256 37cf55de10bdb857810ad3582b5fa571d0b118c50b10c6d84ab49de97157a2cf

See more details on using hashes here.

Provenance

The following attestation bundles were made for so3g-0.2.2-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.2-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for so3g-0.2.2-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 2646ad05f8c307efb3d8386e6b474d0a32fd63edbfe8ca9704af2ac7de81b019
MD5 ce76bb85cdac7422adb51ce02ed932d4
BLAKE2b-256 d504387244cdad379d53c0fe32cabea53487fa2588b7a84811f53e2e7ddbecb4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for so3g-0.2.2-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 0af4b751d6264b3aa07132927eec8446e8d940b09a9008b4b1d388e9c74d3a88
MD5 8b8a6ecd223f945071975bec7310c89d
BLAKE2b-256 ffdadece6d270c01ac0ca5d36eb300d375261e7525b54412146b9c0755cc7b9c

See more details on using hashes here.

Provenance

The following attestation bundles were made for so3g-0.2.2-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.2-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for so3g-0.2.2-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 be7dcae756934b9f10429bcd99dad8b10acedd644711053bd86c6cf4b626b7ec
MD5 5d8e0d43e4baf7163cc9cc4c593f2493
BLAKE2b-256 dc70809051e5b016feef8fffed4c84de445da2fdd4c0816e5e3788fe8a14ecea

See more details on using hashes here.

Provenance

The following attestation bundles were made for so3g-0.2.2-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.2-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for so3g-0.2.2-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 01c5e4f9c74ec908f698244e76b31564f12ae9d52389e6d26bd9e89997e03dc5
MD5 c8e482411bc1f2030ae0521af25caef5
BLAKE2b-256 6c4b2bd54457191edd7641d0df1052b1d48eac5886c8afce3a4a9acc32297ea3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for so3g-0.2.2-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 16a85bb41469f717afef43457c2962db8deaea97e0d3387d4f51ce15a89a1c3c
MD5 69209515e5c64726504c28130858e13c
BLAKE2b-256 d59685bcd126d4a3331e76be73143325849aac16437da7ed1a28ec5475927b3a

See more details on using hashes here.

Provenance

The following attestation bundles were made for so3g-0.2.2-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.2-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for so3g-0.2.2-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5c2a8c7d839f27b0a48075f19efaab74c86b648f8785e7fc969777bd033e6e5d
MD5 c54be571d5036d0c12109e0683991268
BLAKE2b-256 57bd0bfcf4a82c68425a577a918a3ab4629f72448a434f010ebda71e78a4119b

See more details on using hashes here.

Provenance

The following attestation bundles were made for so3g-0.2.2-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.2-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for so3g-0.2.2-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 2ebc6543417bd5754ce513ec3dac3beda19e41e2dcb2434dbacea77e1fa43a4c
MD5 bedef5e1fc58bcab1a31deed52dc5b7a
BLAKE2b-256 ae34fcded28a6da7f12fdd603fb030ac7a3150b76ba3d347bb2ee5b6e68ff2b4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for so3g-0.2.2-cp310-cp310-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 660037e9bae078afc68033ed2a12f89df09dd6bd49b82af24d26bc3842aa44f7
MD5 3d1e058a2201070c803e61501a806865
BLAKE2b-256 d236b3ded8657e6aefd60f2279c0396f5e81649785e549bf66235128eb9c4009

See more details on using hashes here.

Provenance

The following attestation bundles were made for so3g-0.2.2-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.2-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

  • Download URL: so3g-0.2.2-cp39-cp39-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 33.0 MB
  • Tags: CPython 3.9, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for so3g-0.2.2-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 56251f4780b77a2efb52f14fa95f489c339e6182f47b88c41a172903d7e0044d
MD5 4a06abeec9a9c3698890f753831ed375
BLAKE2b-256 4438f140d7c35e488f2e0b6e3782fd0901cdca9f91e368bb95267a57d408d968

See more details on using hashes here.

Provenance

The following attestation bundles were made for so3g-0.2.2-cp39-cp39-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.2-cp39-cp39-macosx_13_0_x86_64.whl.

File metadata

  • Download URL: so3g-0.2.2-cp39-cp39-macosx_13_0_x86_64.whl
  • Upload date:
  • Size: 39.0 MB
  • Tags: CPython 3.9, macOS 13.0+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for so3g-0.2.2-cp39-cp39-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 67bc3b009d7d9e54ba8dc589d5091f962087b74dad0b581fd55ab2dad7359f44
MD5 a18099dd04411682f4002f710ff60e05
BLAKE2b-256 3ad5f12e76caad6a354e2ce7f0629919a28ac3fe274773d8d31c1adfaf65425f

See more details on using hashes here.

Provenance

The following attestation bundles were made for so3g-0.2.2-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 Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page