Skip to content

Commit

Permalink
rename galdynamix to galax (#37)
Browse files Browse the repository at this point in the history
* rename galdynamix to galax
  • Loading branch information
nstarman committed Dec 13, 2023
1 parent bab2507 commit d2d121c
Show file tree
Hide file tree
Showing 62 changed files with 232 additions and 209 deletions.
8 changes: 4 additions & 4 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ _commit: 2023.10.27
_src_path: gh:scientific-python/cookie
backend: hatch
email: nstarman@users.noreply.github.com
full_name: galdynamix maintainers
full_name: galax maintainers
license: MIT
org: galdynamix
project_name: galdynamix
org: galax
project_name: galax
project_short_description: Galactic Dynamix in Jax.
url: https://github.com/galdynamix/galdynamix
url: https://github.com/GalacticDynamics/galax
vcs: true
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ pytest
Use pytest-cov to generate coverage reports:

```bash
pytest --cov=galdynamix
pytest --cov=galax
```

# Building docs
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2023 galdynamix maintainers
Copyright 2023 galax maintainers

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# galdynamix
# galax

[![Actions Status][actions-badge]][actions-link]
[![Documentation Status][rtd-badge]][rtd-link]
Expand All @@ -12,16 +12,16 @@
<!-- SPHINX-START -->

<!-- prettier-ignore-start -->
[actions-badge]: https://github.com/galdynamix/galdynamix/workflows/CI/badge.svg
[actions-link]: https://github.com/galdynamix/galdynamix/actions
[conda-badge]: https://img.shields.io/conda/vn/conda-forge/galdynamix
[conda-link]: https://github.com/conda-forge/galdynamix-feedstock
[actions-badge]: https://github.com/GalacticDynamics/galax/workflows/CI/badge.svg
[actions-link]: https://github.com/GalacticDynamics/galax/actions
[conda-badge]: https://img.shields.io/conda/vn/conda-forge/galax
[conda-link]: https://github.com/conda-forge/galax-feedstock
[github-discussions-badge]: https://img.shields.io/static/v1?label=Discussions&message=Ask&color=blue&logo=github
[github-discussions-link]: https://github.com/galdynamix/galdynamix/discussions
[pypi-link]: https://pypi.org/project/galdynamix/
[pypi-platforms]: https://img.shields.io/pypi/pyversions/galdynamix
[pypi-version]: https://img.shields.io/pypi/v/galdynamix
[rtd-badge]: https://readthedocs.org/projects/galdynamix/badge/?version=latest
[rtd-link]: https://galdynamix.readthedocs.io/en/latest/?badge=latest
[github-discussions-link]: https://github.com/GalacticDynamics/galax/discussions
[pypi-link]: https://pypi.org/project/galax/
[pypi-platforms]: https://img.shields.io/pypi/pyversions/galax
[pypi-version]: https://img.shields.io/pypi/v/galax
[rtd-badge]: https://readthedocs.org/projects/galax/badge/?version=latest
[rtd-link]: https://galax.readthedocs.io/en/latest/?badge=latest

<!-- prettier-ignore-end -->
8 changes: 4 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import importlib.metadata

project = "galdynamix"
copyright = "2023, galdynamix maintainers"
author = "galdynamix maintainers"
version = release = importlib.metadata.version("galdynamix")
project = "galax"
copyright = "2023, galax maintainers"
author = "galax maintainers"
version = release = importlib.metadata.version("galax")

extensions = [
"myst_parser",
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# galdynamix
# galax

```{toctree}
:maxdepth: 2
Expand Down
41 changes: 32 additions & 9 deletions notebooks/example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,16 @@
"\n",
"import numpy as np\n",
"\n",
"import galdynamix.potential as gpx\n",
"import galdynamix.dynamics as gdx\n",
"from galdynamix.units import UnitSystem\n",
"import galax.potential as gpx\n",
"import galax.dynamics as gdx\n",
"from galax.units import UnitSystem\n",
"\n",
"config.update(\"jax_enable_x64\", True)"
]
},
{
"cell_type": "markdown",
"id": "6a306379",
"metadata": {},
"source": [
"## Potentials"
Expand All @@ -40,6 +41,7 @@
{
"cell_type": "code",
"execution_count": 2,
"id": "480c8d57",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -61,7 +63,7 @@
" \"m_NFW\": 1.0e12,\n",
" \"r_s_NFW\": 15.0,\n",
"}\n",
"pot_disk = gpx.MiyamotoNagaiPotential(\n",
"pot_disk = gpx.MiyamotoNagaiDisk(\n",
" m=params_global[\"m_disk\"],\n",
" a=params_global[\"a_disk\"],\n",
" b=params_global[\"b_disk\"],\n",
Expand All @@ -83,6 +85,7 @@
{
"cell_type": "code",
"execution_count": 4,
"id": "70797f97",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -106,6 +109,7 @@
},
{
"cell_type": "markdown",
"id": "4459de91",
"metadata": {},
"source": [
"## Integrating Orbits"
Expand Down Expand Up @@ -139,6 +143,7 @@
{
"cell_type": "code",
"execution_count": 6,
"id": "a241d227",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -148,6 +153,7 @@
},
{
"cell_type": "markdown",
"id": "fc3a23b2",
"metadata": {},
"source": [
"And with Gala"
Expand All @@ -156,6 +162,7 @@
{
"cell_type": "code",
"execution_count": 7,
"id": "c0a8cc69",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -215,6 +222,7 @@
},
{
"cell_type": "markdown",
"id": "ae730d05",
"metadata": {},
"source": [
"## Mock Streams"
Expand Down Expand Up @@ -282,6 +290,7 @@
},
{
"cell_type": "markdown",
"id": "e2597d53",
"metadata": {},
"source": [
"Now in gala"
Expand Down Expand Up @@ -316,6 +325,7 @@
},
{
"cell_type": "markdown",
"id": "36345058",
"metadata": {},
"source": [
"Comparison plot"
Expand Down Expand Up @@ -409,6 +419,7 @@
},
{
"cell_type": "markdown",
"id": "d5826d57",
"metadata": {},
"source": [
"## Demonstrating Gradients"
Expand All @@ -417,6 +428,7 @@
{
"cell_type": "code",
"execution_count": 14,
"id": "9a884254",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -426,6 +438,7 @@
{
"cell_type": "code",
"execution_count": 15,
"id": "42110e83",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -436,10 +449,11 @@
{
"cell_type": "code",
"execution_count": 16,
"id": "3a956392",
"metadata": {},
"outputs": [],
"source": [
"pot_disk = gpx.MiyamotoNagaiPotential(\n",
"pot_disk = gpx.MiyamotoNagaiDisk(\n",
" m=params_global[\"m_disk\"],\n",
" a=params_global[\"a_disk\"],\n",
" b=params_global[\"b_disk\"],\n",
Expand All @@ -462,12 +476,13 @@
{
"cell_type": "code",
"execution_count": 17,
"id": "8cb87962",
"metadata": {},
"outputs": [],
"source": [
"@jax.jit\n",
"def gen_observed_stream(params, ts, w0, M_sat):\n",
" pot_disk = gpx.MiyamotoNagaiPotential(\n",
" pot_disk = gpx.MiyamotoNagaiDisk(\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 All @@ -487,9 +502,10 @@
"def compare_streams(params, ts, w0, M_sat):\n",
" ## first generate data stream (no grad tracking)\n",
" lead_arm, trail_arm = gen_observed_stream(params, ts, w0, M_sat)\n",
" lead_arm_obs, trail_arm_obs = jax.lax.stop_gradient(\n",
" lead_arm\n",
" ), jax.lax.stop_gradient(trail_arm)\n",
" lead_arm_obs, trail_arm_obs = (\n",
" jax.lax.stop_gradient(lead_arm),\n",
" jax.lax.stop_gradient(trail_arm),\n",
" )\n",
" return -jnp.sum((lead_arm - lead_arm_obs) ** 2 + (trail_arm - trail_arm_obs) ** 2)\n",
"\n",
"\n",
Expand All @@ -500,6 +516,7 @@
{
"cell_type": "code",
"execution_count": 18,
"id": "a9e65c06",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -511,6 +528,7 @@
{
"cell_type": "code",
"execution_count": 19,
"id": "27123f52",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -520,6 +538,7 @@
{
"cell_type": "code",
"execution_count": 20,
"id": "227aa50e",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -529,6 +548,7 @@
{
"cell_type": "code",
"execution_count": 21,
"id": "b4e0dfda",
"metadata": {},
"outputs": [
{
Expand All @@ -553,6 +573,7 @@
{
"cell_type": "code",
"execution_count": 22,
"id": "cf5f061a",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -564,6 +585,7 @@
{
"cell_type": "code",
"execution_count": 23,
"id": "5ae7c3bf",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -607,6 +629,7 @@
},
{
"cell_type": "markdown",
"id": "c1579395",
"metadata": {},
"source": [
"# Benchmark"
Expand Down
4 changes: 2 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def lint(session: nox.Session) -> None:
# # This needs to be installed into the package environment, and is slower
# # than a pre-commit check
# session.install(".", "pylint")
# session.run("pylint", "galdynamix", *session.posargs)
# session.run("pylint", "galax", *session.posargs)


@nox.session
Expand Down Expand Up @@ -89,7 +89,7 @@ def build_api_docs(session: nox.Session) -> None:
"--module-first",
"--no-toc",
"--force",
"../src/galdynamix",
"../src/galax",
)


Expand Down
20 changes: 10 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ build-backend = "hatchling.build"


[project]
name = "galdynamix"
name = "galax"
authors = [
{ name = "galdynamix maintainers", email = "nstarman@users.noreply.github.com" },
{ name = "galax maintainers", email = "nstarman@users.noreply.github.com" },
{ name = "Jake Nibauer", email = "jnibauer@princeton.edu" },
{ name = "Nathaniel Starkman", email = "nstarman@users.noreply.github.com" },
]
Expand Down Expand Up @@ -58,15 +58,15 @@ docs = [
]

[project.urls]
Homepage = "https://github.com/galdynamix/galdynamix"
"Bug Tracker" = "https://github.com/galdynamix/galdynamix/issues"
Discussions = "https://github.com/galdynamix/galdynamix/discussions"
Changelog = "https://github.com/galdynamix/galdynamix/releases"
Homepage = "https://github.com/GalacticDynamics/galax"
"Bug Tracker" = "https://github.com/GalacticDynamics/galax/issues"
Discussions = "https://github.com/GalacticDynamics/galax/discussions"
Changelog = "https://github.com/GalacticDynamics/galax/releases"


[tool.hatch]
version.source = "vcs"
build.hooks.vcs.version-file = "src/galdynamix/_version.py"
build.hooks.vcs.version-file = "src/galax/_version.py"
envs.default.dependencies = [
"pytest",
"pytest-cov",
Expand All @@ -88,7 +88,7 @@ testpaths = [


[tool.coverage]
run.source = ["galdynamix"]
run.source = ["galax"]
port.exclude_lines = [
'pragma: no cover',
'\.\.\.',
Expand All @@ -107,7 +107,7 @@ disallow_untyped_defs = false
disallow_incomplete_defs = false

[[tool.mypy.overrides]]
module = "galdynamix.*"
module = "galax.*"
disallow_untyped_defs = true
disallow_incomplete_defs = true
disable_error_code = ["name-defined"] # <- jaxtyping
Expand Down Expand Up @@ -163,7 +163,7 @@ ignore = [
"F841",
]
# Uncomment if using a _compat.typing backport
# typing-modules = ["galdynamix._compat.typing"]
# typing-modules = ["galax._compat.typing"]

[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F403"]
Expand Down
6 changes: 3 additions & 3 deletions src/galdynamix/__init__.py → src/galax/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Copyright (c) 2023 galdynamix maintainers. All rights reserved."""
"""Copyright (c) 2023 galax maintainers. All rights reserved."""
# ruff:noqa: F401

__all__ = [
Expand Down Expand Up @@ -27,5 +27,5 @@
else:
typechecker = None

with install_import_hook("galdynamix", typechecker):
from galdynamix import dynamics, integrate, potential, typing, units, utils
with install_import_hook("galax", typechecker):
from galax import dynamics, integrate, potential, typing, units, utils
File renamed without changes.
Loading

0 comments on commit d2d121c

Please sign in to comment.