From fc4a0df2f60c6e96a35d60afb2f4ea4e41884f8f Mon Sep 17 00:00:00 2001 From: Ted Kisner Date: Thu, 23 Jan 2025 21:07:37 -0800 Subject: [PATCH 1/7] Include python-3.13 in test matrix. Bump release version. --- .github/workflows/deploy.yml | 18 ++++++++++++++++-- .github/workflows/test.yml | 8 ++++---- .github/workflows/wheels.yml | 18 ++++++++++++++++-- packaging/conda/install_deps_conda.sh | 2 +- .../conda/install_deps_conda_external.sh | 2 +- packaging/deps/cfitsio.sh | 2 +- packaging/wheels/install_deps_linux.sh | 19 +------------------ packaging/wheels/install_deps_osx.sh | 19 +------------------ src/toast/RELEASE | 2 +- 9 files changed, 42 insertions(+), 48 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index abf46892e..9f104a137 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -42,6 +42,10 @@ jobs: arch: x86_64 python: 312 builder: manylinux + - os: ubuntu-latest + arch: x86_64 + python: 313 + builder: manylinux # MacOS x86_64. The macos-13 runner is the last # Intel-based runner version. At some point we'll @@ -61,6 +65,11 @@ jobs: python: 312 builder: macosx deploy: 13.0 + - os: macos-13 + arch: x86_64 + python: 313 + builder: macosx + deploy: 13.0 # MacOS arm64 - os: macos-latest @@ -78,6 +87,11 @@ jobs: python: 312 builder: macosx deploy: 14.0 + - os: macos-latest + arch: arm64 + python: 313 + builder: macosx + deploy: 14.0 env: CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.builder }}_${{ matrix.arch }} CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.builder }}2014 @@ -117,11 +131,11 @@ jobs: - uses: actions/setup-python@v5 name: Install Python with: - python-version: '3.10' + python-version: '3.12' - name: Install cibuildwheel run: | - python -m pip install twine cibuildwheel==2.20.0 + python -m pip install twine cibuildwheel==2.22.0 - name: Build wheel run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8c005c1ea..401d4020f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,11 +36,11 @@ jobs: arch: Linux-x86_64 ompdisable: 0 - os: ubuntu-latest - python: "3.10" + python: "3.12" arch: Linux-x86_64 ompdisable: 0 - os: ubuntu-latest - python: "3.12" + python: "3.13" arch: Linux-x86_64 ompdisable: 0 - os: macos-latest @@ -48,7 +48,7 @@ jobs: arch: MacOSX-x86_64 ompdisable: 1 - os: macos-latest - python: "3.12" + python: "3.13" arch: MacOSX-x86_64 ompdisable: 1 - os: macos-latest @@ -56,7 +56,7 @@ jobs: arch: MacOSX-arm64 ompdisable: 1 - os: macos-latest - python: "3.12" + python: "3.13" arch: MacOSX-arm64 ompdisable: 1 steps: diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 8ae8938bb..9db474f93 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -44,6 +44,10 @@ jobs: arch: x86_64 python: 312 builder: manylinux + - os: ubuntu-latest + arch: x86_64 + python: 313 + builder: manylinux # MacOS x86_64. The macos-13 runner is the last # Intel-based runner version. At some point we'll @@ -63,6 +67,11 @@ jobs: python: 312 builder: macosx deploy: 13.0 + - os: macos-13 + arch: x86_64 + python: 313 + builder: macosx + deploy: 13.0 # MacOS arm64 - os: macos-latest @@ -80,6 +89,11 @@ jobs: python: 312 builder: macosx deploy: 14.0 + - os: macos-latest + arch: arm64 + python: 313 + builder: macosx + deploy: 14.0 env: CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.builder }}_${{ matrix.arch }} CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.builder }}2014 @@ -128,11 +142,11 @@ jobs: - uses: actions/setup-python@v5 name: Install Python with: - python-version: '3.10' + python-version: '3.12' - name: Install cibuildwheel run: | - python -m pip install cibuildwheel==2.20.0 + python -m pip install cibuildwheel==2.22.0 - name: Build wheel run: | diff --git a/packaging/conda/install_deps_conda.sh b/packaging/conda/install_deps_conda.sh index f815bf6c8..805cb5182 100755 --- a/packaging/conda/install_deps_conda.sh +++ b/packaging/conda/install_deps_conda.sh @@ -7,7 +7,7 @@ envname=$1 # Explicit python version to use pyversion=$2 if [ "x${pyversion}" = "x" ]; then - pyversion=3.10 + pyversion=3.12 fi # Install optional dependencies if desired diff --git a/packaging/conda/install_deps_conda_external.sh b/packaging/conda/install_deps_conda_external.sh index 846b71276..843ed2929 100755 --- a/packaging/conda/install_deps_conda_external.sh +++ b/packaging/conda/install_deps_conda_external.sh @@ -7,7 +7,7 @@ envname=$1 # Explicit python version to use pyversion=$2 if [ "x${pyversion}" = "x" ]; then - pyversion=3.10 + pyversion=3.12 fi # Install optional dependencies if desired diff --git a/packaging/deps/cfitsio.sh b/packaging/deps/cfitsio.sh index f1617154f..b134790dc 100644 --- a/packaging/deps/cfitsio.sh +++ b/packaging/deps/cfitsio.sh @@ -7,7 +7,7 @@ # - STATIC (yes/no) # - CLEANUP (yes/no) -cfitsio_version=4.3.0 +cfitsio_version=4.5.0 cfitsio_dir=cfitsio-${cfitsio_version} cfitsio_pkg=${cfitsio_dir}.tar.gz diff --git a/packaging/wheels/install_deps_linux.sh b/packaging/wheels/install_deps_linux.sh index b73d56b2a..c74e4e128 100755 --- a/packaging/wheels/install_deps_linux.sh +++ b/packaging/wheels/install_deps_linux.sh @@ -69,27 +69,10 @@ pip install --upgrade pip # Install a couple of base packages that are always required pip install -v cmake wheel -# In order to maximize ABI compatibility with numpy, build with the newest numpy -# version containing the oldest ABI version compatible with the python we are using. -# NOTE: for now, we build with numpy 2.0.x, which is backwards compatible with -# numpy-1.x and forward compatible with numpy-2.x. pyver=$(python3 --version 2>&1 | awk '{print $2}' | sed -e "s#\(.*\)\.\(.*\)\..*#\1.\2#") -# if [ ${pyver} == "3.8" ]; then -# numpy_ver="1.20" -# fi -# if [ ${pyver} == "3.9" ]; then -# numpy_ver="1.20" -# fi -# if [ ${pyver} == "3.10" ]; then -# numpy_ver="1.22" -# fi -# if [ ${pyver} == "3.11" ]; then -# numpy_ver="1.24" -# fi -numpy_ver="2.0.1" # Install build requirements. -CC="${CC}" CFLAGS="${CFLAGS}" pip install -v -r "${scriptdir}/build_requirements.txt" "numpy==${numpy_ver}" +CC="${CC}" CFLAGS="${CFLAGS}" pip install -v -r "${scriptdir}/build_requirements.txt" numpy # Build compiled dependencies diff --git a/packaging/wheels/install_deps_osx.sh b/packaging/wheels/install_deps_osx.sh index ca85cd595..dc74b945b 100755 --- a/packaging/wheels/install_deps_osx.sh +++ b/packaging/wheels/install_deps_osx.sh @@ -77,27 +77,10 @@ pip install --upgrade pip # Install a couple of base packages that are always required pip install -v wheel -# In order to maximize ABI compatibility with numpy, build with the newest numpy -# version containing the oldest ABI version compatible with the python we are using. -# NOTE: for now, we build with numpy 2.0.x, which is backwards compatible with -# numpy-1.x and forward compatible with numpy-2.x. pyver=$(python3 --version 2>&1 | awk '{print $2}' | sed -e "s#\(.*\)\.\(.*\)\..*#\1.\2#") -# if [ ${pyver} == "3.8" ]; then -# numpy_ver="1.20" -# fi -# if [ ${pyver} == "3.9" ]; then -# numpy_ver="1.24" -# fi -# if [ ${pyver} == "3.10" ]; then -# numpy_ver="1.24" -# fi -# if [ ${pyver} == "3.11" ]; then -# numpy_ver="1.24" -# fi -numpy_ver="2.0.1" # Install build requirements. -CC="${CC}" CFLAGS="${CFLAGS}" pip install -v -r "${scriptdir}/build_requirements.txt" "numpy==${numpy_ver}" +CC="${CC}" CFLAGS="${CFLAGS}" pip install -v -r "${scriptdir}/build_requirements.txt" numpy # Build compiled dependencies diff --git a/src/toast/RELEASE b/src/toast/RELEASE index fb0455491..816e4a092 100644 --- a/src/toast/RELEASE +++ b/src/toast/RELEASE @@ -1 +1 @@ -3.0.0a28 +3.0.0a29 From 61be4b5ce3fa77fd9d092843f0829645ba6e2f5f Mon Sep 17 00:00:00 2001 From: Ted Kisner Date: Thu, 23 Jan 2025 21:28:27 -0800 Subject: [PATCH 2/7] conda-build is no longer needed --- packaging/conda/install_deps_conda.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/conda/install_deps_conda.sh b/packaging/conda/install_deps_conda.sh index 805cb5182..2c29121e5 100755 --- a/packaging/conda/install_deps_conda.sh +++ b/packaging/conda/install_deps_conda.sh @@ -62,7 +62,7 @@ for pfile in ${pkgfiles}; do plist=$(cat "${pfile}" | xargs -I % echo -n '"%" ') pkglist="${pkglist} ${plist}" done -pkglist="python=${pyversion} ${pkglist} compilers conda-build" +pkglist="python=${pyversion} ${pkglist} compilers" echo "Installing conda packages: ${pkglist}" conda install --yes --update-all ${pkglist} # The "cc" symlink breaks Crays... From 3410c3f06984b2aa2c69e43498938214cb17c8b3 Mon Sep 17 00:00:00 2001 From: Ted Kisner Date: Thu, 23 Jan 2025 22:42:25 -0800 Subject: [PATCH 3/7] Check wheel tests. --- .github/workflows/test.yml | 8 ++++---- .github/workflows/wheels.yml | 23 ++++++++++++----------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 401d4020f..683302275 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,10 +11,10 @@ on: push: branches: - master - pull_request: - branches: - - master - - toast3 + # pull_request: + # branches: + # - master + # - toast3 concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 9db474f93..be8f80f55 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -1,17 +1,18 @@ name: Test Binary Wheels -on: workflow_dispatch -# FIXME: Remove these lines once this workflow merged -# to main branch. -# on: -# push: -# branches: -# - master -# pull_request: -# branches: -# - master -# - toast3 + +on: + workflow_dispatch: + # FIXME: Remove these lines once this workflow merged + # to main branch. + push: + branches: + - master + pull_request: + branches: + - master + - toast3 concurrency: group: ${{ github.workflow }}-${{ github.ref }} From 34e5dfed0da6ea06579104fb9140d350f798c4f8 Mon Sep 17 00:00:00 2001 From: Ted Kisner Date: Thu, 23 Jan 2025 23:18:59 -0800 Subject: [PATCH 4/7] Use tomlkit instead of toml, to avoid bringing in a new, trivial dependency. --- src/toast/ops/sim_catalog.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/toast/ops/sim_catalog.py b/src/toast/ops/sim_catalog.py index 45216ec39..6734b2e4a 100644 --- a/src/toast/ops/sim_catalog.py +++ b/src/toast/ops/sim_catalog.py @@ -7,7 +7,7 @@ import h5py import healpy as hp import numpy as np -import toml +import tomlkit import traitlets from astropy.stats import gaussian_fwhm_to_sigma from astropy import units as u @@ -194,7 +194,7 @@ def _load_catalog(self): log = Logger.get() # Load the TOML into a dictionary with open(self.catalog_file, "r") as f: - self.catalog = toml.loads(f.read()) + self.catalog = tomlkit.parse(f.read()) # Check that the necessary keys are defined for every source for source_name, source_dict in self.catalog.items(): for key in ["ra_deg", "dec_deg", "freqs_ghz"]: From 171a57b4309cb9e804254b09286f91eed507e37f Mon Sep 17 00:00:00 2001 From: Ted Kisner Date: Thu, 23 Jan 2025 23:57:39 -0800 Subject: [PATCH 5/7] Another place where toml was used instead of tomlkit --- src/toast/tests/ops_sim_tod_catalog.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/toast/tests/ops_sim_tod_catalog.py b/src/toast/tests/ops_sim_tod_catalog.py index 8d538073e..949413c2d 100644 --- a/src/toast/tests/ops_sim_tod_catalog.py +++ b/src/toast/tests/ops_sim_tod_catalog.py @@ -4,7 +4,7 @@ import os -import toml +import tomlkit import healpy as hp import numpy as np from astropy import units as u @@ -78,7 +78,7 @@ def setUp(self): } with open(self.catalog_file, "w") as f: - f.write(toml.dumps(catalog)) + f.write(tomlkit.dumps(catalog)) if self.comm is not None: self.comm.barrier() From 16f9b7d1c35b7f00e860e4bbfee1497e868502b1 Mon Sep 17 00:00:00 2001 From: Ted Kisner Date: Fri, 24 Jan 2025 00:54:03 -0800 Subject: [PATCH 6/7] Arrays are not compatible with toml table --- src/toast/ops/sim_catalog.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/toast/ops/sim_catalog.py b/src/toast/ops/sim_catalog.py index 6734b2e4a..b272d20cb 100644 --- a/src/toast/ops/sim_catalog.py +++ b/src/toast/ops/sim_catalog.py @@ -233,7 +233,7 @@ def _load_catalog(self): for source_name, source_dict in self.catalog.items(): lon = source_dict["ra_deg"] lat = source_dict["dec_deg"] - source_dict["vec"] = hp.dir2vec(lon, lat, lonlat=True) + source_dict["vec"] = hp.dir2vec(lon, lat, lonlat=True).tolist() return def __init__(self, **kwargs): From 748efbbfe6231671be0ff21acee0f53361134d7d Mon Sep 17 00:00:00 2001 From: Ted Kisner Date: Fri, 24 Jan 2025 07:48:55 -0800 Subject: [PATCH 7/7] Restore normal testing --- .github/workflows/test.yml | 8 ++++---- .github/workflows/wheels.yml | 15 +++++++-------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 683302275..401d4020f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,10 +11,10 @@ on: push: branches: - master - # pull_request: - # branches: - # - master - # - toast3 + pull_request: + branches: + - master + - toast3 concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index be8f80f55..f95696801 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -1,18 +1,17 @@ name: Test Binary Wheels - on: workflow_dispatch: # FIXME: Remove these lines once this workflow merged # to main branch. - push: - branches: - - master - pull_request: - branches: - - master - - toast3 + # push: + # branches: + # - master + # pull_request: + # branches: + # - master + # - toast3 concurrency: group: ${{ github.workflow }}-${{ github.ref }}