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

feat: plotting #97

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
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
29 changes: 29 additions & 0 deletions licences/BoundClass.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
BSD 3-Clause License

Copyright (c) 2022, Nathaniel Starkman
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ requires-python = ">=3.11"

[project.optional-dependencies]
# All runtime dependencies
all = ["galax[interop-all]"]
all = ["galax[interop-all,plot-all]"]
# Interoperability dependencies
interop-all = ["galax[interop-astropy]", "galax[interop-gala]", "galax[interop-galpy]"]
interop-astropy = [
Expand All @@ -68,6 +68,8 @@ interop-galpy = [
"galpy >= 1.8",
]
# TODO: agama
plot-all = ["galax[plot-matplotlib]"]
plot-matplotlib = ["matplotlib"]
# Documentation dependencies
docs = [
"sphinx>=7.0",
Expand Down
21 changes: 18 additions & 3 deletions src/galax/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,26 @@
)
from ._version import version as __version__, version_tuple as __version_tuple__

# ---------------------------
# Optional dependencies
# The act of importing registers in the functionality

if utils._optional_deps.HAS_ASTROPY: # noqa: SLF001
from ._interop import galax_interop_astropy # noqa: F401
from ._interop import galax_interop_astropy

del galax_interop_astropy

if utils._optional_deps.HAS_GALA: # noqa: SLF001
from ._interop import galax_interop_gala # noqa: F401
from ._interop import galax_interop_gala

Check warning on line 34 in src/galax/__init__.py

View check run for this annotation

Codecov / codecov/patch

src/galax/__init__.py#L34

Added line #L34 was not covered by tests

del galax_interop_gala

Check warning on line 36 in src/galax/__init__.py

View check run for this annotation

Codecov / codecov/patch

src/galax/__init__.py#L36

Added line #L36 was not covered by tests

if utils._optional_deps.HAS_GALPY: # noqa: SLF001
from ._interop import galax_interop_galpy # noqa: F401
from ._interop import galax_interop_galpy

Check warning on line 39 in src/galax/__init__.py

View check run for this annotation

Codecov / codecov/patch

src/galax/__init__.py#L39

Added line #L39 was not covered by tests

del galax_interop_galpy

Check warning on line 41 in src/galax/__init__.py

View check run for this annotation

Codecov / codecov/patch

src/galax/__init__.py#L41

Added line #L41 was not covered by tests

if utils._optional_deps.HAS_MATPLOTLIB: # noqa: SLF001
from ._interop import matplotlib

Check warning on line 44 in src/galax/__init__.py

View check run for this annotation

Codecov / codecov/patch

src/galax/__init__.py#L44

Added line #L44 was not covered by tests

del matplotlib

Check warning on line 46 in src/galax/__init__.py

View check run for this annotation

Codecov / codecov/patch

src/galax/__init__.py#L46

Added line #L46 was not covered by tests
6 changes: 6 additions & 0 deletions src/galax/_interop/matplotlib/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"""Matplotlib extension for :mod:`galax`."""

__all__ = ["plot_potential_contours", "plot_density_contours", "plot_rotation_curve"]

Check warning on line 3 in src/galax/_interop/matplotlib/__init__.py

View check run for this annotation

Codecov / codecov/patch

src/galax/_interop/matplotlib/__init__.py#L3

Added line #L3 was not covered by tests

from .contours import plot_density_contours, plot_potential_contours
from .rotcurve import plot_rotation_curve

Check warning on line 6 in src/galax/_interop/matplotlib/__init__.py

View check run for this annotation

Codecov / codecov/patch

src/galax/_interop/matplotlib/__init__.py#L5-L6

Added lines #L5 - L6 were not covered by tests
Loading
Loading