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

Commit

Permalink
Merge branch 'oblate_coord_rot' into debug
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Mar 1, 2024
2 parents 9fb6f21 + 914d8f6 commit 1743f29
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 56 deletions.
1 change: 1 addition & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ build:
jobs:
pre_build:
- ford fortran_docs.md
- pip install pyshtools
- DOC_BUILD=1 pip install .
python:
install:
Expand Down
26 changes: 13 additions & 13 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ channels:
- defaults

dependencies:
- python>=3.9
- numpy>=1.24.3
- scipy>=1.10.1
- xarray>=2022.11.0
- distributed>=2022.1
- dask>=2022.1
- bottleneck>=1.3.5
- h5netcdf>=1.0.2
- netcdf4>=1.6.2
- matplotlib>=3.7.1
- astropy>=5.1
- python==3.9
- numpy>=1.26.4
- scipy>=1.12.0
- xarray>=2024.2.0
- distributed>=2024.2.1
- dask>=2024.2.1
- bottleneck>=1.3.8
- h5netcdf>=1.3.0
- netcdf4>=1.6.5
- matplotlib>=3.8.3
- astropy>=6.0.0
- astroquery>=0.4.6
- tqdm>=4.65.0
- tqdm>=4.66.2
- x264>=1!157.20191217
- ffmpeg>=4.3.2
- cython>=3.0.0
- cython>=3.0.8
- pkg-config
- meson-python>=0.14
- setuptools_scm>=8
Expand Down
34 changes: 17 additions & 17 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ maintainers = [
{name = 'David A. Minton', email='daminton@purdue.edu'},
]
readme = "README.md"
requires-python=">=3.8"
requires-python=">=3.9"
license={file = "LICENSE"}
classifiers=[
'Development Status :: 3 - Alpha',
Expand All @@ -24,20 +24,20 @@ classifiers=[
]
keywords=['astronomy','astrophysics', 'planetary', 'n-body', 'integrator', 'symplectic', 'wisdom-holman', 'symba']
dependencies = [
'numpy>=1.24.3',
'scipy>=1.10.1',
'xarray>=2023.1',
'dask>=2023.5',
'distributed>=2023.5',
'bottleneck>=1.3.5',
'h5netcdf>=1.1',
'h5py>=3.9',
'netcdf4>=1.6.2',
'matplotlib>=3.7.1',
'astropy>=5.2',
'numpy>=1.26.4',
'scipy>=1.12.0',
'xarray>=2024.2.0',
'dask>=2024.2.1',
'distributed>=2024.2.1',
'bottleneck>=1.3.8',
'h5netcdf>=1.3.0',
'h5py>=3.10.0',
'netcdf4>=1.6.5',
'matplotlib>=3.8.3',
'astropy>=6.0.0',
'astroquery>=0.4.6',
'tqdm>=4.65',
'cython>=3.0.0',
'tqdm>=4.66.2',
'cython>=3.0.8',
]

[project.optional-dependencies]
Expand All @@ -48,8 +48,8 @@ Repository = 'https://github.itap.purdue.edu/MintonGroup/swiftest'

[build-system]
requires = [
"scikit-build-core>=0.8",
"cython>=3.0",
"scikit-build-core>=0.8.2",
"cython>=3.0.8",
]
build-backend = "scikit_build_core.build"

Expand Down Expand Up @@ -133,7 +133,7 @@ PATH="${HDF5_ROOT}/bin:${PATH}"
CMAKE_INSTALL_LIBDIR="lib"

[tool.cibuildwheel.linux]
skip = "cp312-* 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
15 changes: 0 additions & 15 deletions requirements.txt

This file was deleted.

30 changes: 19 additions & 11 deletions tests/test_swiftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,32 @@
from numpy.random import default_rng
from astroquery.jplhorizons import Horizons
import datetime
import tempfile

rng = default_rng(seed=123)

major_bodies = ["Sun","Mercury","Venus","Earth","Mars","Jupiter","Saturn","Uranus","Neptune"]
param = {}

class TestSwiftest(unittest.TestCase):
def setUp(self):
# Initialize a target and surface for testing
self.tmpdir=tempfile.TemporaryDirectory()
self.simdir = self.tmpdir.name

def tearDown(self):
# Clean up temporary directory
self.tmpdir.cleanup()

def test_gen_ic(self):
"""
Tests that Swiftest is able to successfully generate a set of initial conditions in a file without any exceptions being raised
"""
print("\ntest_gen_ic: Test whether we can generate simulation initial conditions test")
# Files that are expected to be generated:
simdir = "simdata"
file_list = [simdir, os.path.join(simdir,"param.in"), os.path.join(simdir,"init_cond.nc")]
file_list = [self.simdir, os.path.join(self.simdir,"param.in"), os.path.join(self.simdir,"init_cond.nc")]

sim = swiftest.Simulation()
sim = swiftest.Simulation(simdir=self.simdir)
sim.clean()

# Add the modern planets and the Sun using the JPL Horizons Database.
Expand All @@ -62,7 +70,7 @@ def test_read_ic(self):
Tests that Swiftest is able to read a set of pre-existing initial conditions files and that they contain the correct data
"""
print("\ntest_read_ic: Test whether we can read back initial conditions files created by test_gen_ic")
sim = swiftest.Simulation()
sim = swiftest.Simulation(simdir=self.simdir)
sim.clean()

# Add the modern planets and the Sun using the JPL Horizons Database.
Expand All @@ -81,7 +89,7 @@ def test_integrators(self):
Tests that Swiftest is able to integrate a collection of massive bodies and test particles with all available integrators
"""
print("\ntest_integrators: Tests that Swiftest is able to integrate a collection of massive bodies and test particles with all available integrators")
sim = swiftest.Simulation()
sim = swiftest.Simulation(simdir=self.simdir)

# Add the modern planets and the Sun using the JPL Horizons Database.
sim.add_solar_system_body(major_bodies)
Expand Down Expand Up @@ -116,18 +124,18 @@ def test_conservation(self):
print("\ntest_conservation: Tests that Swiftest conserves mass, energy, and momentum to within acceptable tolerances.")

# Error limits
L_slope_limit = 1e-10
E_slope_limit = 1e-8
L_slope_limit = 1e-9
E_slope_limit = 1e-7
GM_limit = 1e-14

sim = swiftest.Simulation()
sim = swiftest.Simulation(simdir=self.simdir)
sim.clean()

sim.add_solar_system_body(major_bodies)

dt = 0.01
nout = 1000
tstop = 1e4
nout = 100
tstop = 1e3
tstep_out = tstop / nout

sim.run(tstart=0.0, tstop=tstop, dt=dt, tstep_out=tstep_out, dump_cadence=0, compute_conservation_values=True, integrator="symba")
Expand Down Expand Up @@ -182,7 +190,7 @@ def test_gr(self):

# Initialize the simulation object as a variable. Define the directory in which the output will be placed.
tstep_out = 10.0
sim = swiftest.Simulation(tstop=1000.0, dt=0.005, tstep_out=tstep_out, dump_cadence=0,general_relativity=True)
sim = swiftest.Simulation(simdir=self.simdir, tstop=1000.0, dt=0.005, tstep_out=tstep_out, dump_cadence=0,general_relativity=True)
sim.add_solar_system_body(["Sun","Mercury","Venus","Earth","Mars","Jupiter","Saturn","Uranus","Neptune"])

# Get the start and end date of the simulation so we can compare with the real solar system.
Expand Down

0 comments on commit 1743f29

Please sign in to comment.