From 5217638efd6c1be3145f62dd934578f7392abd25 Mon Sep 17 00:00:00 2001 From: Hanno Rein Date: Fri, 27 Oct 2023 10:00:47 -0400 Subject: [PATCH] python refactor --- rebound/__init__.py | 9 +++------ rebound/simulation.py | 8 +++----- rebound/simulationarchive.py | 2 -- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/rebound/__init__.py b/rebound/__init__.py index 6e0a03b17..ea1f3aa62 100644 --- a/rebound/__init__.py +++ b/rebound/__init__.py @@ -95,14 +95,11 @@ class ParticleNotFound(Exception): from .hash import hash from .tools import mod2pi, M_to_f, E_to_f, M_to_E, spherical_to_xyz, xyz_to_spherical -from .simulation import Simulation, Orbit, Variation, ODE, Vec3d, Vec3dBasic +from .simulation import Simulation, Variation, ODE, Vec3d, Vec3dBasic from .rotation import Rotation +from .orbit import Orbit from .particle import Particle from .plotting import OrbitPlot, OrbitPlotSet from .simulationarchive import Simulationarchive -class InterruptiblePool: - def __init__(self, processes=None, initializer=None, initargs=(), **kwargs): - raise RuntimeError("InterruptiblePool is deprecated. Use the multiprocess module instead.") - -__all__ = ["__libpath__", "__version__", "__build__", "__githash__", "Simulationarchive", "Simulation", "Orbit", "OrbitPlot", "OrbitPlotSet", "Particle", "SimulationError", "Encounter", "Collision", "Escape", "NoParticles", "ParticleNotFound", "InterruptiblePool","Variation", "clibrebound", "mod2pi", "M_to_f", "E_to_f", "M_to_E", "ODE", "Rotation", "Vec3d", "spherical_to_xyz", "xyz_to_spherical"] +__all__ = ["__libpath__", "__version__", "__build__", "__githash__", "Simulationarchive", "Simulation", "Orbit", "OrbitPlot", "OrbitPlotSet", "Particle", "SimulationError", "Encounter", "Collision", "Escape", "NoParticles", "ParticleNotFound", "Variation", "clibrebound", "mod2pi", "M_to_f", "E_to_f", "M_to_E", "ODE", "Rotation", "Vec3d", "spherical_to_xyz", "xyz_to_spherical"] diff --git a/rebound/simulation.py b/rebound/simulation.py index d6d87f546..d39352e1a 100644 --- a/rebound/simulation.py +++ b/rebound/simulation.py @@ -1,13 +1,11 @@ -from ctypes import Structure, c_double, POINTER, c_uint32, c_float, c_int, c_uint, c_uint32, c_int64, c_long, c_ulong, c_ulonglong, c_void_p, c_char_p, CFUNCTYPE, byref, create_string_buffer, addressof, pointer, cast, c_char, c_size_t, string_at, sizeof -from . import clibrebound, Escape, NoParticles, Encounter, Collision, SimulationError, ParticleNotFound +from ctypes import Structure, c_double, POINTER, c_uint32, c_float, c_int, c_uint, c_long, c_ulong, c_ulonglong, c_void_p, c_char_p, CFUNCTYPE, byref, create_string_buffer, addressof, pointer, c_char, c_size_t, string_at +from . import clibrebound, Escape, NoParticles, Encounter, Collision, SimulationError from .citations import cite from .particle import Particle from .particles import Particles -from .orbit import Orbit from .units import units_convert_particle, check_units, convert_G, hash_to_unit from .hash import hash as rebhash, HashPointerPair -from .vectors import * -import math +from .vectors import Vec3d, Vec3dBasic, Vec6d import os import sys import warnings diff --git a/rebound/simulationarchive.py b/rebound/simulationarchive.py index c3645dcc4..e0931be5b 100644 --- a/rebound/simulationarchive.py +++ b/rebound/simulationarchive.py @@ -6,8 +6,6 @@ import math import warnings -POINTER_REB_SIM = POINTER(Simulation) - class Simulationarchive(Structure): """ Simulationarchive Class.