m4opt 2.1.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 (177) hide show
  1. m4opt-2.1.0/.github/dependabot.yml +6 -0
  2. m4opt-2.1.0/.github/workflows/ci_cron_weekly.yml +46 -0
  3. m4opt-2.1.0/.github/workflows/ci_tests.yml +112 -0
  4. m4opt-2.1.0/.github/workflows/publish.yml +21 -0
  5. m4opt-2.1.0/.gitignore +70 -0
  6. m4opt-2.1.0/.pre-commit-config.yaml +44 -0
  7. m4opt-2.1.0/.readthedocs.yml +21 -0
  8. m4opt-2.1.0/CHANGES.rst +68 -0
  9. m4opt-2.1.0/CITATION.cff +100 -0
  10. m4opt-2.1.0/MANIFEST.in +10 -0
  11. m4opt-2.1.0/PKG-INFO +163 -0
  12. m4opt-2.1.0/README.rst +107 -0
  13. m4opt-2.1.0/docs/Makefile +133 -0
  14. m4opt-2.1.0/docs/_static/css/risk_table.css +45 -0
  15. m4opt-2.1.0/docs/_static/example.ecsv +304 -0
  16. m4opt-2.1.0/docs/_static/example.gif +0 -0
  17. m4opt-2.1.0/docs/conf.py +270 -0
  18. m4opt-2.1.0/docs/design/index.rst +7 -0
  19. m4opt-2.1.0/docs/design/milp.rst +348 -0
  20. m4opt-2.1.0/docs/dev/changes.rst +68 -0
  21. m4opt-2.1.0/docs/dev/contributing.rst +2 -0
  22. m4opt-2.1.0/docs/dev/index.rst +12 -0
  23. m4opt-2.1.0/docs/dev/npr7150.rst +338 -0
  24. m4opt-2.1.0/docs/dev/related.rst +80 -0
  25. m4opt-2.1.0/docs/dev/testing.rst +20 -0
  26. m4opt-2.1.0/docs/guide/cli.rst +10 -0
  27. m4opt-2.1.0/docs/guide/constraints.rst +12 -0
  28. m4opt-2.1.0/docs/guide/dynamics.rst +5 -0
  29. m4opt-2.1.0/docs/guide/fov.rst +189 -0
  30. m4opt-2.1.0/docs/guide/index.rst +17 -0
  31. m4opt-2.1.0/docs/guide/milp.rst +7 -0
  32. m4opt-2.1.0/docs/guide/missions.rst +79 -0
  33. m4opt-2.1.0/docs/guide/observer.rst +5 -0
  34. m4opt-2.1.0/docs/guide/skygrid.rst +81 -0
  35. m4opt-2.1.0/docs/guide/synphot.rst +41 -0
  36. m4opt-2.1.0/docs/guide/utils.rst +10 -0
  37. m4opt-2.1.0/docs/index.rst +63 -0
  38. m4opt-2.1.0/docs/install/cplex.rst +74 -0
  39. m4opt-2.1.0/docs/install/deploy.rst +73 -0
  40. m4opt-2.1.0/docs/install/gurobi.rst +49 -0
  41. m4opt-2.1.0/docs/install/index.rst +29 -0
  42. m4opt-2.1.0/docs/make.bat +172 -0
  43. m4opt-2.1.0/docs/refs.bib +222 -0
  44. m4opt-2.1.0/docs/scenarios/dorado.rst +151 -0
  45. m4opt-2.1.0/docs/scenarios/index.rst +14 -0
  46. m4opt-2.1.0/docs/scenarios/sedmachine.rst +4 -0
  47. m4opt-2.1.0/docs/scenarios/ztf.rst +113 -0
  48. m4opt-2.1.0/licenses/DORADO_LICENSE.txt +249 -0
  49. m4opt-2.1.0/licenses/LICENSE.rst +26 -0
  50. m4opt-2.1.0/licenses/README.rst +12 -0
  51. m4opt-2.1.0/licenses/TEMPLATE_LICENCE.rst +31 -0
  52. m4opt-2.1.0/m4opt/__init__.py +1 -0
  53. m4opt-2.1.0/m4opt/_cli/__init__.py +11 -0
  54. m4opt-2.1.0/m4opt/_cli/animate.py +467 -0
  55. m4opt-2.1.0/m4opt/_cli/core.py +74 -0
  56. m4opt-2.1.0/m4opt/_cli/prime.py +19 -0
  57. m4opt-2.1.0/m4opt/_cli/schedule.py +717 -0
  58. m4opt-2.1.0/m4opt/_cli/tests/__init__.py +0 -0
  59. m4opt-2.1.0/m4opt/_cli/tests/conftest.py +14 -0
  60. m4opt-2.1.0/m4opt/_cli/tests/data/800.fits +2185 -4
  61. m4opt-2.1.0/m4opt/_cli/tests/test_core.py +67 -0
  62. m4opt-2.1.0/m4opt/_cli/tests/test_end_to_end.py +94 -0
  63. m4opt-2.1.0/m4opt/_version.py +34 -0
  64. m4opt-2.1.0/m4opt/conftest.py +68 -0
  65. m4opt-2.1.0/m4opt/constraints/__init__.py +34 -0
  66. m4opt-2.1.0/m4opt/constraints/_airmass.py +67 -0
  67. m4opt-2.1.0/m4opt/constraints/_atnight.py +72 -0
  68. m4opt-2.1.0/m4opt/constraints/_body_separation.py +74 -0
  69. m4opt-2.1.0/m4opt/constraints/_core.py +31 -0
  70. m4opt-2.1.0/m4opt/constraints/_earth_limb.py +59 -0
  71. m4opt-2.1.0/m4opt/constraints/_galactic.py +23 -0
  72. m4opt-2.1.0/m4opt/constraints/_logical.py +98 -0
  73. m4opt-2.1.0/m4opt/constraints/_positional.py +160 -0
  74. m4opt-2.1.0/m4opt/constraints/_radiation.py +59 -0
  75. m4opt-2.1.0/m4opt/constraints/tests/__init__.py +0 -0
  76. m4opt-2.1.0/m4opt/constraints/tests/test_body_separation.py +37 -0
  77. m4opt-2.1.0/m4opt/constraints/tests/test_earth_limb.py +50 -0
  78. m4opt-2.1.0/m4opt/constraints/tests/test_galactic.py +19 -0
  79. m4opt-2.1.0/m4opt/constraints/tests/test_positional.py +69 -0
  80. m4opt-2.1.0/m4opt/dynamics/__init__.py +12 -0
  81. m4opt-2.1.0/m4opt/dynamics/_roll.py +156 -0
  82. m4opt-2.1.0/m4opt/dynamics/_slew.py +221 -0
  83. m4opt-2.1.0/m4opt/dynamics/tests/__init__.py +0 -0
  84. m4opt-2.1.0/m4opt/dynamics/tests/test_roll.py +29 -0
  85. m4opt-2.1.0/m4opt/extern/__init__.py +5 -0
  86. m4opt-2.1.0/m4opt/fov/__init__.py +3 -0
  87. m4opt-2.1.0/m4opt/fov/_core.py +357 -0
  88. m4opt-2.1.0/m4opt/milp.py +369 -0
  89. m4opt-2.1.0/m4opt/missions/__init__.py +9 -0
  90. m4opt-2.1.0/m4opt/missions/_core.py +57 -0
  91. m4opt-2.1.0/m4opt/missions/_rubin/__init__.py +74 -0
  92. m4opt-2.1.0/m4opt/missions/_rubin/data/LICENSE.txt +674 -0
  93. m4opt-2.1.0/m4opt/missions/_rubin/data/README.rst +12 -0
  94. m4opt-2.1.0/m4opt/missions/_rubin/data/lsstCamSim.yaml +18608 -0
  95. m4opt-2.1.0/m4opt/missions/_ultrasat/__init__.py +173 -0
  96. m4opt-2.1.0/m4opt/missions/_ultrasat/data/AllSS_grid_361.txt +361 -0
  97. m4opt-2.1.0/m4opt/missions/_ultrasat/data/LCS_nonoverlapping_grid.csv +241 -0
  98. m4opt-2.1.0/m4opt/missions/_ultrasat/data/README.rst +12 -0
  99. m4opt-2.1.0/m4opt/missions/_uvex.py +164 -0
  100. m4opt-2.1.0/m4opt/missions/_ztf/__init__.py +123 -0
  101. m4opt-2.1.0/m4opt/missions/_ztf/data/LICENSE.txt +29 -0
  102. m4opt-2.1.0/m4opt/missions/_ztf/data/README.rst +1 -0
  103. m4opt-2.1.0/m4opt/missions/_ztf/data/ZTF_Fields.txt +1779 -0
  104. m4opt-2.1.0/m4opt/observer/__init__.py +11 -0
  105. m4opt-2.1.0/m4opt/observer/_core.py +23 -0
  106. m4opt-2.1.0/m4opt/observer/_earth_fixed.py +19 -0
  107. m4opt-2.1.0/m4opt/observer/_spice.py +56 -0
  108. m4opt-2.1.0/m4opt/observer/_tle.py +101 -0
  109. m4opt-2.1.0/m4opt/py.typed +0 -0
  110. m4opt-2.1.0/m4opt/skygrid/__init__.py +6 -0
  111. m4opt-2.1.0/m4opt/skygrid/_geodesic.py +160 -0
  112. m4opt-2.1.0/m4opt/skygrid/_healpix.py +27 -0
  113. m4opt-2.1.0/m4opt/skygrid/_sinusoidal.py +46 -0
  114. m4opt-2.1.0/m4opt/skygrid/_spiral.py +35 -0
  115. m4opt-2.1.0/m4opt/skygrid/tests/__init__.py +0 -0
  116. m4opt-2.1.0/m4opt/skygrid/tests/test_skygrid.py +33 -0
  117. m4opt-2.1.0/m4opt/synphot/__init__.py +10 -0
  118. m4opt-2.1.0/m4opt/synphot/_bandpass.py +43 -0
  119. m4opt-2.1.0/m4opt/synphot/_detector.py +133 -0
  120. m4opt-2.1.0/m4opt/synphot/_extrinsic.py +95 -0
  121. m4opt-2.1.0/m4opt/synphot/_math.py +144 -0
  122. m4opt-2.1.0/m4opt/synphot/background/__init__.py +16 -0
  123. m4opt-2.1.0/m4opt/synphot/background/_core.py +4 -0
  124. m4opt-2.1.0/m4opt/synphot/background/_galactic.py +192 -0
  125. m4opt-2.1.0/m4opt/synphot/background/_skybright/__init__.py +108 -0
  126. m4opt-2.1.0/m4opt/synphot/background/_skybright/data/10FebZen.txt +2493 -0
  127. m4opt-2.1.0/m4opt/synphot/background/_skybright/data/10JunZen.txt +2491 -0
  128. m4opt-2.1.0/m4opt/synphot/background/_skybright/data/10Nog.txt +2493 -0
  129. m4opt-2.1.0/m4opt/synphot/background/_skybright/data/10Nwh.txt +2499 -0
  130. m4opt-2.1.0/m4opt/synphot/background/_skybright/data/10Phx.txt +2493 -0
  131. m4opt-2.1.0/m4opt/synphot/background/_skybright/data/10Tuc.txt +2499 -0
  132. m4opt-2.1.0/m4opt/synphot/background/_skybright/data/10Zen.txt +2499 -0
  133. m4opt-2.1.0/m4opt/synphot/background/_skybright/data/README.rst +12 -0
  134. m4opt-2.1.0/m4opt/synphot/background/_skybright/data/__init__.py +0 -0
  135. m4opt-2.1.0/m4opt/synphot/background/_zodiacal/__init__.py +231 -0
  136. m4opt-2.1.0/m4opt/synphot/background/_zodiacal/data/__init__.py +0 -0
  137. m4opt-2.1.0/m4opt/synphot/background/_zodiacal/data/leinert_zodi.txt +22 -0
  138. m4opt-2.1.0/m4opt/synphot/background/_zodiacal/data/stis_zodi_high.ecsv +71 -0
  139. m4opt-2.1.0/m4opt/synphot/extinction/__init__.py +5 -0
  140. m4opt-2.1.0/m4opt/synphot/extinction/_dust.py +115 -0
  141. m4opt-2.1.0/m4opt/synphot/extinction/tests/__init__.py +0 -0
  142. m4opt-2.1.0/m4opt/synphot/extinction/tests/test_dust.py +67 -0
  143. m4opt-2.1.0/m4opt/synphot/tests/__init__.py +0 -0
  144. m4opt-2.1.0/m4opt/synphot/tests/test_detector.py +95 -0
  145. m4opt-2.1.0/m4opt/tests/__init__.py +0 -0
  146. m4opt-2.1.0/m4opt/tests/hypothesis.py +40 -0
  147. m4opt-2.1.0/m4opt/tests/plugins/__init__.py +0 -0
  148. m4opt-2.1.0/m4opt/tests/plugins/problem_size_limits.py +10 -0
  149. m4opt-2.1.0/m4opt/tests/test_milp.py +135 -0
  150. m4opt-2.1.0/m4opt/utils/__init__.py +0 -0
  151. m4opt-2.1.0/m4opt/utils/console.py +138 -0
  152. m4opt-2.1.0/m4opt/utils/functional.py +25 -0
  153. m4opt-2.1.0/m4opt/utils/numpy.py +102 -0
  154. m4opt-2.1.0/m4opt/utils/optimization.py +307 -0
  155. m4opt-2.1.0/m4opt/utils/pybtex/__init__.py +0 -0
  156. m4opt-2.1.0/m4opt/utils/pybtex/styles/__init__.py +0 -0
  157. m4opt-2.1.0/m4opt/utils/pybtex/styles/short_alpha.py +47 -0
  158. m4opt-2.1.0/m4opt/utils/resource.py +39 -0
  159. m4opt-2.1.0/m4opt/utils/sympy.py +40 -0
  160. m4opt-2.1.0/m4opt/utils/tests/__init__.py +0 -0
  161. m4opt-2.1.0/m4opt/utils/tests/conftest.py +10 -0
  162. m4opt-2.1.0/m4opt/utils/tests/sphinx_roots/test-pybtex/conf.py +5 -0
  163. m4opt-2.1.0/m4opt/utils/tests/sphinx_roots/test-pybtex/index.rst +5 -0
  164. m4opt-2.1.0/m4opt/utils/tests/sphinx_roots/test-pybtex/refs.bib +35 -0
  165. m4opt-2.1.0/m4opt/utils/tests/test_console.py +11 -0
  166. m4opt-2.1.0/m4opt/utils/tests/test_optimization.py +121 -0
  167. m4opt-2.1.0/m4opt/utils/tests/test_pybtex.py +16 -0
  168. m4opt-2.1.0/m4opt/utils/typing_extensions.py +9 -0
  169. m4opt-2.1.0/m4opt.egg-info/PKG-INFO +163 -0
  170. m4opt-2.1.0/m4opt.egg-info/SOURCES.txt +175 -0
  171. m4opt-2.1.0/m4opt.egg-info/dependency_links.txt +1 -0
  172. m4opt-2.1.0/m4opt.egg-info/entry_points.txt +2 -0
  173. m4opt-2.1.0/m4opt.egg-info/requires.txt +38 -0
  174. m4opt-2.1.0/m4opt.egg-info/top_level.txt +4 -0
  175. m4opt-2.1.0/pyproject.toml +142 -0
  176. m4opt-2.1.0/setup.cfg +4 -0
  177. m4opt-2.1.0/tox.ini +88 -0
