Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused things, applied suggestions from Ruff #789

Closed
wants to merge 1 commit into from
Closed
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
6 changes: 3 additions & 3 deletions python_examples/megno/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

# Runs one simulation.
def simulation(par):
saturn_a, saturn_e = par
# saturn_a, saturn_e = par
sim = rebound.Simulation()
sim.integrator = "whfast"
sim.min_dt = 5.
Expand All @@ -27,8 +27,8 @@ def simulation(par):
# These parameters are only approximately those of Jupiter and Saturn.
sun = rebound.Particle(m=1.)
sim.add(sun)
jupiter = sim.add(primary=sun,m=0.000954, a=5.204, M=0.600, omega=0.257, e=0.048)
saturn = sim.add(primary=sun,m=0.000285, a=saturn_a, M=0.871, omega=1.616, e=saturn_e)
# jupiter = sim.add(primary=sun,m=0.000954, a=5.204, M=0.600, omega=0.257, e=0.048)
# saturn = sim.add(primary=sun,m=0.000285, a=saturn_a, M=0.871, omega=1.616, e=saturn_e)

sim.move_to_com()
sim.init_megno()
Expand Down
2 changes: 1 addition & 1 deletion rebound/horizons.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def query_horizons_for_particle(mass_unit=None, particle=None, m=None, x=None, y
found_match = True
except:
continue
if found_match == False:
if not found_match:
raise AttributeError("An error occured while calculating the date. Use one "+" or ".join(formats) + " or JDxxxxxxx.xxxxxx")
# set the cached initialization time if it's not set
global INITDATE
Expand Down
4 changes: 2 additions & 2 deletions rebound/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def ylim(self, value):


def draw(self, update=False, updateLimits=True):
if self.particles is None or update==False:
if self.particles is None or not update:
update = True # First run needs update
self.setup()
if update:
Expand Down Expand Up @@ -170,7 +170,7 @@ def setup(self):
# Color stuff
color = self.color
if color:
if color == True:
if color:
colors = [(1.,0.,0.),(0.,0.75,0.75),(0.75,0.,0.75),(0.75, 0.75, 0,),(0., 0., 0.),(0., 0., 1.),(0., 0.5, 0.)]
if isinstance(color, str):
colors = [get_color(color)]
Expand Down
8 changes: 4 additions & 4 deletions rebound/tests/test_bs.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ def test_bs_harmonic_only_high_eps(self):
def test_bs_harmonic_with_nbody(self):
sim = rebound.Simulation()
sim.add(m=1)
sim.add(m=1e-3,a=1,e=0.123);
sim.add(m=1e-3,a=2.6,e=0.123);
sim.add(m=1e-3,a=1,e=0.123)
sim.add(m=1e-3,a=2.6,e=0.123)
sim.integrator = "BS"
ode_ho = sim.create_ode(length=2, needs_nbody=False)
ode_ho.derivatives = derivatives_ho
Expand All @@ -74,8 +74,8 @@ def test_bs_harmonic_with_nbody(self):
def test_bs_harmonic_with_nbody_coupledy(self):
sim = rebound.Simulation()
sim.add(m=1)
sim.add(m=1e-3,a=1,e=0.123);
sim.add(m=1e-3,a=2.6,e=0.123);
sim.add(m=1e-3,a=1,e=0.123)
sim.add(m=1e-3,a=2.6,e=0.123)
sim.integrator = "BS"
ode_ho = sim.create_ode(length=2, needs_nbody=True)
ode_ho.derivatives = derivatives_ho
Expand Down
2 changes: 1 addition & 1 deletion rebound/tests/test_gravity.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def test_testparticle_whfast_comp_0(self):
warnings.simplefilter("always")
sim.integrate(10.)
self.assertEqual(1,len(w))
x0 = sim.particles[0].x
# x0 = sim.particles[0].x
# TODO
# Currently fails. WHFAST evolves COM, but should only include star
#self.assertEqual(x0, 0.)
Expand Down
Loading