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

Uploaded CPython 3.13macOS 15.0+ x86-64

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

Uploaded CPython 3.13macOS 15.0+ ARM64

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

Uploaded CPython 3.12macOS 15.0+ x86-64

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

Uploaded CPython 3.12macOS 15.0+ ARM64

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

Uploaded CPython 3.11macOS 15.0+ x86-64

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

Uploaded CPython 3.11macOS 15.0+ ARM64

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

Uploaded CPython 3.10macOS 15.0+ x86-64

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

File metadata

File hashes

Hashes for so3g-0.2.5-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e061043d277f461d09130cb62db83863c5f90e36446e464fba584f0de6b18112
MD5 d0eb957d1de65569dd514b18b778a40b
BLAKE2b-256 613c5d1c58028c1b03bdfac056b276187de025680f72927b8ee5e830844ed3f8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for so3g-0.2.5-cp313-cp313-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 9d63dd7fed481d5d0106efcbbbe1a04345e69b7391ecca825253fbb4dfe8153f
MD5 92c6a55d4a5eb59d68779b6f5d6f4c7d
BLAKE2b-256 198f9a96b8c297a83182921397fe2632581b19a566c1418210cb8001bc8621e1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for so3g-0.2.5-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 ce0f2f092d71428dc92a5a460db397504ff67e95f43ff590e8fb7a5bd0432c16
MD5 bec3f5a70b57ce7efd45d87007c18f00
BLAKE2b-256 db0d8b41a8c8fc9dea71dd8dab82d7f2d4df91381217425469c04c53dd6f117e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for so3g-0.2.5-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 78dbb5e90eb31d02e104f005f3bacb9f48c30dcd736ac784877bf380181dda37
MD5 271ba25da461276215fe57f426c24b59
BLAKE2b-256 6228ce7e7bd370935ebd13e12b9b17c945aa4de58aafbecafb7645d2bc4f134d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for so3g-0.2.5-cp312-cp312-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 3e03961fb814fef2eb1f008be6b0fa447ad2f4c21290540c7df341643899546b
MD5 3003019314f0a1c9b704bcffa8595c08
BLAKE2b-256 9ecc62801ca6e3e8ed675c442f9be22579253e1cc2588aeabe0bf292a0a88dbf

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for so3g-0.2.5-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 034710eea809be45d45de35bf16c64ff2c56c3af2a8ea5ef4f5be5bba143b457
MD5 506da08cee2ef5066674f1b43c618423
BLAKE2b-256 6ae817d3594889c5fe0ee4b2f7e682be007958d425bd4cbf4bcaf6fcaaaacd82

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for so3g-0.2.5-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 45659f1801973520713e99313d23199242aef037f8b797c547a014517b7975bd
MD5 1a9090a87881b6d63f402fc5cf3f6220
BLAKE2b-256 1506205511faa210637f9c7e3ab04653e7789c98b24f14300c85c6be516262e7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for so3g-0.2.5-cp311-cp311-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 0f07eb89428bd321932bfab2202d55ff37f6eee85ff028456065e019477425c5
MD5 a7bcb9c9e8e663b7d56704ff8e0e6e39
BLAKE2b-256 c86f81acef7ecb9240d674ff1d5d9ee680fc24ff5e96539082f8c01df6d2391e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for so3g-0.2.5-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 c2378e8db16ab9142c97bad41d2db7912dec2234a578fd61f8b366df3684f301
MD5 e2553b5cc25cadd600d914635cf207b9
BLAKE2b-256 4a7239658d4f50fc05b4b6ad513237d113bc980be2334a90c7c9920a5217ab2c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for so3g-0.2.5-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e760a760d9fa107eacd83937257d27dd9ed5b4c8f2edd183c06dcdd5ea6e8e80
MD5 1ec258e772bb21fd5fc4eb389b01c2da
BLAKE2b-256 ebc2e15249a6203acf199ad53888ce857bddfe4e2200ea177df5f55f1b3121ff

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for so3g-0.2.5-cp310-cp310-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 2737617ce2a715d072b3c644912d9606f7bf174784545430ecf858478dc29e40
MD5 ff6a9cd0a03fff66469c72431cd1cec4
BLAKE2b-256 cd05faded5bb620e70cc34f1e9042bf35098ed9012bdd6909c0cc42459040483

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for so3g-0.2.5-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 9f29e2c5f21f19b1642cc346617244122f935118e81d7ab1a7f533593d55cefb
MD5 f9157d4f00a6c330f9a068f1b0c001c2
BLAKE2b-256 3a0a33a3a8c91c507610ff7d9da6ac26c514741d05343d5533e0ebe5c117e813

See more details on using hashes here.

Provenance

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