Skip to content

Commit

Permalink
consolidate test_acceleration (#82)
Browse files Browse the repository at this point in the history
Signed-off-by: nstarman <nstarman@users.noreply.github.com>

# Conflicts:
#	src/galax/potential/_potential/composite.py
#	tests/unit/potential/builtin/test_mwpotential.py
  • Loading branch information
nstarman committed Jan 24, 2024
1 parent 0ed3206 commit 144c9b9
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 18 deletions.
3 changes: 0 additions & 3 deletions tests/unit/potential/builtin/test_bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,3 @@ def test_hessian(self, pot, x):
]
),
)

def test_acceleration(self, pot, x):
assert xp.allclose(pot.acceleration(x, t=0), -pot.gradient(x, t=0))
3 changes: 0 additions & 3 deletions tests/unit/potential/builtin/test_hernquist.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,3 @@ def test_hessian(self, pot, x):
]
),
)

def test_acceleration(self, pot, x):
assert xp.allclose(pot.acceleration(x, t=0), -pot.gradient(x, t=0))
3 changes: 0 additions & 3 deletions tests/unit/potential/builtin/test_isochrone.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,3 @@ def test_hessian(self, pot, x):
]
),
)

def test_acceleration(self, pot, x):
assert xp.allclose(pot.acceleration(x, t=0), -pot.gradient(x, t=0))
3 changes: 0 additions & 3 deletions tests/unit/potential/builtin/test_miyamotonagai.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,3 @@ def test_hessian(self, pot, x):
]
),
)

def test_acceleration(self, pot, x):
assert xp.allclose(pot.acceleration(x, t=0), -pot.gradient(x, t=0))
3 changes: 0 additions & 3 deletions tests/unit/potential/builtin/test_nfw.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,3 @@ def test_hessian(self, pot, x):
]
),
)

def test_acceleration(self, pot, x):
assert xp.allclose(pot.acceleration(x, t=0), -pot.gradient(x, t=0))
3 changes: 0 additions & 3 deletions tests/unit/potential/builtin/test_null.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,3 @@ def test_hessian(self, pot, x):
pot.hessian(x, t=0),
xp.array([[0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]]),
)

def test_acceleration(self, pot, x):
assert xp.allclose(pot.acceleration(x, t=0), -pot.gradient(x, t=0))
4 changes: 4 additions & 0 deletions tests/unit/potential/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,7 @@ def _potential_energy(self, q, t):

pot = TestPotential()
assert isinstance(pot, gp.AbstractPotentialBase)

# TODO: move up the hierarchy?
def test_acceleration(self, pot, x):
assert xp.allclose(pot.acceleration(x, t=0), -pot.gradient(x, t=0))

0 comments on commit 144c9b9

Please sign in to comment.