microlens-submit 0.12.1__py3-none-any.whl → 0.12.2__py3-none-any.whl

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.
@@ -156,7 +156,7 @@ Note:
156
156
  Tailwind CSS styling and syntax-highlighted markdown notes.
157
157
  """
158
158
 
159
- __version__ = "0.12.1"
159
+ __version__ = "0.12.2"
160
160
 
161
161
  from .api import Event, Solution, Submission, load
162
162
 
microlens_submit/api.py CHANGED
@@ -85,7 +85,8 @@ class Solution(BaseModel):
85
85
  relative_probability: Optional probability of this solution being the best model.
86
86
  n_data_points: Number of data points used in the fit.
87
87
  creation_timestamp: UTC timestamp when the solution was created.
88
-
88
+
89
+
89
90
  Example:
90
91
  >>> from microlens_submit import load
91
92
  >>>
@@ -111,19 +112,23 @@ class Solution(BaseModel):
111
112
  >>> solution.set_compute_info(cpu_hours=2.5, wall_time_hours=0.5)
112
113
  >>>
113
114
  >>> # Add notes
114
- >>> solution.set_notes("# My Solution Notes\n\nThis is a simple point lens fit.")
115
+ >>> solution.set_notes('''
116
+ ... # My Solution Notes
117
+ ...
118
+ ... This is a simple point lens fit.
119
+ ... ''')
115
120
  >>>
116
121
  >>> # Validate the solution
117
- >>> messages = solution.validate()
122
+ >>> messages = solution.run_validation()
118
123
  >>> if messages:
119
124
  ... print("Validation issues:", messages)
120
-
125
+
121
126
  Note:
122
127
  The notes_path field supports Markdown formatting, allowing you to create rich,
123
128
  structured documentation with headers, lists, code blocks, tables, and links.
124
129
  This is particularly useful for creating detailed submission dossiers for evaluators.
125
130
 
126
- The validate() method performs comprehensive validation of parameters,
131
+ The run_validation() method performs comprehensive validation of parameters,
127
132
  higher-order effects, and physical consistency. Always validate solutions
128
133
  before submission.
129
134
  """
@@ -286,43 +291,21 @@ class Solution(BaseModel):
286
291
  """
287
292
  self.is_active = True
288
293
 
289
- def validate(self) -> list[str]:
294
+ def run_validation(self) -> list[str]:
290
295
  """Validate this solution's parameters and configuration.
291
296
 
292
297
  This method performs comprehensive validation using centralized validation logic
293
298
  to ensure the solution is complete, consistent, and ready for submission.
294
299
 
295
- **Validation Checks:**
296
-
297
- **Parameter Completeness:**
298
- - Ensures all required parameters are present for the given model type
299
- - Validates higher-order effect requirements (e.g., parallax needs piEN, piEE)
300
- - Checks band-specific flux parameters when bands are specified
301
- - Verifies t_ref is provided when required by time-dependent effects
302
-
303
- **Parameter Types and Values:**
304
- - Validates parameter data types (float, int, string)
305
- - Checks physically meaningful parameter ranges
306
- - Ensures positive values for quantities that must be positive (tE, s, etc.)
307
- - Validates mass ratio (q) is between 0 and 1
308
-
309
- **Physical Consistency:**
310
- - Checks for physically impossible parameter combinations
311
- - Validates binary lens separation ranges for caustic crossing
312
- - Ensures relative_probability is between 0 and 1 when specified
313
-
314
- **Model-Specific Validation:**
315
- - 1S1L: Requires t0, u0, tE
316
- - 1S2L: Requires t0, u0, tE, s, q, alpha
317
- - 2S1L: Requires t0, u0, tE (core lens parameters)
318
- - Higher-order effects: Validates effect-specific parameters
300
+ The validation includes:
319
301
 
