File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import importlib .util
12import logging
23
34logger = logging .getLogger (__name__ )
45
56import os
67
8+ if importlib .util .find_spec ("jax" ) is None :
9+ logger .warning (
10+ """
11+ JAX is not installed, so all computations will run on the pure NumPy
12+ path. Performance is significantly reduced without JAX — model fits
13+ that take minutes with JAX can take hours without it.
14+
15+ JAX is a default dependency of the PyAuto libraries; it is absent
16+ either because this platform has no JAX wheels (e.g. Intel macOS) or
17+ because it was uninstalled. On supported platforms, restore it with:
18+
19+ pip install jax
20+ """
21+ )
22+
723xla_env = os .environ .get ("XLA_FLAGS" )
824
925xla_env_set = True
Original file line number Diff line number Diff line change @@ -26,7 +26,15 @@ keywords = ["cli"]
2626dependencies = [
2727 " typing-inspect>=0.4.0" ,
2828 " PyYAML>=6.0.1" ,
29- " numpy>=1.24.0,<3.0.0"
29+ " numpy>=1.24.0,<3.0.0" ,
30+ # JAX is a default dependency (PyAutoLens#702): CPU wheels exist for every
31+ # supported platform except Intel macOS (jaxlib ships no macosx_x86_64
32+ # wheels for >=0.7), so the markers let Intel Macs resolve to the
33+ # NumPy-only path instead of failing at install. jax_wrapper warns loudly
34+ # at import when JAX is absent.
35+ ' jax>=0.7.0,<0.12.0; sys_platform != "darwin" or platform_machine == "arm64"' ,
36+ ' jaxlib>=0.7.0,<0.12.0; sys_platform != "darwin" or platform_machine == "arm64"' ,
37+ ' jaxnnls==1.0.1; sys_platform != "darwin" or platform_machine == "arm64"'
3038]
3139
3240[project .urls ]
@@ -43,11 +51,11 @@ version_scheme = "post-release"
4351local_scheme = " no-local-version"
4452
4553[project .optional-dependencies ]
46- jax = [
47- " jax>=0.7.0,<0.11.0 " ,
48- " jaxlib>=0.7.0,<0.11.0 " ,
49- " jaxnnls==1.0.1 "
50- ]
54+ # JAX moved into the base dependencies (PyAutoLens#702). The extra is kept as
55+ # a declared no-op so `pip install autonerves[ jax]` keeps resolving — removing
56+ # it would revive the pip history-walk trap ("version X does not provide the
57+ # extra 'jax'" is a warning, not an error; PyAutoLens#687) in reverse.
58+ jax = [ ]
5159optional = [
5260 " autonerves[jax]" ,
5361 " astropy>=5.0"
You can’t perform that action at this time.
0 commit comments