Skip to content
Merged
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
8 changes: 1 addition & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,7 @@ jobs:
pip3 install setuptools
pip3 install wheel
pip3 install pytest coverage pytest-cov
if [ "${{ matrix.python-version }}" = "3.12" ]; then
pip install ./PyAutoConf ./PyAutoFit ./PyAutoArray ./PyAutoGalaxy
pip install "./PyAutoArray[optional]" "./PyAutoGalaxy[optional]"
else
pip install ./PyAutoConf ./PyAutoFit ./PyAutoArray ./PyAutoGalaxy
pip install numba
fi
pip install ./PyAutoConf ./PyAutoFit "./PyAutoArray[optional]" "./PyAutoGalaxy[optional]"
- name: Run tests
run: |
export ROOT_DIR=`pwd`
Expand Down
14 changes: 14 additions & 0 deletions autogalaxy/plot/plot_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ def _critical_curves_method():

Returns ``"marching_squares"`` (the default) or ``"zero_contour"``.
Any unrecognised value falls back to ``"marching_squares"`` with a warning.
If ``"zero_contour"`` is requested but ``jax_zero_contour`` is not installed
(e.g. Python <3.11), falls back to ``"marching_squares"`` with a warning.
"""
from autoconf import conf

Expand All @@ -347,6 +349,18 @@ def _critical_curves_method():
f"'{method}'. Falling back to 'marching_squares'."
)
return "marching_squares"

if method == "zero_contour":
try:
import jax_zero_contour # noqa: F401
except ImportError:
logger.warning(
"critical_curves_method='zero_contour' requested, but "
"jax_zero_contour is not installed (Python <3.11 ships without "
"the [jax] extra). Falling back to 'marching_squares'."
)
return "marching_squares"

return method


Expand Down
14 changes: 14 additions & 0 deletions autogalaxy/util/plot_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ def _critical_curves_method():

Returns ``"marching_squares"`` (the default) or ``"zero_contour"``.
Any unrecognised value falls back to ``"marching_squares"`` with a warning.
If ``"zero_contour"`` is requested but ``jax_zero_contour`` is not installed
(e.g. Python <3.11), falls back to ``"marching_squares"`` with a warning.
"""
from autoconf import conf

Expand All @@ -347,6 +349,18 @@ def _critical_curves_method():
f"'{method}'. Falling back to 'marching_squares'."
)
return "marching_squares"

if method == "zero_contour":
try:
import jax_zero_contour # noqa: F401
except ImportError:
logger.warning(
"critical_curves_method='zero_contour' requested, but "
"jax_zero_contour is not installed (Python <3.11 ships without "
"the [jax] extra). Falling back to 'marching_squares'."
)
return "marching_squares"

return method


Expand Down
19 changes: 13 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dynamic = ["version"]
description="Open-Source Multi Wavelength Galaxy Structure & Morphology"
readme = { file = "README.rst", content-type = "text/x-rst" }
license = { text = "MIT" }
requires-python = ">=3.12"
requires-python = ">=3.9"
authors = [
{ name = "James Nightingale", email = "James.Nightingale@newcastle.ac.uk" },
{ name = "Richard Hayes", email = "richard@rghsoftware.co.uk" },
Expand All @@ -18,17 +18,20 @@ classifiers = [
"Topic :: Scientific/Engineering :: Physics",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13"
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14"
]
keywords = ["cli"]
dependencies = [
"autofit",
"autoarray",
"colossus==1.3.1",
"astropy>=5.0,<=7.2.0",
"nautilus-sampler==1.0.5",
"jax_zero_contour"
"nautilus-sampler==1.0.5"
]

[project.urls]
Expand All @@ -46,10 +49,14 @@ local_scheme = "no-local-version"


[project.optional-dependencies]
optional=[
jax = [
"autoconf[jax]",
"jax_zero_contour; python_version >= '3.11'"
]
optional = [
"autogalaxy[jax]",
"numba",
"pynufft",
"ultranest==3.6.2",
"zeus-mcmc==2.5.4",
"getdist==1.4"
]
Expand Down
Loading