320
- **Higher-Order Effects Supported:**
321
- - parallax: Requires piEN, piEE, t_ref
322
- - finite-source: Requires rho
323
- - lens-orbital-motion: Requires dsdt, dadt, t_ref
324
- - gaussian-process: Optional ln_K, ln_lambda, ln_period, ln_gamma
325
- - fitted-limb-darkening: Optional u1, u2, u3, u4
302
+ * Parameter completeness for the given model type
303
+ * Higher-order effect requirements (e.g., parallax needs piEN, piEE)
304
+ * Band-specific flux parameters when bands are specified
305
+ * Reference time requirements for time-dependent effects
306
+ * Parameter data types and physically meaningful ranges
307
+ * Physical consistency checks
308
+ * Model-specific parameter requirements
326
309
 
327
310
  Args:
328
311
  None
@@ -334,7 +317,7 @@ class Solution(BaseModel):
334
317
 
335
318
  Example:
336
319
  >>> solution = event.add_solution("1S2L", {"t0": 2459123.5, "u0": 0.1})
337
- >>> messages = solution.validate()
320
+ >>> messages = solution.run_validation()
338
321
  >>> if messages:
339
322
  ... print("Validation issues found:")
340
323
  ... for msg in messages:
@@ -782,7 +765,7 @@ class Submission(BaseModel):
782
765
  >>> solution2 = event2.add_solution("1S2L", {"t0": 2459156.2, "u0": 0.08, "tE": 35.7, "s": 0.95, "q": 0.0005, "alpha": 78.3})
783
766
  >>>
784
767
  >>> # Validate the submission
785
- >>> warnings = submission.validate()
768
+ >>> warnings = submission.run_validation()
786
769
  >>> if warnings:
787
770
  ... print("Validation warnings:")
788
771
  ... for warning in warnings:
@@ -809,7 +792,7 @@ class Submission(BaseModel):
809
792
  events: Dict[str, Event] = Field(default_factory=dict)
810
793
  repo_url: Optional[str] = None
811
794
 
812
- def validate(self) -> list[str]:
795
+ def run_validation(self) -> list[str]:
813
796
  """Check the submission for missing or incomplete information.
814
797
 
815
798
  The method performs lightweight validation and returns a list of
@@ -824,7 +807,7 @@ class Submission(BaseModel):
824
807
  >>> submission = load("./my_project")
825
808
  >>>
826
809
  >>> # Validate the submission
827
- >>> warnings = submission.validate()
810
+ >>> warnings = submission.run_validation()
828
811
  >>> if warnings:
829
812
  ... print("Validation warnings:")
830
813
  ... for warning in warnings:
@@ -875,7 +858,7 @@ class Submission(BaseModel):
875
858
 
876
859
  for sol in active:
877
860
  # Use the new centralized validation
878
- solution_messages = sol.validate()
861
+ solution_messages = sol.run_validation()
879
862
  for msg in solution_messages:
880
863
  warnings.append(f"Solution {sol.solution_id} in event {event.event_id}: {msg}")
881
864
 
@@ -1060,7 +1043,7 @@ class Submission(BaseModel):
1060
1043
  >>> submission = load("./my_project")
1061
1044
  >>>
1062
1045
  >>> # Validate before export
1063
- >>> warnings = submission.validate()
1046
+ >>> warnings = submission.run_validation()
1064
1047
  >>> if warnings:
1065
1048
  ... print("Fix validation issues before export:", warnings)
1066
1049
  ... else:
microlens_submit/cli.py CHANGED
@@ -556,7 +556,7 @@ def add_solution(
556
556
  console.print(json.dumps(parsed, indent=2))
557
557
  console.print(Panel("Schema Output", style="cyan"))
558
558
  console.print(sol.model_dump_json(indent=2))
559
- validation_messages = sol.validate()
559
+ validation_messages = sol.run_validation()
560
560
  if validation_messages:
561
561
  console.print(Panel("Validation Warnings", style="yellow"))
562
562
  for msg in validation_messages:
@@ -576,7 +576,7 @@ def add_solution(
576
576
  canonical_notes_path.parent.mkdir(parents=True, exist_ok=True)
577
577
  canonical_notes_path.write_text("", encoding="utf-8")
578
578
  sub.save()
579
- validation_messages = sol.validate()
579
+ validation_messages = sol.run_validation()
580
580
  if validation_messages:
581
581
  console.print(Panel("Validation Warnings", style="yellow"))
582
582
  for msg in validation_messages:
@@ -715,7 +715,7 @@ def export(
715
715
  that don't have them set, using BIC if sufficient data is available.
716
716
  """