@@ -0,0 +1,6 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: github-actions
4
+ directory: /
5
+ schedule:
6
+ interval: weekly
@@ -0,0 +1,46 @@
1
+ # GitHub Actions workflow that runs on a cron schedule.
2
+
3
+ name: Cron Scheduled CI Tests
4
+
5
+ permissions: {}
6
+
7
+ on:
8
+ schedule:
9
+ # run at 6am UTC on Mondays
10
+ - cron: '0 6 * * 1'
11
+
12
+ jobs:
13
+ # Testing links in documents is a good example of something to run on a schedule
14
+ # to catch links that stop working for some reason.
15
+ cron_tests:
16
+ name: ${{ matrix.name }}
17
+ runs-on: ubuntu-latest
18
+ strategy:
19
+ matrix:
20
+ include:
21
+ - name: Check links in docs using tox
22
+ python: '3.11'
23
+ toxenv: linkcheck
24
+
25
+ - name: Python 3.11 with latest dev versions of key dependencies
26
+ python: '3.11'
27
+ toxenv: py311-test-devdeps
28
+
29
+ steps:
30
+ - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
31
+ - name: Cache Astropy data
32
+ uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
33
+ with:
34
+ key: ${{ matrix.toxenv }}
35
+ path: ~/.astropy/cache
36
+ - name: Set up python ${{ matrix.python }}
37
+ uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
38
+ with:
39
+ cache: pip
40
+ python-version: ${{ matrix.python }}
41
+ - name: Install base dependencies
42
+ run: |
43
+ python -m pip install --upgrade pip
44
+ python -m pip install tox
45
+ - name: Test with tox
46
+ run: tox -e ${{ matrix.toxenv }}
@@ -0,0 +1,112 @@
1
+ # GitHub Actions workflow for testing and continuous integration.
2
+ #
3
+ # This file performs testing using tox and tox.ini to define and configure the test environments.
4
+
5
+ name: CI Tests
6
+
7
+ permissions: {}
8
+
9
+ on:
10
+ - push
11
+ - pull_request
12
+
13
+ jobs:
14
+ types:
15
+ name: Python type checking
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - name: Checkout code
19
+ uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
20
+ with:
21
+ fetch-depth: 0
22
+ - name: Set up python
23
+ uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
24
+ with:
25
+ cache: pip
26
+ python-version: "3.11"
27
+ - name: Run mypy
28
+ uses: python/mypy@v1.19.1
29
+ # Github Actions supports ubuntu, windows, and macos virtual environments:
30
+ # https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
31
+ ci_tests:
32
+ name: ${{ matrix.name }}
33
+ runs-on: ${{ matrix.os }}
34
+ strategy:
35
+ matrix:
36
+ include:
37
+ - name: Python 3.11 with minimal dependencies and coverage checking
38
+ os: ubuntu-latest
39
+ python: '3.11'
40
+ toxenv: py311-test-cov
41
+
42
+ - name: Python 3.11 with all optional dependencies and coverage checking
43
+ os: ubuntu-latest
44
+ python: '3.11'
45
+ toxenv: py11-test-alldeps-cov
46
+
47
+ # - name: OS X - Python 3.11 with all optional dependencies
48
+ # os: macos-latest
49
+ # python: '3.11'
50
+ # toxenv: py311-test-alldeps
51
+
52
+ # - name: Windows - Python 3.11 with all optional dependencies
53
+ # os: windows-latest
54
+ # python: '3.11'
55
+ # toxenv: py311-test-alldeps
56
+
57
+ - name: Python 3.11 with oldest supported version of all dependencies
58
+ os: ubuntu-22.04
59
+ python: '3.11'
60
+ toxenv: py311-test-oldestdeps
61
+
62
+ # - name: Python 3.11 with latest dev versions of key dependencies
63
+ # os: ubuntu-latest
64
+ # python: '3.11'
65
+ # toxenv: py311-test-devdeps
66
+
67
+ # - name: Test building of Sphinx docs
68
+ # os: ubuntu-latest
69
+ # python: '3.11'
70
+ # toxenv: build_docs
71
+
72
+ steps:
73
+ - name: Checkout code
74
+ uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
75
+ with:
76
+ fetch-depth: 0
77
+ - name: Cache Astropy data
78
+ uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
79
+ with:
80
+ key: ${{ matrix.toxenv }}
81
+ path: ~/.astropy/cache
82
+ - name: Set up python ${{ matrix.python }} on ${{ matrix.os }}
83
+ uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
84
+ with:
85
+ cache: pip
86
+ python-version: ${{ matrix.python }}
87
+ - name: Install base dependencies
88
+ run: |
89
+ python -m pip install --upgrade pip
90
+ python -m pip install tox codecov
91
+
92
+ - name: Test with tox
93
+ env:
94
+ CPLEX_STUDIO_KEY: ${{ secrets.CPLEX_STUDIO_KEY }}
95
+ GRB_LICENSE_FILE_CONTENTS: ${{ secrets.GRB_LICENSE_FILE_CONTENTS }}
96
+ run: |
97
+ if [ -n "$GRB_LICENSE_FILE_CONTENTS" ]; then
98
+ printenv GRB_LICENSE_FILE_CONTENTS > $HOME/gurobi.lic
99
+ fi
100
+ tox -e ${{ matrix.toxenv }}
101
+
102
+ - name: Upload coverage to codecov
103
+ if: contains(matrix.toxenv, '-cov')
104
+ uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.0.0-beta
105
+ with:
106
+ token: ${{ secrets.CODECOV_TOKEN }}
107
+
108
+ - name: Upload test results to Codecov
109
+ if: contains(matrix.toxenv, '-cov')
110
+ uses: codecov/test-results-action@47f89e9acb64b76debcd5ea40642d25a4adced9f # v1.1.1
111
+ with:
112
+ token: ${{ secrets.CODECOV_TOKEN }}
@@ -0,0 +1,21 @@
1
+ name: Publish
2
+
3
+ permissions: {}
4
+
5
+ on:
6
+ schedule:
7
+ # run every day at 4am UTC
8
+ - cron: '0 4 * * *'
9
+ workflow_dispatch:
10
+ pull_request:
11
+ push:
12
+ branches:
13
+ - main
14
+ tags:
15
+ - v*
16
+
17
+ jobs:
18
+ publish:
19
+ uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@9f1fedda61294df4c004c05519a3fbf3b8e1f32f # v2.3.1
20
+ secrets:
21
+ pypi_token: ${{ secrets.pypi_token }}
m4opt-2.1.0/.gitignore ADDED
@@ -0,0 +1,70 @@
1
+ # Compiled files
2
+ *.py[cod]
3
+ *.a
4
+ *.o
5
+ *.so
6
+ __pycache__
7
+
8
+ # Ignore .c files by default to avoid including generated code. If you want to
9
+ # add a non-generated .c extension, use `git add -f filename.c`.
10
+ *.c
11
+
12
+ # Other generated files
13
+ */_version.py
14
+ */cython_version.py
15
+ htmlcov
16
+ .coverage
17
+ .coverage.*
18
+ MANIFEST
19
+ .ipynb_checkpoints
20
+ .hypothesis
21
+ junit.xml
22
+
23
+ # Sphinx
24
+ docs/api
25
+ docs/_build
26
+ docs/guide/roman_wfi.ds9
27
+
28
+ # Eclipse editor project files
29
+ .project
30
+ .pydevproject
31
+ .settings
32
+
33
+ # Pycharm editor project files
34
+ .idea
35
+
36
+ # Floobits project files
37
+ .floo
38
+ .flooignore
39
+
40
+ # Visual Studio Code project files
41
+ .vscode
42
+
43
+ # Packages/installer info
44
+ *.egg
45
+ *.egg-info
46
+ dist
47
+ build
48
+ eggs
49
+ .eggs
50
+ parts
51
+ bin
52
+ var
53
+ sdist
54
+ develop-eggs
55
+ .installed.cfg
56
+ distribute-*.tar.gz
57
+
58
+ # Other
59
+ .cache
60
+ .tox
61
+ .*.sw[op]
62
+ *~
63
+ .project
64
+ .pydevproject
65
+ .settings
66
+ pip-wheel-metadata/
67
+ .tmp
68
+
69
+ # Mac OSX
70
+ .DS_Store
@@ -0,0 +1,44 @@
1
+ # See https://pre-commit.com for more information
2
+ # See https://pre-commit.com/hooks.html for more hooks
3
+ repos:
4
+ - repo: https://github.com/pre-commit/pre-commit-hooks
5
+ rev: v6.0.0
6
+ hooks:
7
+ - id: check-case-conflict
8
+ # Check for files with names that would conflict on a case-insensitive
9
+ # filesystem like MacOS HFS+ or Windows FAT.
10
+ - id: check-json
11
+ # Attempts to load all json files to verify syntax.
12
+ - id: check-merge-conflict
13
+ # Check for files that contain merge conflict strings.
14
+ - id: check-symlinks
15
+ # Checks for symlinks which do not point to anything.
16
+ - id: check-toml
17
+ # Attempts to load all TOML files to verify syntax.
18
+ - id: check-xml
19
+ # Attempts to load all xml files to verify syntax.
20
+ - id: check-yaml
21
+ # Attempts to load all yaml files to verify syntax.
22
+ - id: detect-private-key
23
+ # Checks for the existence of private keys.
24
+ - id: end-of-file-fixer
25
+ # Makes sure files end in a newline and only a newline.
26
+ - id: trailing-whitespace
27
+ # Trims trailing whitespace.
28
+ exclude_types: [python] # Covered by Ruff W291.
29
+ - repo: https://github.com/astral-sh/ruff-pre-commit
30
+ # Ruff version.
31
+ rev: v0.14.10
32
+ hooks:
33
+ # Run the linter.
34
+ - id: ruff-check
35
+ args: ["--extend-select", "I", "--fix"]
36
+ # Run the formatter.
37
+ - id: ruff-format
38
+ - repo: https://github.com/codespell-project/codespell
39
+ rev: v2.4.1
40
+ hooks:
41
+ - id: codespell
42
+ args: ["--write-changes"]
43
+ additional_dependencies:
44
+ - tomli
@@ -0,0 +1,21 @@
1
+ version: 2
2
+
3
+ build:
4
+ apt_packages:
5
+ - graphviz
6
+ os: ubuntu-24.04
7
+ tools:
8
+ python: '3.11'
9
+
10
+ python:
11
+ install:
12
+ - method: pip
13
+ path: .
14
+ extra_requirements:
15
+ - docs
16
+ - all
17
+
18
+ sphinx:
19
+ configuration: docs/conf.py
20
+
21
+ formats: []
@@ -0,0 +1,68 @@
1
+ *******
2
+ Changes
3
+ *******
4
+
5
+ 2.1.0 (2025-12-31)
6
+ ==================
7
+
8
+ - Add the method ``m4opt.milp.Model.to_stream``.
9
+
10
+ - Add the method ``m4opt.utils.optimization.partition_graph_color``.
11
+
12
+ 2.0.1 (2025-06-12)
13
+ ==================
14
+
15
+ - Allow passing any options to METIS.
16
+
17
+ 2.0.0 (2025-06-09)
18
+ ==================
19
+
20
+ - Allow each mission to have one or several different sky grids.
21
+
22
+ - Add support for combining constraints using boolean operators
23
+ (``lhs | rhs``, ``lhs & rhs``, ``~op``).
24
+
25
+ - The ``Mission.constraints`` property no longer accepts a list of constraints.
26
+ To combine multiple constraints, use boolean operators.
27
+
28
+ - The ``Mission.detector`` property is now optional. Only adaptive exposure
29
+ time observing strategies require it to be defined.
30
+
31
+ - Add Earth radiation belt constraint.
32
+
33
+ - Add two new missions: Vera C. Rubin Observatory and Zwicky Transient
34
+ Facility.
35
+
36
+ - Add a mixed integer programming Traveling Salesman solver.
37
+
38
+ 1.0.0 (2025-04-07)
39
+ ==================
40
+
41
+ - Add citation file.
42
+
43
+ - Refactor obsever position classes to support both Earth-fixed and
44
+ Earth-orbiting observers.
45
+
46
+ - Add basic positional astronomy constraints on right ascension, declination,
47
+ altitutide, azimuth, and airmass.
48
+
49
+ - Add at-night constraint for Earth-fixed observers.
50
+
51
+ - Add logical constraints (and, or, not).
52
+
53
+ - Add an exact Traveling Salesman solver as a utility function.
54
+
55
+ - Move the DustExtinction class to the m4opt.synphot.extinction module
56
+ to prepare for adding other sources of extinction (e.g., atmospheric).
57
+
58
+ - Add optional zoom inset to animation.
59
+
60
+ 0.1.1 (2025-02-24)
61
+ ==================
62
+
63
+ - Update PyPI long description. No functional changes in this release.
64
+
65
+ 0.1.0 (2025-02-24)
66
+ ==================
67
+
68
+ - First release.
@@ -0,0 +1,100 @@
1
+ cff-version: 1.2.0
2
+ message: Please cite the following works when using this software.
3
+ type: software
4
+ abstract: Multi-Mission Multi-Messenger Observation Planning Toolkit
5
+ authors:
6
+ - family-names: Singer
7
+ given-names: Leo
8
+ - name: pre-commit-ci[bot]
9
+ - name: dependabot[bot]
10
+ - family-names: Parazin
11
+ given-names: B
12
+ - family-names: Tollerud
13
+ given-names: Erik
14
+ - family-names: Bard
15
+ given-names: Chris
16
+ - family-names: Healy
17
+ given-names: Brian
18
+ - family-names: Bellm
19
+ given-names: Eric
20
+ - family-names: Kiendrébéogo
21
+ given-names: Ramodgwendé Weizmann
22
+ - family-names: Wagh
23
+ given-names: Yogesh
24
+ date-released: 2025-02-24
25
+ identifiers:
26
+ - type: url
27
+ value: https://github.com/m4opt/m4opt
28
+ title: m4opt/m4opt
29
+ url: https://github.com/m4opt/m4opt
30
+ version: v0.1.1
31
+ preferred-citation:
32
+ abstract: >-
33
+ The UltraViolet EXplorer (UVEX) is a wide-field ultraviolet space telescope
34
+ selected as a NASA Medium-Class Explorer (MIDEX) mission for launch in 2030.
35
+ UVEX will undertake deep, cadenced surveys of the entire sky to probe low
36
+ mass galaxies and explore the ultraviolet (UV) time-domain sky, and it will
37
+ carry the first rapidly deployable UV spectroscopic capability for a broad
38
+ range of science applications. One of UVEX's prime objectives is to follow
39
+ up gravitational wave (GW) binary neutron star mergers as targets of
40
+ opportunity (ToOs), rapidly scanning across their localization regions to
41
+ search for their kilonova (KN) counterparts. Early-time multiband
42
+ ultraviolet light curves of KNe are key to explaining the interplay between
43
+ jet and ejecta in binary neutron star mergers. Owing to high Galactic
44
+ extinction in the ultraviolet and the variation of GW distance estimates
45
+ over the sky, the sensitivity to kilonovae can vary significantly across the
46
+ GW localization and even across the footprint of a single image given UVEX's
47
+ large field of view. Good ToO observing strategies to trade off between area
48
+ and depth are neither simple nor obvious. We present an optimal strategy for
49
+ GW follow-up with UVEX in which exposure time is adjusted dynamically for
50
+ each field individually to maximize the overall probability of detection. We
51
+ model the scheduling problem using the expressive and powerful mathematical
52
+ framework of mixed integer linear programming (MILP), and employ a
53
+ state-of-the-art MILP solver to automatically generate observing plan
54
+ timelines that achieve high probabilities of kilonova detection. We have
55
+ implemented this strategy in an open-source astronomical scheduling software
56
+ package called the Multi-Mission Multi-Messenger Observation Planning
57
+ Toolkit (M4OPT), on GitHub at https://github.com/m4opt/m4opt.
58
+ authors:
59
+ - family-names: Singer
60
+ given-names: Leo P.
61
+ - family-names: Criswell
62
+ given-names: Alexander W.
63
+ - family-names: Leggio
64
+ given-names: Sydney C.
65
+ - family-names: Kiendrebeogo
66
+ given-names: R. Weizmann
67
+ - family-names: Coughlin
68
+ given-names: Michael W.
69
+ - family-names: Earnshaw
70
+ given-names: Hannah P.
71
+ - family-names: Gezari
72
+ given-names: Suvi
73
+ - family-names: Grefenstette
74
+ given-names: Brian W.
75
+ - family-names: Harrison
76
+ given-names: Fiona A.
77
+ - family-names: Kasliwal
78
+ given-names: Mansi M.
79
+ - family-names: Morris
80
+ given-names: Brett M.
81
+ - family-names: Tollerud
82
+ given-names: Erik
83
+ - family-names: Cenko
84
+ given-names: S. Bradley
85
+ doi: 10.48550/ARXIV.2502.17560
86
+ identifiers:
87
+ - type: doi
88
+ value: 10.48550/ARXIV.2502.17560
89
+ - type: url
90
+ value: https://arxiv.org/abs/2502.17560
91
+ title: >-
92
+ Optimal Follow-Up of Gravitational-Wave Events with the UltraViolet EXplorer
93
+ (UVEX)
94
+ url: https://arxiv.org/abs/2502.17560
95
+ version: '1'
96
+ date-published: 2025-01-01
97
+ year: 2025
98
+ publisher:
99
+ name: arXiv
100
+ type: article
@@ -0,0 +1,10 @@
1
+ recursive-include m4opt *.pyx *.c *.pxd
2
+ recursive-include docs *
3
+ recursive-include licenses *
4
+ recursive-include scripts *
5
+
6
+ prune build
7
+ prune docs/_build
8
+ prune docs/api
9
+
10
+ global-exclude *.pyc *.o
m4opt-2.1.0/PKG-INFO ADDED
@@ -0,0 +1,163 @@
1
+ Metadata-Version: 2.4
2
+ Name: m4opt
3
+ Version: 2.1.0
4
+ Summary: Multi-Mission Multi-Messenger Observation Planning Toolkit
5
+ Author-email: M4OPT Developers <leo.singer@ligo.org>
6
+ License-Expression: BSD-3-Clause
7
+ Project-URL: Homepage, https://m4opt.readthedocs.io/
8
+ Project-URL: Bug Tracker, https://github.com/m4opt/m4opt/issues
9
+ Project-URL: Change Log, https://m4opt.readthedocs.io/en/latest/changes.html
10
+ Project-URL: Documentation, https://m4opt.readthedocs.io/
11
+ Project-URL: GitHub, https://github.com/m4opt/m4opt
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: Operating System :: MacOS
16
+ Classifier: Operating System :: POSIX :: Linux
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Topic :: Scientific/Engineering :: Astronomy
19
+ Classifier: Typing :: Typed
20
+ Requires-Python: >=3.11
21
+ Description-Content-Type: text/x-rst
22
+ Requires-Dist: aep8
23
+ Requires-Dist: antiprism-python
24
+ Requires-Dist: astropy>=7.1.0
25
+ Requires-Dist: astropy-healpix
26
+ Requires-Dist: astroquery
27
+ Requires-Dist: click>=8.2.0
28
+ Requires-Dist: cplex
29
+ Requires-Dist: docplex
30
+ Requires-Dist: dust-extinction
31
+ Requires-Dist: dustmaps
32
+ Requires-Dist: ligo.skymap>=2.4.0
33
+ Requires-Dist: networkx
34
+ Requires-Dist: numpy>=2.1.0
35
+ Requires-Dist: regions
36
+ Requires-Dist: pymetis
37
+ Requires-Dist: satellitetle
38
+ Requires-Dist: scipy
39
+ Requires-Dist: sgp4
40
+ Requires-Dist: spiceypy
41
+ Requires-Dist: sympy
42
+ Requires-Dist: synphot
43
+ Requires-Dist: typer>=0.16.0
44
+ Requires-Dist: typing_extensions; python_version < "3.12"
45
+ Requires-Dist: xdg-base-dirs
46
+ Provides-Extra: test
47
+ Requires-Dist: astroplan; extra == "test"
48
+ Requires-Dist: networkx; extra == "test"
49
+ Requires-Dist: sphinxcontrib-bibtex; extra == "test"
50
+ Requires-Dist: pytest-astropy; extra == "test"
51
+ Provides-Extra: docs
52
+ Requires-Dist: pysiaf; extra == "docs"
53
+ Requires-Dist: sphinx-astropy[confv2]; extra == "docs"
54
+ Requires-Dist: sphinxcontrib-bibtex; extra == "docs"
55
+ Requires-Dist: sphinxcontrib-typer; extra == "docs"
56
+
57
+ Multi-Mission Multi-Messenger Observation Planning Toolkit
58
+ ----------------------------------------------------------
59
+
60
+ .. image:: https://img.shields.io/pypi/v/m4opt
61
+ :target: https://pypi.org/project/m4opt/
62
+ :alt: Python Package Index status
63
+ .. image:: http://img.shields.io/badge/powered%20by-AstroPy-orange.svg?style=flat
64
+ :target: http://www.astropy.org
65
+ :alt: Powered by Astropy Badge
66
+ .. image:: https://codecov.io/gh/m4opt/m4opt/branch/main/graph/badge.svg?token=L837JHNTUV
67
+ :target: https://codecov.io/gh/m4opt/m4opt
68
+ :alt: Code coverage status
69
+ .. image:: https://readthedocs.org/projects/m4opt/badge/?version=latest
70
+ :target: https://m4opt.readthedocs.io/en/latest/?badge=latest
71
+ :alt: Documentation Status
72
+
73
+ .. image:: https://m4opt.readthedocs.io/en/latest/_images/example.gif
74
+ :alt: Visualization of an example observing plan for UVEX generated M4OPT
75
+
76
+ M4OPT is an open-source toolkit for multi-facility scheduling of astrophysics
77
+ observing campaigns. It focuses on extremely rapid follow-up of gravitational
78
+ wave (GW) and neutrino events with heterogeneous networks of space and
79
+ ground-based observatories.
80
+
81
+ M4OPT uses the versatile mathematical framework of `mixed integer
82
+ programming`__ to model and solve complex observation scheduling problems.
83
+ Although M4OPT is open source, for the largest problems it can leverage two
84
+ industrial-strength commercial MIP solvers: `CPLEX`__ or `Gurobi`__. Both
85
+ solvers are available for free for academic users.
86
+
87
+ __ https://en.wikipedia.org/wiki/Integer_programming
88
+ __ https://www.ibm.com/products/ilog-cplex-optimization-studio
89
+ __ https://www.gurobi.com
90
+
91
+ M4OPT is designed from the `Astropy affiliated package`__ template, and is
92
+ meant to follow those standards, including interoperability with the
93
+ `Astropy`__ ecosystem. It also complies with `NASA Procedural Requirements
94
+ (NPR) 7150`__ for `Class C software`__ and is suitable for non-safety-critical
95
+ ground software applications for `Class D NASA payloads`__.
96
+
97
+ __ https://www.astropy.org/affiliated/
98
+ __ https://www.astropy.org
99
+ __ https://nodis3.gsfc.nasa.gov/displayDir.cfm?t=NPR&c=7150&s=2C
100
+ __ https://nodis3.gsfc.nasa.gov/displayDir.cfm?Internal_ID=N_PR_7150_002C_&page_name=AppendixD
101
+ __ https://nodis3.gsfc.nasa.gov/displayDir.cfm?t=NPR&c=8705&s=4A
102
+
103
+ Features
104
+ --------
105
+
106
+ * **Global**: jointly and globally solves the problems of tiling (the set of
107
+ telescope boresight orientations and roll angles) and the scheduling (which
108
+ tile is observed at what time), rather than solving each sub-problem one at
109
+ a time
110
+ * **Optimal**: generally solves all the way to optimality, rather than
111
+ finding merely a "good enough" solution
112
+ * **Fast**: solve an entire orbit in about 5 minutes
113
+ * **General**: does not depend on heuristics of any kind
114
+ * **Flexible**: problem is formulated in the versatile framework of
115
+ `mixed integer programming <https://en.wikipedia.org/wiki/Integer_programming>`_
116
+
117
+ License
118
+ -------
119
+
120
+ This project is Copyright (c) M4OPT Developers and licensed under
121
+ the terms of the BSD 3-Clause license. This package is based upon
122
+ the `Astropy package template <https://github.com/astropy/package-template>`_
123
+ which is licensed under the BSD 3-clause license. See the licenses folder for
124
+ more information.
125
+
126
+ How to Cite
127
+ -----------
128
+
129
+ If you use M4OPT in your research, then please cite the following paper:
130
+
131
+ Singer, L. P., Criswell, A. W., Leggio, S. C., et al. (2025). Optimal Follow-Up of Gravitational-Wave Events with the UltraViolet EXplorer (UVEX) (Version 1). https://doi.org/10.48550/ARXIV.2502.17560
132
+
133
+ Contributing
134
+ ------------
135
+
136
+ We love contributions! m4opt is open source,
137
+ built on open source, and we'd love to have you hang out in our community.
138
+
139
+ **Imposter syndrome disclaimer**: We want your help. No, really.
140
+
141
+ There may be a little voice inside your head that is telling you that you're not
142
+ ready to be an open source contributor; that your skills aren't nearly good
143
+ enough to contribute. What could you possibly offer a project like this one?
144
+
145
+ We assure you - the little voice in your head is wrong. If you can write code at
146
+ all, you can contribute code to open source. Contributing to open source
147
+ projects is a fantastic way to advance one's coding skills. Writing perfect code
148
+ isn't the measure of a good developer (that would disqualify all of us!); it's
149
+ trying to create something, making mistakes, and learning from those
150
+ mistakes. That's how we all improve, and we are happy to help others learn.
151
+
152
+ Being an open source contributor doesn't just mean writing code, either. You can
153
+ help out by writing documentation, tests, or even giving feedback about the
154
+ project (and yes - that includes giving feedback about the contribution
155
+ process). Some of these contributions may be the most valuable to the project as
156
+ a whole, because you're coming to the project with fresh eyes, so you can see
157
+ the errors and assumptions that seasoned contributors have glossed over.
158
+
159
+ Note: This disclaimer was originally written by
160
+ `Adrienne Lowe <https://github.com/adriennefriend>`_ for a
161
+ `PyCon talk <https://www.youtube.com/watch?v=6Uj746j9Heo>`_, and was adapted by
162
+ m4opt based on its use in the README file for the
163
+ `MetPy project <https://github.com/Unidata/MetPy>`_.