Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Merge branch 'debug' into 4-write-a-basic-test-simulation-and-user-gu…
Browse files Browse the repository at this point in the history
…ide-for-spherical-harmonics-use
  • Loading branch information
daminton committed Mar 2, 2024
2 parents cddb658 + c257f03 commit dd360f2
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 41 deletions.
62 changes: 36 additions & 26 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,29 @@
name: swiftest

on:
release:
types: [published]
on:
workflow_dispatch:
pull_request:
push:
branches:
- master

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-11, macos-12, macos-13]
cibw_archs: [x86_64]
include:
- os: ubuntu-latest
cibw_archs: "aarch64"
env:
SYSTEM_VERSION_COMPAT: 0
os: [ubuntu-latest, macos-11, macos-13, macos-13, macos-14]

steps:
- name: Set up QEMU
if: matrix.cibw_archs == 'aarch64'
uses: docker/setup-qemu-action@v2
with:
platforms: arm64
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Build wheels
uses: pypa/cibuildwheel@v2.15.0
env:
CIBW_ARCHS: ${{ matrix.cibw_archs }}
with:
package-dir: .
output-dir: wheelhouse
config-file: "{package}/pyproject.toml"
uses: pypa/cibuildwheel@v2.16.5

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl

build_sdist:
Expand All @@ -47,6 +35,28 @@ jobs:
- name: Build sdist
run: pipx run build --sdist

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz

upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/swiftest
permissions:
id-token: write
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v4
with:
# unpacks all CIBW artifacts into dist/
pattern: cibw-*
path: dist
merge-multiple: true

- uses: pypa/gh-action-pypi-publish@release/v1
with:
path: dist/*.tar.gz
skip-existing: true
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

1 change: 0 additions & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ build:
jobs:
pre_build:
- ford fortran_docs.md
- pip install pyshtools
- DOC_BUILD=1 pip install .
python:
install:
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Swiftest

---
Swiftest is a software packaged designed to model the dynamical evolution of gravitational systems. Swiftest is a re-write of the
`Swifter <https://www.boulder.swri.edu/swifter/>`__ software package
Swiftest is a software packaged designed to model the dynamical evolution of gravitational systems. Swiftest is a re-write of the [Swifter](https://www.boulder.swri.edu/swifter/) software package that incorporates modern programming techniques and performance
improvements.
Swiftest is a software packaged designed to model the long-term dynamical dynamics of n-body systems with a dominant central body,
like the solar system. Swiftest is a re-write of the [Swifter](https://www.boulder.swri.edu/swifter/) software package that
incorporates modern programming techniques and performance improvements.

#### Installation

Expand Down
1 change: 0 additions & 1 deletion SHTOOLS
Submodule SHTOOLS deleted from 8b74bb
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ PATH="${HDF5_ROOT}/bin:${PATH}"
CMAKE_INSTALL_LIBDIR="lib"

[tool.cibuildwheel.linux]
skip = "pp* -manylinux_i686* *-musllinux*"
skip = "pp* *-manylinux_i686* *-musllinux*"
before-all = [
"yum install epel-release -y",
"yum install doxygen libxml2-devel libcurl-devel fftw-static openblas-devel lapack-devel -y",
Expand Down
17 changes: 12 additions & 5 deletions swiftest/shgrav.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,20 @@
#

from .constants import GC
import os

try:
import pyshtools as pysh
PYSHTOOLS_AVAILABLE = False

if 'READTHEDOCS' in os.environ:
# Assume pyshtools is available when building on ReadTheDocs
PYSHTOOLS_AVAILABLE = True
except ModuleNotFoundError:
PYSHTOOLS_AVAILABLE = False
print("pyshtools is not installed. Some features will be unavailable.")
else:
try:
import pyshtools as pysh
PYSHTOOLS_AVAILABLE = True
except ModuleNotFoundError:
print("pyshtools is not installed. Some features will be unavailable.")


if PYSHTOOLS_AVAILABLE:

Expand Down

0 comments on commit dd360f2

Please sign in to comment.