717
717
  sub = load(str(project_path))
718
- warnings = sub.validate()
718
+ warnings = sub.run_validation()
719
719
  if warnings:
720
720
  console.print(Panel("Validation Warnings", style="yellow"))
721
721
  for w in warnings:
@@ -1072,7 +1072,7 @@ def validate_solution(
1072
1072
  raise typer.Exit(code=1)
1073
1073
 
1074
1074
  # Run validation
1075
- messages = target_solution.validate()
1075
+ messages = target_solution.run_validation()
1076
1076
 
1077
1077
  if not messages:
1078
1078
  console.print(
@@ -1143,7 +1143,7 @@ def validate_submission(
1143
1143
  all required information is present and valid.
1144
1144
  """
1145
1145
  sub = load(str(project_path))
1146
- warnings = sub.validate()
1146
+ warnings = sub.run_validation()
1147
1147
 
1148
1148
  # Check for missing repo_url
1149
1149
  repo_url_warning = next((w for w in warnings if 'repo_url' in w.lower() or 'github' in w.lower()), None)
@@ -1213,7 +1213,7 @@ def validate_event(
1213
1213
  console.print(Panel(f"Validating Event: {event_id}", style="cyan"))
1214
1214
 
1215
1215
  for solution in event.solutions.values():
1216
- messages = solution.validate()
1216
+ messages = solution.run_validation()
1217
1217
  if messages:
1218
1218
  console.print(f"\n[bold]Solution {solution.solution_id}:[/bold]")
1219
1219
  for msg in messages:
@@ -414,7 +414,7 @@ def _generate_dashboard_content(submission: Submission, full_dossier_exists: boo
414
414
 
415
415
  <!-- Footer -->
416
416
  <div class="text-sm text-gray-500 text-center pt-8 pb-6">
417
- Generated by microlens-submit v0.12.1 on {datetime.now().strftime('%Y-%m-%d %H:%M:%S UTC')}
417
+ Generated by microlens-submit v0.12.2 on {datetime.now().strftime('%Y-%m-%d %H:%M:%S UTC')}
418
418
  </div>
419
419
 
420
420
  <!-- Regex Finish -->
@@ -760,7 +760,7 @@ def _generate_event_page_content(event: Event, submission: Submission) -> str:
760
760
 
761
761
  <!-- Footer -->
762
762
  <div class='text-sm text-gray-500 text-center pt-8 border-t border-gray-200 mt-10'>
763
- Generated by microlens-submit v0.12.1 on {datetime.now().strftime('%Y-%m-%d %H:%M:%S UTC')}
763
+ Generated by microlens-submit v0.12.2 on {datetime.now().strftime('%Y-%m-%d %H:%M:%S UTC')}
764
764
  </div>
765
765
 
766
766
  <!-- Regex Finish -->
@@ -1129,7 +1129,7 @@ def _generate_solution_page_content(solution: Solution, event: Event, submission
1129
1129
 
1130
1130
  <!-- Footer -->
1131
1131
  <div class='text-sm text-gray-500 text-center pt-8 border-t border-gray-200 mt-10'>
1132
- Generated by microlens-submit v0.12.1 on {datetime.now().strftime('%Y-%m-%d %H:%M:%S UTC')}
1132
+ Generated by microlens-submit v0.12.2 on {datetime.now().strftime('%Y-%m-%d %H:%M:%S UTC')}
1133
1133
  </div>
1134
1134
 
1135
1135
  <!-- Regex Finish -->
@@ -1,24 +1,32 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: microlens-submit
3
- Version: 0.12.1
4
- Summary: A stateful submission toolkit for the Microlensing Data Challenge.
5
- Author-email: Amber Malpas <malpas.1@osu.edu>
3
+ Version: 0.12.2
4
+ Summary: A toolkit for managing microlensing data challenge submissions
5
+ Author-email: Amber Malpas <malpas.1@osu.edu>, Roman Science Platform Team <roman-science-platform@stsci.edu>
6
6
  License: MIT
7
7
  Project-URL: Homepage, https://github.com/AmberLee2427/microlens-submit
8
8
  Project-URL: Repository, https://github.com/AmberLee2427/microlens-submit
9
- Classifier: Programming Language :: Python :: 3
10
- Classifier: Operating System :: OS Independent
11
- Classifier: Development Status :: 3 - Alpha
9
+ Keywords: astronomy,microlensing,data-challenge,submission,roman
10
+ Classifier: Development Status :: 4 - Beta
12
11
  Classifier: Intended Audience :: Science/Research
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.8
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
13
20
  Classifier: Topic :: Scientific/Engineering :: Astronomy
21
+ Classifier: Topic :: Scientific/Engineering :: Physics
14
22
  Requires-Python: >=3.8
15
23
  Description-Content-Type: text/markdown
16
24
  License-File: LICENSE
25
+ Requires-Dist: pydantic>=2.0.0
17
26
  Requires-Dist: typer[all]>=0.9.0
18
- Requires-Dist: pydantic>=2.0
19
- Requires-Dist: rich>=13.0
20
- Requires-Dist: PyYAML>=6.0
21
- Requires-Dist: markdown>=3.0
27
+ Requires-Dist: rich>=13.0.0
28
+ Requires-Dist: pyyaml>=6.0
29
+ Requires-Dist: markdown>=3.4.0
22
30
  Provides-Extra: dev
23
31
  Requires-Dist: pytest; extra == "dev"
24
32
  Requires-Dist: pytest-cov; extra == "dev"
@@ -41,7 +49,7 @@ Dynamic: license-file
41
49
 
42
50
  *A stateful submission toolkit for the RGES-PIT Microlensing Data Challenge.*
43
51
 
44
- [![PyPI - v0.12.1](https://img.shields.io/pypi/v/microlens-submit.svg)](https://pypi.org/project/microlens-submit/)
52
+ [![PyPI - v0.12.2](https://img.shields.io/pypi/v/microlens-submit.svg)](https://pypi.org/project/microlens-submit/)
45
53
  [![CI](https://github.com/AmberLee2427/microlens-submit/actions/workflows/ci.yml/badge.svg)](https://github.com/AmberLee2427/microlens-submit/actions/workflows/ci.yml)
46
54
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
47
55
 
@@ -67,13 +75,7 @@ Full documentation is hosted on [Read the Docs](https://microlens-submit.readthe
67
75
 
68
76
  ## Installation
69
77
 
70
- This package is pre-release. It is currently available on TestPyPI:
71
-
72
- ```bash
73
- pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple microlens-submit==0.12.0-dev
74
- ```
75
-
76
- The package will be available on PyPI:
78
+ The package is be available on PyPI:
77
79
 
78
80
  ```bash
79
81
  pip install microlens-submit
@@ -0,0 +1,13 @@
1
+ microlens_submit/__init__.py,sha256=hqh7949_hPebaPxdSPsmEvA1KWU_VqhCRv7oVupPsAM,5869
2
+ microlens_submit/api.py,sha256=dSBC0sHQPbR_VKnlcN0-_OHEzhTunMqGnj96cHY5xBg,52902
3
+ microlens_submit/cli.py,sha256=peRC3otnrUOKPIYdLXpvao5zSVSEQOKBP-rqcR7FQlc,78754
4
+ microlens_submit/dossier.py,sha256=iIaNdeVmyLuUHgxMhYIIlGqzhQWZOwichYRNCQSMiNY,65415
5
+ microlens_submit/validate_parameters.py,sha256=GNma6rIl_VompJ7eyGJnT3nQ0v_PFJW1pZVBqVj5UTA,30767
6
+ microlens_submit/assets/github-desktop_logo.png,sha256=pb4rallKrYQPHt6eC0TmJe_UyyMtf1IrP8_OWK19nH8,479821
7
+ microlens_submit/assets/rges-pit_logo.png,sha256=45AJypXCymvt3lMeK7MHt1SBhwPpnKCMj6S000Cejtc,537645
8
+ microlens_submit-0.12.2.dist-info/licenses/LICENSE,sha256=cy1qkVR-kGxD6FXVsparmU2vHJXYeoyAAHv6SgT67sw,1069
9
+ microlens_submit-0.12.2.dist-info/METADATA,sha256=wHNZbe5g5SuAD3O6B40rfFyhY9yChuTJ8YhyLVaGZvg,7466
10
+ microlens_submit-0.12.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
11
+ microlens_submit-0.12.2.dist-info/entry_points.txt,sha256=kA85yhxYrpQnUvVZCRS2giz52gaf1ZOfZFjY4RHIZ2s,62
12
+ microlens_submit-0.12.2.dist-info/top_level.txt,sha256=uJ9_bADYRySlhEpP-8vTm90ZLV2SrKEzutAaRx8WF0k,17
13
+ microlens_submit-0.12.2.dist-info/RECORD,,
@@ -1,13 +0,0 @@
1
- microlens_submit/__init__.py,sha256=hBD9NA-AbajbMaVGS8_5xNvvWsLGBON0bXIK3kDK-jA,5869
2
- microlens_submit/api.py,sha256=p_EqHPBA7kkOMa1GzPj1_fTy4J63uyzkI41l1O3_IlA,53885
3
- microlens_submit/cli.py,sha256=SpO3d8v2_SswFNZFDkNQ4K0Oj-EXkDYmR5309123D6o,78718
4
- microlens_submit/dossier.py,sha256=tvWSh0JaSrPK5O7c_xULDkKNxCxBnUfaUgm9dFMUsrA,65415
5
- microlens_submit/validate_parameters.py,sha256=GNma6rIl_VompJ7eyGJnT3nQ0v_PFJW1pZVBqVj5UTA,30767
6
- microlens_submit/assets/github-desktop_logo.png,sha256=pb4rallKrYQPHt6eC0TmJe_UyyMtf1IrP8_OWK19nH8,479821
7
- microlens_submit/assets/rges-pit_logo.png,sha256=45AJypXCymvt3lMeK7MHt1SBhwPpnKCMj6S000Cejtc,537645
8
- microlens_submit-0.12.1.dist-info/licenses/LICENSE,sha256=cy1qkVR-kGxD6FXVsparmU2vHJXYeoyAAHv6SgT67sw,1069
9
- microlens_submit-0.12.1.dist-info/METADATA,sha256=qoO8paDd7MhdTpuJNbPI09i8Ij20RUlee27me7if5Uc,7177
10
- microlens_submit-0.12.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
11
- microlens_submit-0.12.1.dist-info/entry_points.txt,sha256=kA85yhxYrpQnUvVZCRS2giz52gaf1ZOfZFjY4RHIZ2s,62
12
- microlens_submit-0.12.1.dist-info/top_level.txt,sha256=uJ9_bADYRySlhEpP-8vTm90ZLV2SrKEzutAaRx8WF0k,17
13
- microlens_submit-0.12.1.dist-info/RECORD,,