Skip to content

Commit

Permalink
Add suffix Potential (#25)
Browse files Browse the repository at this point in the history
* rename Isochrone to IsochronePotential
* rename to MiyamotoNagaiPotential

Signed-off-by: nstarman <nstarman@users.noreply.github.com>
  • Loading branch information
nstarman committed Dec 9, 2023
1 parent 1c37cb3 commit 03dab46
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions notebooks/example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
" \"m_NFW\": 1.0e12,\n",
" \"r_s_NFW\": 15.0,\n",
"}\n",
"pot_disk = gpx.MiyamotoNagaiDisk(\n",
"pot_disk = gpx.MiyamotoNagaiPotential(\n",
" m=params_global[\"m_disk\"],\n",
" a=params_global[\"a_disk\"],\n",
" b=params_global[\"b_disk\"],\n",
Expand Down Expand Up @@ -439,7 +439,7 @@
"metadata": {},
"outputs": [],
"source": [
"pot_disk = gpx.MiyamotoNagaiDisk(\n",
"pot_disk = gpx.MiyamotoNagaiPotential(\n",
" m=params_global[\"m_disk\"],\n",
" a=params_global[\"a_disk\"],\n",
" b=params_global[\"b_disk\"],\n",
Expand Down Expand Up @@ -467,7 +467,7 @@
"source": [
"@jax.jit\n",
"def gen_observed_stream(params, ts, w0, M_sat):\n",
" pot_disk = gpx.MiyamotoNagaiDisk(\n",
" pot_disk = gpx.MiyamotoNagaiPotential(\n",
" m=params[\"m_disk\"], a=params[\"a_disk\"], b=params[\"b_disk\"], units=usys\n",
" )\n",
" pot_NFW = gpx.NFWPotential(m=params[\"m_NFW\"], r_s=params[\"r_s_NFW\"], units=usys)\n",
Expand Down
8 changes: 4 additions & 4 deletions src/galdynamix/potential/_potential/builtin.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""galdynamix: Galactic Dynamix in Jax."""

__all__ = [
"MiyamotoNagaiDisk",
"MiyamotoNagaiPotential",
"BarPotential",
"Isochrone",
"IsochronePotential",
"NFWPotential",
]

Expand Down Expand Up @@ -33,7 +33,7 @@
# -------------------------------------------------------------------


class MiyamotoNagaiDisk(AbstractPotential):
class MiyamotoNagaiPotential(AbstractPotential):
m: AbstractParameter = ParameterField(dimensions=mass) # type: ignore[assignment]
a: AbstractParameter = ParameterField(dimensions=length) # type: ignore[assignment]
b: AbstractParameter = ParameterField(dimensions=length) # type: ignore[assignment]
Expand Down Expand Up @@ -104,7 +104,7 @@ def _potential_energy(self, q: Vec3, /, t: FloatOrIntScalarLike) -> FloatScalar:
# -------------------------------------------------------------------


class Isochrone(AbstractPotential):
class IsochronePotential(AbstractPotential):
m: AbstractParameter = ParameterField(dimensions=mass) # type: ignore[assignment]
a: AbstractParameter = ParameterField(dimensions=length) # type: ignore[assignment]

Expand Down
4 changes: 2 additions & 2 deletions src/galdynamix/potential/_potential/subhalo.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import jax.typing as jt
from jax_cosmo.scipy.interpolate import InterpolatedUnivariateSpline

from galdynamix.potential._potential.builtin import Isochrone
from galdynamix.potential._potential.builtin import IsochronePotential
from galdynamix.potential._potential.core import AbstractPotential
from galdynamix.potential._potential.param import AbstractParameter, ParameterField
from galdynamix.units import galactic
Expand All @@ -36,7 +36,7 @@ def single_subhalo_potential(
TODO: custom unit specification/subhalo potential specficiation.
Currently supports units kpc, Myr, Msun, rad.
"""
pot_single = Isochrone(m=params["m"], a=params["a"], units=galactic)
pot_single = IsochronePotential(m=params["m"], a=params["a"], units=galactic)
return pot_single.potential_energy(q, t)


Expand Down

0 comments on commit 03dab46

Please sign in to comment.