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.7-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.7-cp313-cp313-macosx_15_0_x86_64.whl (38.8 MB view details)

Uploaded CPython 3.13macOS 15.0+ x86-64

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

Uploaded CPython 3.13macOS 15.0+ ARM64

so3g-0.2.7-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.7-cp312-cp312-macosx_15_0_x86_64.whl (38.8 MB view details)

Uploaded CPython 3.12macOS 15.0+ x86-64

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

Uploaded CPython 3.12macOS 15.0+ ARM64

so3g-0.2.7-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.7-cp311-cp311-macosx_15_0_x86_64.whl (39.0 MB view details)

Uploaded CPython 3.11macOS 15.0+ x86-64

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

Uploaded CPython 3.11macOS 15.0+ ARM64

so3g-0.2.7-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.7-cp310-cp310-macosx_15_0_x86_64.whl (39.0 MB view details)

Uploaded CPython 3.10macOS 15.0+ x86-64

so3g-0.2.7-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.7-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for so3g-0.2.7-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9dfe00c39c99195466969e91e0440c7150d68a30ee64fb7db17da89816534a20
MD5 e9c056470dc54b3cae9032116f386f76
BLAKE2b-256 80179e182f8d25f531060cc657693a970b0cee4a6791c4e0c4abf6aa0c3a4367

See more details on using hashes here.

Provenance

The following attestation bundles were made for so3g-0.2.7-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.7-cp313-cp313-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for so3g-0.2.7-cp313-cp313-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 1b33adb5b34b2144c782c7d0168064032167bb03f25ab68faeb7b5ca2e059d7a
MD5 3720a6db22b37038c749bde4a511200f
BLAKE2b-256 e65852db65cba6858289eeefd9be3e1f37695bfb53f309f0015b1c9ddbf6f40d

See more details on using hashes here.

Provenance

The following attestation bundles were made for so3g-0.2.7-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.7-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for so3g-0.2.7-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 b412a6c4ab1e4fd7625071554be1932b1f62de6a4ffa7ed8f02a7ed85abfcf40
MD5 3ee29745643505afb5c98c8caa7ce775
BLAKE2b-256 d0ded7ab99babe5509fc022d70dfd25a15cf5c5ce572418ccbd0bb9c8fbe26d3

See more details on using hashes here.

Provenance

The following attestation bundles were made for so3g-0.2.7-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.7-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for so3g-0.2.7-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f532656e11daf98952c09d4748c71dca0bbc6c62b075ecaf4cb5d54bd75d0c44
MD5 becccac74f02f75c2f04176c798945ec
BLAKE2b-256 0616927f4ade296c9e556832417e2cb58e048f31d85feca70aab87b193af6f39

See more details on using hashes here.

Provenance

The following attestation bundles were made for so3g-0.2.7-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.7-cp312-cp312-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for so3g-0.2.7-cp312-cp312-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 ece85ed817b28866d95e78a75126b6b3585a17fb3edd4e87d8d3ea63fc1a8550
MD5 087da0b04887161c1b348839ded900b7
BLAKE2b-256 7dd50988ebaeef6efd5b3a5c2dca66abbf54256d5a286ab206132d8f689301d7

See more details on using hashes here.

Provenance

The following attestation bundles were made for so3g-0.2.7-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.7-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for so3g-0.2.7-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 a92040e72047d5ab240a2813f6ffa0344cdaea967d1ed6f29e7e94eea2c5c740
MD5 ac5e9f375adfa3e32cfb951d3d79ccfb
BLAKE2b-256 2bb686b16f2f6ddbc149dd55aede15708ec1a2e58b75883661da611436085439

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for so3g-0.2.7-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ab9977bbfedc8ebdaab8cdd134d344fd84d6c984cab6dc5925b02f7971e11139
MD5 cdceace202bf1465596e94c4d04f535b
BLAKE2b-256 b1eb12c5c3306f63a867d569d2d0e358088cb2ba05a3fff01e168e1649564a12

See more details on using hashes here.

Provenance

The following attestation bundles were made for so3g-0.2.7-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.7-cp311-cp311-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for so3g-0.2.7-cp311-cp311-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 a2e19115558cb20dec62352d479189812ce80acb8f94084fcd7533c191df4a7e
MD5 08a8bbb27a4e1f1d37accbd8095f4c48
BLAKE2b-256 383de19e44de532ff1e1894a6d271fbff403924bac7d5a47af55ae524a5eb938

See more details on using hashes here.

Provenance

The following attestation bundles were made for so3g-0.2.7-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.7-cp311-cp311-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for so3g-0.2.7-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 9c8c122aedb5e7610fc6d23b6b8ddc49e8bfdfeadec735daced59adedb0ad9e4
MD5 ab2d3bdb7844fc96fe1ffa9a4943d799
BLAKE2b-256 80cfdf94c247fdcd747e4ef4d5ee653ed8ed2904dc54ddffa237cff00a6c9c4a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for so3g-0.2.7-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2a4175f0ad074bd299543fdb96c14b7666f7d85f2437aa945a76f5a961adfe7b
MD5 724e280911d9f761623bdddaf751bddb
BLAKE2b-256 2611a7047f7b71799a31db053d4eb39db2d4069c5373a19f03a7c84d59a6b932

See more details on using hashes here.

Provenance

The following attestation bundles were made for so3g-0.2.7-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.7-cp310-cp310-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for so3g-0.2.7-cp310-cp310-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 32ce34e2f384b430c5e1bcb3e5a3f4f81401e78d0d730244a1217691ca3dcb80
MD5 ad9384032068e7897eb49fd3efdc0094
BLAKE2b-256 d3f228bba70e8a9491ea3f5c79d2c238000f9e18780076cb6e0dba14ffe2df06

See more details on using hashes here.

Provenance

The following attestation bundles were made for so3g-0.2.7-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.7-cp310-cp310-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for so3g-0.2.7-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 d73e13ec6a946e9c345fcb65f06a92a1274ea100be385ef84064bca6a3eed0d7
MD5 7fc31def7dabfa76104bf5dddcd7c370
BLAKE2b-256 e1f892c81625db2a078646febc20a2f3a9926f85fd7c324266561a6f6839d7b0

See more details on using hashes here.

Provenance

The following attestation bundles were made for so3g-0.2.7-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