Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 0 additions & 59 deletions .github/workflows/official-docker-images.yml

This file was deleted.

38 changes: 0 additions & 38 deletions .github/workflows/pytest.yml

This file was deleted.

94 changes: 94 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# In general, we try to run on:
# - The oldest supported python
# - The latest stable python that is the common default on most systems and conda
# - (During transitions) The newly released bleeding edge python

name: Run Tests

on:
workflow_dispatch:
push:
branches:
- master
pull_request:
branches:
- master

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: Python-${{ matrix.python }} on ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
python: "3.9"
arch: Linux-x86_64
- os: ubuntu-latest
python: "3.11"
arch: Linux-x86_64
- os: ubuntu-latest
python: "3.12"
arch: Linux-x86_64

# MacOS compilation with the conda compilers (clang) will not
# work due to CEREAL polymorphic issues.
# - os: macos-latest
# python: "3.10"
# arch: MacOSX-x86_64
# - os: macos-latest
# python: "3.12"
# arch: MacOSX-x86_64
# - os: macos-latest
# python: "3.10"
# arch: MacOSX-arm64
# - os: macos-latest
# python: "3.12"
# arch: MacOSX-arm64
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Conda Base
run: |
sudo rm -rf /usr/share/miniconda \
&& sudo rm -rf /usr/local/miniconda \
&& curl -SL -o miniforge.sh https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-${{ matrix.arch }}.sh \
&& bash miniforge.sh -b -f -p ~/conda \
&& source ~/conda/etc/profile.d/conda.sh \
&& conda activate base \
&& conda update -n base --yes conda
- name: Check Conda Config
run: |
source ~/conda/etc/profile.d/conda.sh \
&& conda activate base \
&& conda info \
&& conda list \
&& conda config --show-sources \
&& conda config --show
- name: Install Dependencies
run: |
source ~/conda/etc/profile.d/conda.sh \
&& conda create --yes -n test python=${{ matrix.python }} \
&& conda activate test \
&& conda install --yes --file conda_dev_requirements.txt \
&& pip install -r test-requirements.txt
- name: Install so3g
run: |
source ~/conda/etc/profile.d/conda.sh \
&& conda activate test \
&& CPU_COUNT=2 python3 -m pip install -v .
- name: Run Tests
run: |
source ~/conda/etc/profile.d/conda.sh \
&& conda activate test \
&& export OMP_NUM_THREADS=2 \
&& pytest ./test
4 changes: 2 additions & 2 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:
CC=gcc
CXX=g++
CFLAGS='-O3 -fPIC'
CXXFLAGS='-O3 -fPIC -std=c++14'
CXXFLAGS='-O3 -fPIC -std=c++17'
BOOST_ROOT=/usr/local
FLAC_ROOT=/usr/local
SO3G_BUILD_BLAS_LIBRARIES='-L/usr/local/lib -lopenblas -fopenmp -lm -lgfortran'
Expand All @@ -110,7 +110,7 @@ jobs:
CC=gcc-14
CXX=g++-14
CFLAGS='-O3 -fPIC'
CXXFLAGS='-O3 -fPIC -std=c++14'
CXXFLAGS='-O3 -fPIC -std=c++17'
CPATH='/usr/local/include'
BOOST_ROOT=/usr/local
FLAC_ROOT=/usr/local
Expand Down
20 changes: 13 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ include_directories(${CMAKE_SOURCE_DIR}/include ${CMAKE_BINARY_DIR} )
include_directories(${NUMPY_INCLUDE_DIR})

#
# Define the so3g build target. This is a shared library.
# Define the libso3g build target. This is an internal library that holds all the
# linking dependencies.
#
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY so3g)
add_library(so3g SHARED
src/main.cxx
add_library(so3g OBJECT
src/hkagg.cxx
src/Intervals.cxx
src/Butterworth.cxx
Expand All @@ -70,9 +70,6 @@ add_library(so3g SHARED
src/array_ops.cxx
)

# We could disable the lib prefix on the output library... but let's not.
#set_target_properties(so3g PROPERTIES PREFIX "")

# Disable boost python auto_ptr warnings
target_compile_definitions(so3g PUBLIC BOOST_NO_AUTO_PTR)

Expand Down Expand Up @@ -124,6 +121,15 @@ add_custom_target(so3g-version

add_dependencies(so3g so3g-version)

# Add the Python interface module
Python_add_library(_libso3g MODULE WITH_SOABI src/main.cxx)
set_target_properties(_libso3g PROPERTIES PREFIX "")
target_link_libraries(_libso3g PUBLIC so3g)
if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# Assume Linux-style ld linker
target_link_options(_libso3g PUBLIC "LINKER:--no-as-needed")
endif()

# Make a list of .py files for the library.
file(GLOB MY_PYTHONS
"${CMAKE_CURRENT_SOURCE_DIR}/python/*.py")
Expand All @@ -144,7 +150,7 @@ else()
set(INSTALL_DEST ${PYTHON_SITE_PACKAGES}/so3g)
endif()

install(TARGETS so3g
install(TARGETS _libso3g
DESTINATION ${INSTALL_DEST})

install(FILES ${MY_PYTHONS}
Expand Down
30 changes: 0 additions & 30 deletions Dockerfile

This file was deleted.

6 changes: 0 additions & 6 deletions docker-compose.yml

This file was deleted.

6 changes: 0 additions & 6 deletions docker/qpoint-setup.sh

This file was deleted.

11 changes: 0 additions & 11 deletions docker/so3g-setup.sh

This file was deleted.

9 changes: 8 additions & 1 deletion include/G3SuperTimestream.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,14 @@ namespace cereal {
}

G3_POINTERS(G3SuperTimestream);
G3_SERIALIZABLE(G3SuperTimestream, 0);

CEREAL_CLASS_VERSION(G3SuperTimestream, 0);
CEREAL_REGISTER_TYPE_WITH_NAME(G3SuperTimestream, "G3SuperTimestream");
CEREAL_REGISTER_POLYMORPHIC_RELATION(G3FrameObject, G3SuperTimestream);

CEREAL_FORCE_DYNAMIC_INIT(libso3g);

// G3_SERIALIZABLE(G3SuperTimestream, 0);

class g3supertimestream_exception : std::exception
{
Expand Down
9 changes: 4 additions & 5 deletions python/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import numpy as np


if os.getenv('DOCS_BUILD') == '1':
Expand All @@ -9,10 +8,10 @@
from . import spt3g
from spt3g import core as spt3g_core

# Our library is called libso3g.{suffix}, but will load into module
# namespace so3g.
from .load_pybindings import load_pybindings
load_pybindings([__path__[0] + '/libso3g'], name='so3g')
# Load all symbols from our compiled extension. This is needed for backwards
# compatibility with external packages that expect those symbols to exist based
# on how the previous loader worked.
from ._libso3g import *

# Version is computed by versioneer.
__version__ = version()
Expand Down
Loading
Loading