virgil-astro 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. virgil_astro-0.2.0/LICENSE +21 -0
  2. virgil_astro-0.2.0/MANIFEST.in +3 -0
  3. virgil_astro-0.2.0/PKG-INFO +150 -0
  4. virgil_astro-0.2.0/README.md +92 -0
  5. virgil_astro-0.2.0/pyproject.toml +119 -0
  6. virgil_astro-0.2.0/setup.cfg +4 -0
  7. virgil_astro-0.2.0/src/virgil/__init__.py +155 -0
  8. virgil_astro-0.2.0/src/virgil/_closure.py +188 -0
  9. virgil_astro-0.2.0/src/virgil/_elr.py +454 -0
  10. virgil_astro-0.2.0/src/virgil/_geometry.py +405 -0
  11. virgil_astro-0.2.0/src/virgil/_grid.py +140 -0
  12. virgil_astro-0.2.0/src/virgil/_precision.py +59 -0
  13. virgil_astro-0.2.0/src/virgil/_utils.py +85 -0
  14. virgil_astro-0.2.0/src/virgil/amigo.py +177 -0
  15. virgil_astro-0.2.0/src/virgil/coverage.py +331 -0
  16. virgil_astro-0.2.0/src/virgil/fields.py +225 -0
  17. virgil_astro-0.2.0/src/virgil/fitting.py +803 -0
  18. virgil_astro-0.2.0/src/virgil/grid_fit.py +407 -0
  19. virgil_astro-0.2.0/src/virgil/imaging.py +1307 -0
  20. virgil_astro-0.2.0/src/virgil/inference.py +383 -0
  21. virgil_astro-0.2.0/src/virgil/legacy/__init__.py +7 -0
  22. virgil_astro-0.2.0/src/virgil/legacy/oifits_implaneia.py +400 -0
  23. virgil_astro-0.2.0/src/virgil/likelihood.py +516 -0
  24. virgil_astro-0.2.0/src/virgil/limits.py +466 -0
  25. virgil_astro-0.2.0/src/virgil/models.py +2317 -0
  26. virgil_astro-0.2.0/src/virgil/oidata.py +831 -0
  27. virgil_astro-0.2.0/src/virgil/oifits.py +919 -0
  28. virgil_astro-0.2.0/src/virgil/plotting.py +1182 -0
  29. virgil_astro-0.2.0/src/virgil/scenes.py +155 -0
  30. virgil_astro-0.2.0/src/virgil/spectra.py +290 -0
  31. virgil_astro-0.2.0/src/virgil_astro.egg-info/PKG-INFO +150 -0
  32. virgil_astro-0.2.0/src/virgil_astro.egg-info/SOURCES.txt +33 -0
  33. virgil_astro-0.2.0/src/virgil_astro.egg-info/dependency_links.txt +1 -0
  34. virgil_astro-0.2.0/src/virgil_astro.egg-info/requires.txt +46 -0
  35. virgil_astro-0.2.0/src/virgil_astro.egg-info/top_level.txt +1 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Benjamin Pope
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,3 @@
1
+ # The sdist carries the package only. The tests need the repository's data,
2
+ # docs and notebooks, so they are run from a checkout, not from the sdist.
3
+ prune tests
@@ -0,0 +1,150 @@
1
+ Metadata-Version: 2.4
2
+ Name: virgil-astro
3
+ Version: 0.2.0
4
+ Summary: VIRGIL, the Versatile Interferometric Reconstruction and Gradient-based Inference Library: modelling and imaging interferometric data in JAX.
5
+ Author: Max Charles
6
+ Author-email: Benjamin Pope <benjamin.pope@mq.edu.au>, Dori Blakely <blakelyd@uvic.ca>, Shashank Dholakia <shashankdholakia1@gmail.com>, Toon De Prins <toon.deprins@protonmail.com>, Louis Desdoigts <ldes9555@uni.sydney.edu.au>
7
+ License-Expression: MIT
8
+ Project-URL: repository, https://github.com/benjaminpope/virgil
9
+ Keywords: python,optics,machine-learning,jax,autodiff,differentiable,diffraction,simulation,telescope,virgil
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Programming Language :: Python :: 3.12
13
+ Classifier: Programming Language :: Python :: 3.13
14
+ Classifier: Operating System :: OS Independent
15
+ Requires-Python: >=3.11
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Requires-Dist: jax>=0.8.0
19
+ Requires-Dist: jaxbessel>=0.1.0
20
+ Requires-Dist: equinox>=0.13.2
21
+ Requires-Dist: zodiax>=0.4.1
22
+ Requires-Dist: optimistix>=0.0.11
23
+ Requires-Dist: lineax>=0.1.0
24
+ Requires-Dist: optax>=0.2.6
25
+ Requires-Dist: numpyro>=0.19.0
26
+ Requires-Dist: numpy>=2.0
27
+ Requires-Dist: scipy>=1.13
28
+ Requires-Dist: matplotlib>=3.8
29
+ Requires-Dist: astropy>=6.1
30
+ Provides-Extra: plots
31
+ Requires-Dist: pandas>=2.2.2; extra == "plots"
32
+ Requires-Dist: chainconsumer>=1.1.3; extra == "plots"
33
+ Provides-Extra: legacy
34
+ Requires-Dist: astroquery>=0.4.7; extra == "legacy"
35
+ Provides-Extra: integrations
36
+ Requires-Dist: jaxoplanet>=0.1.0; extra == "integrations"
37
+ Provides-Extra: test
38
+ Requires-Dist: pytest>=8.0; extra == "test"
39
+ Requires-Dist: pytest-xdist>=3.5; extra == "test"
40
+ Requires-Dist: pyoifits>=0.4.10; extra == "test"
41
+ Requires-Dist: virgil-astro[plots]; extra == "test"
42
+ Provides-Extra: notebooks
43
+ Requires-Dist: tqdm>=4.66; extra == "notebooks"
44
+ Requires-Dist: ipywidgets>=8.0; extra == "notebooks"
45
+ Requires-Dist: virgil-astro[integrations,plots]; extra == "notebooks"
46
+ Provides-Extra: docs
47
+ Requires-Dist: mkdocs<2,>=1.6; extra == "docs"
48
+ Requires-Dist: mkdocs-material<10,>=9.6; extra == "docs"
49
+ Requires-Dist: mkdocstrings[python]>=0.30; extra == "docs"
50
+ Requires-Dist: zensical<0.1,>=0.0.62; extra == "docs"
51
+ Provides-Extra: dev
52
+ Requires-Dist: virgil-astro[docs,test]; extra == "dev"
53
+ Requires-Dist: ruff==0.11.0; extra == "dev"
54
+ Requires-Dist: pre-commit; extra == "dev"
55
+ Requires-Dist: build; extra == "dev"
56
+ Requires-Dist: twine; extra == "dev"
57
+ Dynamic: license-file
58
+
59
+ # virgil
60
+ [![PyPI version](https://badge.fury.io/py/virgil-astro.svg)](https://badge.fury.io/py/virgil-astro)
61
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
62
+ [![integration](https://github.com/benjaminpope/virgil/actions/workflows/tests.yml/badge.svg)](https://github.com/benjaminpope/virgil/actions/workflows/tests.yml)
63
+ [![Documentation](https://github.com/benjaminpope/virgil/actions/workflows/zensical-pages.yml/badge.svg)](https://benjaminpope.github.io/virgil/)
64
+
65
+ Versatile Interferometric Reconstruction and Gradient-based Inference Library.
66
+
67
+ Contributors: [Dori Blakely](https://github.com/blakelyd), [Benjamin Pope](https://github.com/benjaminpope), [Louis Desdoigts](https://github.com/LouisDesdoigts), [Shashank Dholakia](https://github.com/shashankdholakia), [Toon De Prins](https://github.com/DePrinsT), [Jonah Goldfine](https://github.com/JonahDG), [Max Charles](https://github.com/maxecharles), [Anand Sivaramakrishnan](https://github.com/anand0xff), [Ian Czekala](https://github.com/iancze) and [Jens Kammerer](https://github.com/kammerje). The [Contributors](https://benjaminpope.github.io/virgil/contributors/) page says who did what.
68
+
69
+ ## What is virgil?
70
+
71
+ virgil is a package for modelling optical interferometry data in JAX.
72
+
73
+ ## Installation
74
+
75
+ virgil is hosted on PyPI; the easiest way to install it is:
76
+
77
+ ```
78
+ pip install virgil-astro
79
+ ```
80
+
81
+ Optional extras add the corner-plot helpers in `virgil.plotting`
82
+ (`pip install "virgil-astro[plots]"`, for pandas and ChainConsumer) and the
83
+ SIMBAD lookups in `virgil.legacy` (`[legacy]`, for astroquery).
84
+
85
+ You can also build from source. To do so, clone the git repo and enter the directory:
86
+
87
+ ```
88
+ git clone --filter=blob:none https://github.com/benjaminpope/virgil
89
+ cd virgil
90
+ pip install .
91
+ ```
92
+
93
+ `--filter=blob:none` makes a partial clone: you get the full history, but old
94
+ versions of files are fetched only if you ask for them. It skips large data
95
+ files that are no longer used, so the download is about 15 MB rather than
96
+ about 280 MB.
97
+
98
+ We recommend using a virtual environment to avoid dependency conflicts.
99
+
100
+ Using `uv` (recommended):
101
+
102
+ ```bash
103
+ uv python install 3.11
104
+ uv venv --python 3.11 .venv
105
+ uv pip install --python .venv/bin/python -e ".[test]"
106
+ uv run --python .venv/bin/python pytest -q
107
+ ```
108
+
109
+
110
+ ## Use & Documentation
111
+
112
+ Documentation is published at [benjaminpope.github.io/virgil](https://benjaminpope.github.io/virgil/).
113
+
114
+ ### Using these docs
115
+
116
+ The sections in the sidebar hold worked examples on simulated and bundled data:
117
+ - **Background:** [who contributed what](https://benjaminpope.github.io/virgil/contributors/), and [Gaussian-process priors and information field theory](https://benjaminpope.github.io/virgil/gp_and_ift/).
118
+ - **Data Handling:** [reading OIFITS files into `OIData`](https://benjaminpope.github.io/virgil/data_io/), and [AMIGO's DISCO data from JWST aperture masking](https://benjaminpope.github.io/virgil/amigo_disco/).
119
+ - **Binaries:** [searching for companions](https://benjaminpope.github.io/virgil/binary_search/), [detection limits](https://benjaminpope.github.io/virgil/contrast_limits/), and [fitting several datasets together](https://benjaminpope.github.io/virgil/hierarchical_inference/).
120
+ - **Sources:** [visibility models](https://benjaminpope.github.io/virgil/model_syntax/), [extended sources](https://benjaminpope.github.io/virgil/source_models/), [composing scenes](https://benjaminpope.github.io/virgil/composition/), [spotted stars](https://benjaminpope.github.io/virgil/harmonix/) and [gravity-darkened stars](https://benjaminpope.github.io/virgil/gravity_darkened_star/).
121
+ - **Imaging:** image reconstruction in five parts: [simulating data](https://benjaminpope.github.io/virgil/imaging_ami/), [regularised maximum likelihood](https://benjaminpope.github.io/virgil/imaging_rml/), [Gaussian-process priors](https://benjaminpope.github.io/virgil/imaging_gp/), [a ring around a binary](https://benjaminpope.github.io/virgil/imaging_composite/) and [sampling the posterior](https://benjaminpope.github.io/virgil/imaging_sampling/).
122
+ - **[API Reference](https://benjaminpope.github.io/virgil/api/)** documents every public class and function.
123
+
124
+ Documentation tooling is currently migrating from MkDocs to Zensical. During this transition, both builders are supported from the same configuration file.
125
+
126
+ Local docs checks:
127
+
128
+ ```bash
129
+ uv run --python .venv/bin/python mkdocs build --strict
130
+ uv run --python .venv/bin/python zensical build --clean
131
+ ```
132
+
133
+ ## Independent validation
134
+
135
+ virgil's own tests mostly check virgil against itself. The companion repository [virgil-validation](https://github.com/benjaminpope/virgil-validation) checks it against code that shares nothing with it: geometric primitives with textbook visibilities, uv tracks and OIFITS files built from first principles, and aperture-masking images simulated with [dLux](https://github.com/LouisDesdoigts/dLux), which virgil then reads and fits. If you would like something else validated, please [open an Issue there](https://github.com/benjaminpope/virgil-validation/issues) describing the model or function, the independent result it should match, and the precision you expect.
136
+
137
+ ## Collaboration & Development
138
+
139
+ We welcome collaboration and development contributions. See [CONTRIBUTING.md](https://github.com/benjaminpope/virgil/blob/main/CONTRIBUTING.md) for development setup, testing, and pull request workflow. Release notes are in the [changelog](https://github.com/benjaminpope/virgil/blob/main/CHANGELOG.md).
140
+
141
+ ## Name
142
+
143
+ Why is it called virgil?
144
+
145
+ VIRGIL is the **V**ersatile **I**nterferometric **R**econstruction and **G**radient-based **I**nference **L**ibrary. In Dante's *Divine Comedy*, the poet Virgil is Dante's guide through the Inferno and Purgatory. In Virgil's own *Aeneid*, when Aeneas enters the underworld he draws his sword on the monsters crowding its threshold. His guide, the Cumaean Sibyl, warns him that they are only thin, bodiless lives flitting in a hollow semblance of form (*Aeneid* VI.292–294). Image reconstruction from sparse interferometric data is full of false visions like these: artefacts that look like structure but have no substance in the data. VIRGIL aims to help you tell the difference. The acronym is Jonah Goldfine's.
146
+
147
+ ### Formerly drpangloss
148
+
149
+ Until version 0.1.1 this package was called **drpangloss**, after Voltaire's Dr Pangloss and as a nod to Antoine Mérand's [CANDID](https://github.com/amerand/CANDID). From version 0.2.0 it is **virgil**: `import virgil`, installed with `pip install virgil-astro`. A final release of `drpangloss` under its own name will depend on `virgil-astro` and point here, so old installs find the new package.
150
+
@@ -0,0 +1,92 @@
1
+ # virgil
2
+ [![PyPI version](https://badge.fury.io/py/virgil-astro.svg)](https://badge.fury.io/py/virgil-astro)
3
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4
+ [![integration](https://github.com/benjaminpope/virgil/actions/workflows/tests.yml/badge.svg)](https://github.com/benjaminpope/virgil/actions/workflows/tests.yml)
5
+ [![Documentation](https://github.com/benjaminpope/virgil/actions/workflows/zensical-pages.yml/badge.svg)](https://benjaminpope.github.io/virgil/)
6
+
7
+ Versatile Interferometric Reconstruction and Gradient-based Inference Library.
8
+
9
+ Contributors: [Dori Blakely](https://github.com/blakelyd), [Benjamin Pope](https://github.com/benjaminpope), [Louis Desdoigts](https://github.com/LouisDesdoigts), [Shashank Dholakia](https://github.com/shashankdholakia), [Toon De Prins](https://github.com/DePrinsT), [Jonah Goldfine](https://github.com/JonahDG), [Max Charles](https://github.com/maxecharles), [Anand Sivaramakrishnan](https://github.com/anand0xff), [Ian Czekala](https://github.com/iancze) and [Jens Kammerer](https://github.com/kammerje). The [Contributors](https://benjaminpope.github.io/virgil/contributors/) page says who did what.
10
+
11
+ ## What is virgil?
12
+
13
+ virgil is a package for modelling optical interferometry data in JAX.
14
+
15
+ ## Installation
16
+
17
+ virgil is hosted on PyPI; the easiest way to install it is:
18
+
19
+ ```
20
+ pip install virgil-astro
21
+ ```
22
+
23
+ Optional extras add the corner-plot helpers in `virgil.plotting`
24
+ (`pip install "virgil-astro[plots]"`, for pandas and ChainConsumer) and the
25
+ SIMBAD lookups in `virgil.legacy` (`[legacy]`, for astroquery).
26
+
27
+ You can also build from source. To do so, clone the git repo and enter the directory:
28
+
29
+ ```
30
+ git clone --filter=blob:none https://github.com/benjaminpope/virgil
31
+ cd virgil
32
+ pip install .
33
+ ```
34
+
35
+ `--filter=blob:none` makes a partial clone: you get the full history, but old
36
+ versions of files are fetched only if you ask for them. It skips large data
37
+ files that are no longer used, so the download is about 15 MB rather than
38
+ about 280 MB.
39
+
40
+ We recommend using a virtual environment to avoid dependency conflicts.
41
+
42
+ Using `uv` (recommended):
43
+
44
+ ```bash
45
+ uv python install 3.11
46
+ uv venv --python 3.11 .venv
47
+ uv pip install --python .venv/bin/python -e ".[test]"
48
+ uv run --python .venv/bin/python pytest -q
49
+ ```
50
+
51
+
52
+ ## Use & Documentation
53
+
54
+ Documentation is published at [benjaminpope.github.io/virgil](https://benjaminpope.github.io/virgil/).
55
+
56
+ ### Using these docs
57
+
58
+ The sections in the sidebar hold worked examples on simulated and bundled data:
59
+ - **Background:** [who contributed what](https://benjaminpope.github.io/virgil/contributors/), and [Gaussian-process priors and information field theory](https://benjaminpope.github.io/virgil/gp_and_ift/).
60
+ - **Data Handling:** [reading OIFITS files into `OIData`](https://benjaminpope.github.io/virgil/data_io/), and [AMIGO's DISCO data from JWST aperture masking](https://benjaminpope.github.io/virgil/amigo_disco/).
61
+ - **Binaries:** [searching for companions](https://benjaminpope.github.io/virgil/binary_search/), [detection limits](https://benjaminpope.github.io/virgil/contrast_limits/), and [fitting several datasets together](https://benjaminpope.github.io/virgil/hierarchical_inference/).
62
+ - **Sources:** [visibility models](https://benjaminpope.github.io/virgil/model_syntax/), [extended sources](https://benjaminpope.github.io/virgil/source_models/), [composing scenes](https://benjaminpope.github.io/virgil/composition/), [spotted stars](https://benjaminpope.github.io/virgil/harmonix/) and [gravity-darkened stars](https://benjaminpope.github.io/virgil/gravity_darkened_star/).
63
+ - **Imaging:** image reconstruction in five parts: [simulating data](https://benjaminpope.github.io/virgil/imaging_ami/), [regularised maximum likelihood](https://benjaminpope.github.io/virgil/imaging_rml/), [Gaussian-process priors](https://benjaminpope.github.io/virgil/imaging_gp/), [a ring around a binary](https://benjaminpope.github.io/virgil/imaging_composite/) and [sampling the posterior](https://benjaminpope.github.io/virgil/imaging_sampling/).
64
+ - **[API Reference](https://benjaminpope.github.io/virgil/api/)** documents every public class and function.
65
+
66
+ Documentation tooling is currently migrating from MkDocs to Zensical. During this transition, both builders are supported from the same configuration file.
67
+
68
+ Local docs checks:
69
+
70
+ ```bash
71
+ uv run --python .venv/bin/python mkdocs build --strict
72
+ uv run --python .venv/bin/python zensical build --clean
73
+ ```
74
+
75
+ ## Independent validation
76
+
77
+ virgil's own tests mostly check virgil against itself. The companion repository [virgil-validation](https://github.com/benjaminpope/virgil-validation) checks it against code that shares nothing with it: geometric primitives with textbook visibilities, uv tracks and OIFITS files built from first principles, and aperture-masking images simulated with [dLux](https://github.com/LouisDesdoigts/dLux), which virgil then reads and fits. If you would like something else validated, please [open an Issue there](https://github.com/benjaminpope/virgil-validation/issues) describing the model or function, the independent result it should match, and the precision you expect.
78
+
79
+ ## Collaboration & Development
80
+
81
+ We welcome collaboration and development contributions. See [CONTRIBUTING.md](https://github.com/benjaminpope/virgil/blob/main/CONTRIBUTING.md) for development setup, testing, and pull request workflow. Release notes are in the [changelog](https://github.com/benjaminpope/virgil/blob/main/CHANGELOG.md).
82
+
83
+ ## Name
84
+
85
+ Why is it called virgil?
86
+
87
+ VIRGIL is the **V**ersatile **I**nterferometric **R**econstruction and **G**radient-based **I**nference **L**ibrary. In Dante's *Divine Comedy*, the poet Virgil is Dante's guide through the Inferno and Purgatory. In Virgil's own *Aeneid*, when Aeneas enters the underworld he draws his sword on the monsters crowding its threshold. His guide, the Cumaean Sibyl, warns him that they are only thin, bodiless lives flitting in a hollow semblance of form (*Aeneid* VI.292–294). Image reconstruction from sparse interferometric data is full of false visions like these: artefacts that look like structure but have no substance in the data. VIRGIL aims to help you tell the difference. The acronym is Jonah Goldfine's.
88
+
89
+ ### Formerly drpangloss
90
+
91
+ Until version 0.1.1 this package was called **drpangloss**, after Voltaire's Dr Pangloss and as a nod to Antoine Mérand's [CANDID](https://github.com/amerand/CANDID). From version 0.2.0 it is **virgil**: `import virgil`, installed with `pip install virgil-astro`. A final release of `drpangloss` under its own name will depend on `virgil-astro` and point here, so old installs find the new package.
92
+
@@ -0,0 +1,119 @@
1
+ [project]
2
+ name = "virgil-astro"
3
+ version = "0.2.0"
4
+ description = "VIRGIL, the Versatile Interferometric Reconstruction and Gradient-based Inference Library: modelling and imaging interferometric data in JAX."
5
+ readme = "README.md"
6
+ requires-python =">=3.11"
7
+ license = "MIT"
8
+ license-files = ["LICENSE"]
9
+ authors = [
10
+ {name = "Benjamin Pope", email = "benjamin.pope@mq.edu.au"},
11
+ {name = "Dori Blakely", email = "blakelyd@uvic.ca"},
12
+ {name = "Shashank Dholakia", email = "shashankdholakia1@gmail.com"},
13
+ {name = "Max Charles"},
14
+ {name = "Toon De Prins", email = "toon.deprins@protonmail.com"},
15
+ {name = "Louis Desdoigts", email = "ldes9555@uni.sydney.edu.au"},
16
+ ]
17
+ keywords = ["python", "optics", "machine-learning", "jax", "autodiff", "differentiable", "diffraction", "simulation", "telescope", "virgil"]
18
+ urls = {repository = "https://github.com/benjaminpope/virgil"}
19
+ dependencies = [
20
+ # Floors are the oldest versions CI tests (the "lowest" job in
21
+ # tests.yml installs exactly these). jax.enable_x64 needs jax 0.8.
22
+ "jax>=0.8.0",
23
+ "jaxbessel>=0.1.0",
24
+ "equinox>=0.13.2",
25
+ "zodiax>=0.4.1",
26
+ "optimistix>=0.0.11",
27
+ "lineax>=0.1.0",
28
+ "optax>=0.2.6",
29
+ "numpyro>=0.19.0",
30
+ "numpy>=2.0",
31
+ # scipy.spatial.ConvexHull triangulates the stellar mesh in _elr.py
32
+ # (jax already depends on scipy).
33
+ "scipy>=1.13",
34
+ "matplotlib>=3.8",
35
+ "astropy>=6.1",
36
+ ]
37
+ classifiers=[
38
+ "Programming Language :: Python :: 3",
39
+ "Programming Language :: Python :: 3.11",
40
+ "Programming Language :: Python :: 3.12",
41
+ "Programming Language :: Python :: 3.13",
42
+ "Operating System :: OS Independent",
43
+ ]
44
+
45
+ [build-system]
46
+ requires = ["setuptools>=77"]
47
+ build-backend = "setuptools.build_meta"
48
+
49
+ [project.optional-dependencies]
50
+ # ChainConsumer corner plots and the pandas tables in virgil.plotting.
51
+ plots = [
52
+ "pandas>=2.2.2",
53
+ "chainconsumer>=1.1.3",
54
+ ]
55
+ # The ImPlaneIA-derived writers in virgil.legacy look targets up in SIMBAD.
56
+ legacy = [
57
+ "astroquery>=0.4.7",
58
+ ]
59
+ # Spherical-harmonic stars (HarmonixModel). harmonix is not yet on PyPI in
60
+ # a version virgil works with; install it from GitHub, as CI does:
61
+ # pip install "harmonix @ git+https://github.com/shashankdholakia/harmonix"
62
+ integrations = [
63
+ "jaxoplanet>=0.1.0",
64
+ ]
65
+ test = [
66
+ "pytest>=8.0",
67
+ "pytest-xdist>=3.5",
68
+ "pyoifits>=0.4.10",
69
+ "virgil-astro[plots]",
70
+ ]
71
+ notebooks = [
72
+ "tqdm>=4.66",
73
+ "ipywidgets>=8.0",
74
+ "virgil-astro[plots,integrations]",
75
+ ]
76
+ docs = [
77
+ "mkdocs>=1.6,<2",
78
+ "mkdocs-material>=9.6,<10",
79
+ "mkdocstrings[python]>=0.30",
80
+ "zensical>=0.0.62,<0.1",
81
+ ]
82
+ dev = [
83
+ "virgil-astro[test,docs]",
84
+ "ruff==0.11.0",
85
+ "pre-commit",
86
+ "build",
87
+ "twine",
88
+ ]
89
+
90
+ [tool.ruff]
91
+ line-length = 79
92
+ # Must match the rev in .pre-commit-config.yaml and RUFF_VERSION in the workflows.
93
+ required-version = "==0.11.0"
94
+ force-exclude = true
95
+ extend-exclude = [
96
+ "site",
97
+ "docs/generated",
98
+ "notebooks/archive",
99
+ ]
100
+
101
+ [tool.ruff.lint]
102
+ select = ["E", "F"]
103
+ ignore = ["E402", "E501", "E721", "E731", "E741", "F722"]
104
+
105
+ [tool.ruff.lint.per-file-ignores]
106
+ "src/virgil/__init__.py" = ["F401"]
107
+ "notebooks/contrast_limits.ipynb" = ["E702"]
108
+
109
+ [tool.ruff.format]
110
+ quote-style = "double"
111
+ indent-style = "space"
112
+
113
+ [tool.pytest.ini_options]
114
+ testpaths = ["tests"]
115
+ python_files = ["test_*.py"]
116
+ addopts = "-q"
117
+ filterwarnings = [
118
+ "ignore:Setting `jax_pmap_shmap_merge` is deprecated in JAX v0.9.0:DeprecationWarning",
119
+ ]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,155 @@
1
+ """virgil: the Versatile Interferometric Reconstruction and Gradient-based Inference Library.
2
+
3
+ The everyday names are available at the top level::
4
+
5
+ from virgil import OIData, System, PointSource, likelihood_grid
6
+
7
+ Modules:
8
+
9
+ * [`oidata`][virgil.oidata] and [`oifits`][virgil.oifits]: data and
10
+ OIFITS files; [`amigo`][virgil.amigo]: AMIGO mixed-DISCO products.
11
+ * [`models`][virgil.models]: source models and their visibilities.
12
+ * [`likelihood`][virgil.likelihood]: likelihoods and numpyro models.
13
+ * [`fitting`][virgil.fitting]: `fit`, maximum a posteriori fits with
14
+ Levenberg–Marquardt, L-BFGS or Adam.
15
+ * [`imaging`][virgil.imaging]: regularisers and helpers for image
16
+ reconstruction; [`scenes`][virgil.scenes]: synthetic truth images;
17
+ [`coverage`][virgil.coverage]: synthetic coverage and noise.
18
+ * [`inference`][virgil.inference]: Laplace and Fisher curvature.
19
+ * [`grid_fit`][virgil.grid_fit]: grid searches.
20
+ * [`limits`][virgil.limits]: contrast limits and flux/contrast/Δmag
21
+ conversions.
22
+ * [`spectra`][virgil.spectra]: wavelength-dependent fluxes.
23
+ * [`plotting`][virgil.plotting]: figures.
24
+
25
+ The legacy ImPlaneIA tools in ``virgil.legacy`` are not imported here.
26
+ """
27
+
28
+ import importlib.metadata as _metadata
29
+
30
+ name = "virgil"
31
+
32
+ try:
33
+ __version__ = _metadata.version("virgil-astro")
34
+ except _metadata.PackageNotFoundError:
35
+ # Running from a source tree that was never installed.
36
+ __version__ = "unknown"
37
+
38
+ from . import ( # noqa: E402
39
+ amigo,
40
+ coverage,
41
+ fields,
42
+ fitting,
43
+ grid_fit,
44
+ imaging,
45
+ inference,
46
+ likelihood,
47
+ limits,
48
+ models,
49
+ oidata,
50
+ oifits,
51
+ plotting,
52
+ scenes,
53
+ spectra,
54
+ )
55
+ from ._geometry import pixel_offsets # noqa: E402
56
+ from .fields import GaussianField # noqa: E402
57
+ from .fitting import fit # noqa: E402
58
+ from .grid_fit import ( # noqa: E402
59
+ best_grid_point,
60
+ laplace_flux_uncertainty_grid,
61
+ likelihood_grid,
62
+ optimized_flux_grid,
63
+ optimized_likelihood_grid,
64
+ )
65
+ from .inference import fisher, laplace_cov # noqa: E402
66
+ from .likelihood import ( # noqa: E402
67
+ build_model,
68
+ inflated_errors,
69
+ loglike,
70
+ model_loglike,
71
+ numpyro_model,
72
+ whitened_residuals,
73
+ )
74
+ from .limits import ( # noqa: E402
75
+ absil_limits,
76
+ contrast_to_flux,
77
+ delta_mag_to_flux,
78
+ flux_to_contrast,
79
+ flux_to_delta_mag,
80
+ radial_profile,
81
+ ruffio_upperlimit,
82
+ )
83
+ from .models import ( # noqa: E402
84
+ BinaryModelAngular,
85
+ BinaryModelCartesian,
86
+ EllipticalGaussian,
87
+ FlaredDiskGaussian,
88
+ FlaredDiskHG,
89
+ FlaredDiskPowerLaw,
90
+ GaussianArc,
91
+ GaussianDisk,
92
+ GravityDarkenedStar,
93
+ HarmonixModel,
94
+ Image,
95
+ ModulatedGaussianRim,
96
+ PointSource,
97
+ Resolved,
98
+ SourceModel,
99
+ System,
100
+ UniformDisk,
101
+ circular_support,
102
+ )
103
+ from .oidata import OIData # noqa: E402
104
+ from .oifits import read_oifits, write_oifits # noqa: E402
105
+ from .spectra import BlackBody, PowerLaw # noqa: E402
106
+
107
+
108
+ __all__ = [
109
+ "BinaryModelAngular",
110
+ "BinaryModelCartesian",
111
+ "BlackBody",
112
+ "EllipticalGaussian",
113
+ "FlaredDiskGaussian",
114
+ "FlaredDiskHG",
115
+ "FlaredDiskPowerLaw",
116
+ "GaussianArc",
117
+ "GaussianDisk",
118
+ "GaussianField",
119
+ "GravityDarkenedStar",
120
+ "HarmonixModel",
121
+ "Image",
122
+ "ModulatedGaussianRim",
123
+ "OIData",
124
+ "PointSource",
125
+ "PowerLaw",
126
+ "Resolved",
127
+ "SourceModel",
128
+ "System",
129
+ "UniformDisk",
130
+ "absil_limits",
131
+ "circular_support",
132
+ "best_grid_point",
133
+ "build_model",
134
+ "contrast_to_flux",
135
+ "delta_mag_to_flux",
136
+ "fit",
137
+ "fisher",
138
+ "inflated_errors",
139
+ "flux_to_contrast",
140
+ "flux_to_delta_mag",
141
+ "laplace_cov",
142
+ "laplace_flux_uncertainty_grid",
143
+ "likelihood_grid",
144
+ "loglike",
145
+ "model_loglike",
146
+ "numpyro_model",
147
+ "optimized_flux_grid",
148
+ "optimized_likelihood_grid",
149
+ "pixel_offsets",
150
+ "radial_profile",
151
+ "read_oifits",
152
+ "ruffio_upperlimit",
153
+ "whitened_residuals",
154
+ "write_oifits",
155
+ ]