Skip to content

Commit

Permalink
feat: pot call allows all options
Browse files Browse the repository at this point in the history
  • Loading branch information
nstarman committed Jun 1, 2024
1 parent 863373d commit 0df0593
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/galax/potential/_potential/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,17 +161,14 @@ def potential(
return potential(self, *args, **kwargs)

@partial(jax.jit)
def __call__(
self, q: gt.LengthBatchVec3, /, t: gt.BatchableRealQScalar
) -> Float[Quantity["specific energy"], "*batch"]:
def __call__(self, *args: Any) -> Float[Quantity["specific energy"], "*batch"]:
"""Compute the potential energy at the given position(s).
Parameters
----------
q : Quantity[float, (*batch, 3), 'length']
The position to compute the value of the potential.
t : Array[float | int, *batch] | float | int
The time at which to compute the value of the potential.
*args : Any
Arguments to pass to the potential method.
See :func:`~galax.potential.potential`.
Returns
-------
Expand All @@ -180,9 +177,10 @@ def __call__(
See Also
--------
:func:`galax.potential.potential`
:meth:`galax.potential.AbstractPotentialBase.potential`
"""
return self.potential(q, t)
return self.potential(*args)

# ---------------------------------------
# Gradient
Expand Down

0 comments on commit 0df0593

Please sign in to comment.