microlens-submit 0.16.1__tar.gz → 0.16.3__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.
- microlens_submit-0.16.3/CHANGELOG.md +258 -0
- microlens_submit-0.16.3/CITATION.cff +9 -0
- {microlens_submit-0.16.1 → microlens_submit-0.16.3}/MANIFEST.in +4 -0
- {microlens_submit-0.16.1/microlens_submit.egg-info → microlens_submit-0.16.3}/PKG-INFO +22 -1
- {microlens_submit-0.16.1 → microlens_submit-0.16.3}/README.md +20 -0
- {microlens_submit-0.16.1 → microlens_submit-0.16.3}/microlens_submit/__init__.py +1 -1
- {microlens_submit-0.16.1 → microlens_submit-0.16.3}/microlens_submit/cli/commands/export.py +9 -6
- {microlens_submit-0.16.1 → microlens_submit-0.16.3}/microlens_submit/cli/commands/init.py +13 -8
- {microlens_submit-0.16.1 → microlens_submit-0.16.3}/microlens_submit/cli/commands/solutions.py +26 -21
- {microlens_submit-0.16.1 → microlens_submit-0.16.3}/microlens_submit/cli/commands/validation.py +11 -7
- {microlens_submit-0.16.1 → microlens_submit-0.16.3}/microlens_submit/error_messages.py +6 -4
- {microlens_submit-0.16.1 → microlens_submit-0.16.3}/microlens_submit/models/event.py +10 -7
- {microlens_submit-0.16.1 → microlens_submit-0.16.3}/microlens_submit/models/submission.py +23 -22
- microlens_submit-0.16.3/microlens_submit/text_symbols.py +96 -0
- {microlens_submit-0.16.1 → microlens_submit-0.16.3/microlens_submit.egg-info}/PKG-INFO +22 -1
- {microlens_submit-0.16.1 → microlens_submit-0.16.3}/microlens_submit.egg-info/SOURCES.txt +3 -0
- {microlens_submit-0.16.1 → microlens_submit-0.16.3}/microlens_submit.egg-info/requires.txt +1 -0
- {microlens_submit-0.16.1 → microlens_submit-0.16.3}/pyproject.toml +2 -1
- {microlens_submit-0.16.1 → microlens_submit-0.16.3}/setup.py +1 -1
- {microlens_submit-0.16.1 → microlens_submit-0.16.3}/tests/test_cli.py +7 -4
- {microlens_submit-0.16.1 → microlens_submit-0.16.3}/LICENSE +0 -0
- {microlens_submit-0.16.1 → microlens_submit-0.16.3}/microlens_submit/assets/github-desktop_logo.png +0 -0
- {microlens_submit-0.16.1 → microlens_submit-0.16.3}/microlens_submit/assets/rges-pit_logo.png +0 -0
- {microlens_submit-0.16.1 → microlens_submit-0.16.3}/microlens_submit/cli/__init__.py +0 -0
- {microlens_submit-0.16.1 → microlens_submit-0.16.3}/microlens_submit/cli/__main__.py +0 -0
- {microlens_submit-0.16.1 → microlens_submit-0.16.3}/microlens_submit/cli/commands/__init__.py +0 -0
- {microlens_submit-0.16.1 → microlens_submit-0.16.3}/microlens_submit/cli/commands/dossier.py +0 -0
- {microlens_submit-0.16.1 → microlens_submit-0.16.3}/microlens_submit/cli/main.py +0 -0
- {microlens_submit-0.16.1 → microlens_submit-0.16.3}/microlens_submit/dossier/__init__.py +0 -0
- {microlens_submit-0.16.1 → microlens_submit-0.16.3}/microlens_submit/dossier/dashboard.py +0 -0
- {microlens_submit-0.16.1 → microlens_submit-0.16.3}/microlens_submit/dossier/event_page.py +0 -0
- {microlens_submit-0.16.1 → microlens_submit-0.16.3}/microlens_submit/dossier/full_report.py +0 -0
- {microlens_submit-0.16.1 → microlens_submit-0.16.3}/microlens_submit/dossier/solution_page.py +0 -0
- {microlens_submit-0.16.1 → microlens_submit-0.16.3}/microlens_submit/dossier/utils.py +0 -0
- {microlens_submit-0.16.1 → microlens_submit-0.16.3}/microlens_submit/models/__init__.py +0 -0
- {microlens_submit-0.16.1 → microlens_submit-0.16.3}/microlens_submit/models/solution.py +0 -0
- {microlens_submit-0.16.1 → microlens_submit-0.16.3}/microlens_submit/tier_validation.py +0 -0
- {microlens_submit-0.16.1 → microlens_submit-0.16.3}/microlens_submit/utils.py +0 -0
- {microlens_submit-0.16.1 → microlens_submit-0.16.3}/microlens_submit/validate_parameters.py +0 -0
- {microlens_submit-0.16.1 → microlens_submit-0.16.3}/microlens_submit.egg-info/dependency_links.txt +0 -0
- {microlens_submit-0.16.1 → microlens_submit-0.16.3}/microlens_submit.egg-info/entry_points.txt +0 -0
- {microlens_submit-0.16.1 → microlens_submit-0.16.3}/microlens_submit.egg-info/top_level.txt +0 -0
- {microlens_submit-0.16.1 → microlens_submit-0.16.3}/setup.cfg +0 -0
- {microlens_submit-0.16.1 → microlens_submit-0.16.3}/tests/test_api.py +0 -0
- {microlens_submit-0.16.1 → microlens_submit-0.16.3}/tests/test_dossier_generation.py +0 -0
- {microlens_submit-0.16.1 → microlens_submit-0.16.3}/tests/test_dossier_pages.py +0 -0
- {microlens_submit-0.16.1 → microlens_submit-0.16.3}/tests/test_tier_validation.py +0 -0
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.16.3] - 2025-10-28
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Publish to `conda-forge`.
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
- Include `pyproject.toml` and other metadata in the sdist so `pip install .` works (fixes conda builds).
|
|
15
|
+
|
|
16
|
+
## [0.16.2] - 2025-10-28
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
- conda build to release action
|
|
20
|
+
- local `.env` support
|
|
21
|
+
- Zenodo doi automation
|
|
22
|
+
- build wheel and conda build install smoke tests on Mac, Linux, and Windows, python 3.8 and 3.11
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## [0.16.1] - 2025-10-27
|
|
26
|
+
|
|
27
|
+
### Added
|
|
28
|
+
- Release automation
|
|
29
|
+
- CI now installs from the wheel across 3.8/3.12 to mirror beta testers’ reports
|
|
30
|
+
|
|
31
|
+
### Changed
|
|
32
|
+
- `README.md` to clarify Quickstart
|
|
33
|
+
|
|
34
|
+
### Fixed
|
|
35
|
+
- `importlib_resources` version bug
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## [0.16.0] - 2024-12-19
|
|
39
|
+
|
|
40
|
+
### Added
|
|
41
|
+
- **Tier Validation System**: Comprehensive tier-based validation for challenge submissions
|
|
42
|
+
- New `tier_validation.py` module with support for "standard", "advanced", "test", "2018-test", and "None" tiers
|
|
43
|
+
- Event ID validation against tier-specific event lists
|
|
44
|
+
- CLI tier validation with fallback to "None" for invalid tiers
|
|
45
|
+
- Comprehensive tier validation tests in `tests/test_tier_validation.py`
|
|
46
|
+
- **Enhanced Validation Logic**: Improved parameter validation and solution completeness checking
|
|
47
|
+
- Enhanced `validate_parameters.py` with better error messages and validation rules
|
|
48
|
+
- Improved validation for higher-order effects and parameter consistency
|
|
49
|
+
- Better handling of parameter uncertainties and type validation
|
|
50
|
+
- Enhanced solution completeness checking with more detailed feedback
|
|
51
|
+
- **Dossier Generation Enhancements**: Improved HTML dossier generation and browser integration
|
|
52
|
+
- Added model_type display at the top of each solution section in full dossier reports
|
|
53
|
+
- Added `--open` flag to `microlens-submit generate-dossier` CLI command for automatic browser opening
|
|
54
|
+
- Added `open: bool = False` parameter to `generate_dashboard_html()` API function
|
|
55
|
+
- Enhanced dossier navigation and metadata display
|
|
56
|
+
- **Submission Manual Integration**: Converted SUBMISSION_MANUAL.md to reStructuredText format and integrated into Sphinx documentation
|
|
57
|
+
- Moved submission manual to `docs/submission_manual.rst` for better documentation integration
|
|
58
|
+
- Updated all internal links and references to point to the new documentation location
|
|
59
|
+
- Added GitHub link to validate_submission.py script in the submission manual
|
|
60
|
+
- Removed old markdown file and logo references for cleaner documentation structure
|
|
61
|
+
|
|
62
|
+
### Changed
|
|
63
|
+
- **Validation System Architecture**: Improved validation workflow and error handling
|
|
64
|
+
- Enhanced CLI validation commands with better error reporting
|
|
65
|
+
- Improved validation integration across all CLI commands
|
|
66
|
+
- Better handling of validation warnings vs errors
|
|
67
|
+
- Enhanced parameter validation with more detailed feedback
|
|
68
|
+
- **Code Quality & Pre-commit Integration**: Comprehensive code cleanup and formatting improvements
|
|
69
|
+
- Fixed all pre-commit hook violations including line length, unused imports, and style issues
|
|
70
|
+
- Resolved f-string formatting issues in CLI commands
|
|
71
|
+
- Fixed line length violations in dossier generation code
|
|
72
|
+
- Removed unused imports across the codebase
|
|
73
|
+
- Ensured all tests pass in both Python 3.8 and 3.11 environments
|
|
74
|
+
- **Documentation Structure**: Improved documentation organization and accessibility
|
|
75
|
+
- Integrated submission manual into main documentation site
|
|
76
|
+
- Updated internal documentation links and references
|
|
77
|
+
- Enhanced documentation consistency and maintainability
|
|
78
|
+
- Updated API documentation and tutorial examples
|
|
79
|
+
|
|
80
|
+
### Fixed
|
|
81
|
+
- **Code Quality**: Resolved all pre-commit hook violations
|
|
82
|
+
- Fixed f-string formatting issues in CLI commands
|
|
83
|
+
- Resolved line length violations in dossier generation code
|
|
84
|
+
- Removed unused imports across the codebase
|
|
85
|
+
- Improved code consistency and maintainability
|
|
86
|
+
- **Validation Logic**: Enhanced parameter validation and error handling
|
|
87
|
+
- Improved validation for higher-order effects
|
|
88
|
+
- Better handling of parameter uncertainties
|
|
89
|
+
- Enhanced solution completeness checking
|
|
90
|
+
- More detailed validation feedback and error messages
|
|
91
|
+
|
|
92
|
+
## [0.15.0] - 2024-12-19
|
|
93
|
+
|
|
94
|
+
### Added
|
|
95
|
+
- New tier validation system with support for "standard", "advanced", "test", "2018-test", and "None" tiers
|
|
96
|
+
- Event ID validation against tier-specific event lists
|
|
97
|
+
- CLI tier validation with fallback to "None" for invalid tiers
|
|
98
|
+
- Comprehensive tier validation tests
|
|
99
|
+
|
|
100
|
+
### Changed
|
|
101
|
+
- Renamed "basic" tier to "standard" for better naming
|
|
102
|
+
- Updated tier hierarchy: standard < advanced (removed "expert" tier)
|
|
103
|
+
- Simplified to two challenge tiers: "standard" and "advanced"
|
|
104
|
+
|
|
105
|
+
## [0.14.0] - 2024-12-19
|
|
106
|
+
|
|
107
|
+
### Added
|
|
108
|
+
- **Modular Architecture**: Complete refactoring of the codebase for improved maintainability
|
|
109
|
+
- Split monolithic `dossier.py` into modular `dossier/` package with specialized modules
|
|
110
|
+
- Refactored CLI into `cli/` package with commands organized into separate modules
|
|
111
|
+
- Created `dossier/generator.py` for HTML generation logic
|
|
112
|
+
- Created `dossier/templates.py` for template management
|
|
113
|
+
- Created `dossier/utils.py` for dossier-specific utilities
|
|
114
|
+
- Created `cli/commands/` directory with specialized command modules
|
|
115
|
+
- Created `cli/utils.py` for CLI-specific utilities
|
|
116
|
+
- **Enhanced Error Messaging**: Comprehensive error handling improvements
|
|
117
|
+
- Added actionable suggestions for common typos and parameter errors
|
|
118
|
+
- Integrated validation warnings with helpful guidance
|
|
119
|
+
- Enhanced CLI error messages with specific recommendations
|
|
120
|
+
- Added parameter validation with user-friendly error descriptions
|
|
121
|
+
- **Improved CLI Help**: Enhanced command-line interface usability
|
|
122
|
+
- Added [BASIC] and [ADVANCED] tags to help users understand option complexity
|
|
123
|
+
- Improved option descriptions with practical usage examples
|
|
124
|
+
- Enhanced help text for complex parameters like `--limb-darkening-model`
|
|
125
|
+
- Added usage examples in command docstrings for better user guidance
|
|
126
|
+
|
|
127
|
+
### Changed
|
|
128
|
+
- **Code Organization**: Improved project structure and maintainability
|
|
129
|
+
- Separated concerns between dossier generation, CLI commands, and utilities
|
|
130
|
+
- Enhanced code readability and debugging capabilities
|
|
131
|
+
- Maintained backward compatibility with existing API and CLI interfaces
|
|
132
|
+
- Preserved all existing functionality while improving internal organization
|
|
133
|
+
- **Documentation**: Updated internal documentation to reflect new modular structure
|
|
134
|
+
- Enhanced docstrings with usage examples and parameter descriptions
|
|
135
|
+
- Improved code comments for better developer experience
|
|
136
|
+
- Maintained user-facing documentation consistency
|
|
137
|
+
|
|
138
|
+
### Fixed
|
|
139
|
+
- **Maintainability**: Resolved technical debt through modularization
|
|
140
|
+
- Eliminated monolithic files that were difficult to maintain
|
|
141
|
+
- Improved test organization and coverage
|
|
142
|
+
- Enhanced code reusability and separation of concerns
|
|
143
|
+
- **User Experience**: Better error handling and guidance
|
|
144
|
+
- More helpful error messages with actionable suggestions
|
|
145
|
+
- Clearer CLI help text with practical examples
|
|
146
|
+
- Improved parameter validation with user-friendly feedback
|
|
147
|
+
|
|
148
|
+
## [0.13.0] - 2024-12-19
|
|
149
|
+
|
|
150
|
+
### Added
|
|
151
|
+
- **Bulk CSV Import**: New CLI command `import-solutions` and API function `import_solutions_from_csv()` for importing multiple solutions from a CSV file in one step
|
|
152
|
+
- Supports column mapping via YAML parameter map files
|
|
153
|
+
- Handles solution aliases with uniqueness validation within events
|
|
154
|
+
- Supports duplicate handling (error/override/ignore), notes, dry-run, and validation options
|
|
155
|
+
- Properly converts literal `\n` characters to actual newlines in notes from CSV files
|
|
156
|
+
- See the tutorial and README for usage examples
|
|
157
|
+
- **Solution Aliases**: Human-readable identifiers for solutions with automatic uniqueness validation
|
|
158
|
+
- Aliases are displayed prominently in dossier generation and CLI output
|
|
159
|
+
- Integrated into all CLI commands that reference solutions
|
|
160
|
+
- Supports alias-based solution identification and management
|
|
161
|
+
- **Enhanced Notes Handling**: Improved handling of notes with literal escape sequences
|
|
162
|
+
- CSV import automatically converts literal `\n` and `\r` to actual newlines
|
|
163
|
+
- Added `convert_escapes` parameter to `set_notes()` method for controlled conversion
|
|
164
|
+
- Maintains backward compatibility with existing notes functionality
|
|
165
|
+
- **Test Data**: Added `tests/data/test_import.csv` as a comprehensive test file for CSV import functionality
|
|
166
|
+
- Used in both CLI and API tests as a real-world example and template for users
|
|
167
|
+
- Includes various parameter types, aliases, notes, and edge cases for testing
|
|
168
|
+
|
|
169
|
+
### Changed
|
|
170
|
+
- **Code Quality**: Improved formatting and readability throughout the codebase
|
|
171
|
+
- Added proper spacing and logical grouping in dense functions
|
|
172
|
+
- Enhanced code maintainability and debugging capabilities
|
|
173
|
+
- **Documentation**: Updated tutorial, README, and API documentation to cover CSV import and alias features
|
|
174
|
+
- **CLI Enhancements**: Added alias support to all solution-related CLI commands
|
|
175
|
+
|
|
176
|
+
### Fixed
|
|
177
|
+
- **Notes Rendering**: Fixed issue where literal `\n` characters in notes were rendered as text instead of line breaks in HTML
|
|
178
|
+
- CSV import now properly converts escape sequences to actual newlines
|
|
179
|
+
- Maintains compatibility with existing notes that don't need conversion
|
|
180
|
+
|
|
181
|
+
## [0.12.2] - 2024-12-19
|
|
182
|
+
|
|
183
|
+
### Fixed
|
|
184
|
+
- **Critical Bug Fix**: Renamed `Solution.validate()` method to `Solution.run_validation()` to resolve Pydantic conflict
|
|
185
|
+
- Pydantic was interpreting the `validate` method as a field validator, causing import errors
|
|
186
|
+
- This was breaking Sphinx documentation generation and module imports
|
|
187
|
+
- All references updated across API, CLI, tests, and documentation
|
|
188
|
+
- Method functionality remains identical, only the name changed
|
|
189
|
+
|
|
190
|
+
### Changed
|
|
191
|
+
- Updated all documentation and examples to use `run_validation()` instead of `validate()`
|
|
192
|
+
- Updated CLI commands and help text for consistency
|
|
193
|
+
- Updated test suite to use the new method name
|
|
194
|
+
|
|
195
|
+
## [0.12.1] - 2024-12-19
|
|
196
|
+
|
|
197
|
+
### Added
|
|
198
|
+
- **New CLI Command**: `set-hardware-info` for managing compute platform information
|
|
199
|
+
- Supports setting CPU, memory, platform, and Nexus image details
|
|
200
|
+
- Includes `--clear`, `--dry-run`, and update options
|
|
201
|
+
- Integrates with dossier generation for hardware documentation
|
|
202
|
+
- **Enhanced Documentation**: Comprehensive improvements to Sphinx documentation
|
|
203
|
+
- Expanded API reference with detailed examples and best practices
|
|
204
|
+
- Enhanced tutorial with step-by-step workflow and troubleshooting
|
|
205
|
+
- Improved index page with key features and quick start guide
|
|
206
|
+
- Added custom CSS styling for RGES-PIT color scheme
|
|
207
|
+
- **Example Parameter Files**: Created comprehensive example parameter files
|
|
208
|
+
- `tests/example_params.yaml` and `tests/example_params.json`
|
|
209
|
+
- Demonstrates different parameter formats, uncertainties, and model types
|
|
210
|
+
- Useful for testing and tutorial purposes
|
|
211
|
+
|
|
212
|
+
### Changed
|
|
213
|
+
- **Version Update**: Bumped version from v0.12.0-dev to v0.12.1
|
|
214
|
+
- **Documentation**: Updated all version references across codebase
|
|
215
|
+
- **Tutorial**: Updated CLI commands in `Submission_Tool_Tutorial.ipynb` to match current syntax
|
|
216
|
+
- **GitHub Logo**: Ensured GitHub logo is properly packaged and included in dossier generation
|
|
217
|
+
|
|
218
|
+
### Fixed
|
|
219
|
+
- **CI Test Failures**: Fixed test assertions for CLI comparison and validation commands
|
|
220
|
+
- Updated table header counting logic for solution comparison output
|
|
221
|
+
- Added missing repo_url setting in validation tests
|
|
222
|
+
- **Documentation Build**: Improved Sphinx configuration for better autodoc and theme options
|
|
223
|
+
|
|
224
|
+
## [0.12.0] - 2024-12-18
|
|
225
|
+
|
|
226
|
+
### Added
|
|
227
|
+
- **Comprehensive Documentation**: Complete Sphinx documentation with API reference, tutorial, and examples
|
|
228
|
+
- **Enhanced Dossier Generation**: Improved HTML dashboard with better styling and navigation
|
|
229
|
+
- **Parameter File Support**: Added support for JSON and YAML parameter files in CLI
|
|
230
|
+
- **Validation System**: Centralized parameter validation with comprehensive error checking
|
|
231
|
+
- **Hardware Information**: Automatic detection and manual setting of compute platform details
|
|
232
|
+
- **Notes Management**: Enhanced markdown notes support with file-based editing
|
|
233
|
+
- **Solution Comparison**: BIC-based solution ranking and relative probability calculation
|
|
234
|
+
- **Export Improvements**: Better handling of external files and automatic path updates
|
|
235
|
+
|
|
236
|
+
### Changed
|
|
237
|
+
- **API Improvements**: Enhanced Solution and Submission classes with better validation
|
|
238
|
+
- **CLI Enhancements**: More robust command-line interface with better error handling
|
|
239
|
+
- **Project Structure**: Improved organization with better separation of concerns
|
|
240
|
+
|
|
241
|
+
### Fixed
|
|
242
|
+
- **Bug Fixes**: Various fixes for data persistence, validation, and export functionality
|
|
243
|
+
- **Documentation**: Comprehensive docstring updates with Google style formatting
|
|
244
|
+
|
|
245
|
+
## [0.11.0] - 2024-12-17
|
|
246
|
+
|
|
247
|
+
### Added
|
|
248
|
+
- **Initial Release**: Basic submission management functionality
|
|
249
|
+
- **Core API**: Solution, Event, and Submission classes
|
|
250
|
+
- **CLI Interface**: Basic command-line tools for project management
|
|
251
|
+
- **Export Functionality**: ZIP archive creation for submissions
|
|
252
|
+
|
|
253
|
+
### Changed
|
|
254
|
+
- **Project Structure**: Organized code into logical modules
|
|
255
|
+
- **Documentation**: Basic README and docstrings
|
|
256
|
+
|
|
257
|
+
### Fixed
|
|
258
|
+
- **Initial Implementation**: Core functionality for microlensing submission management
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
cff-version: 1.2.0
|
|
2
|
+
message: "If you use microlens-submit, please cite it as below."
|
|
3
|
+
title: "microlens-submit"
|
|
4
|
+
version: "0.16.3"
|
|
5
|
+
authors:
|
|
6
|
+
- family-names: Malpas
|
|
7
|
+
given-names: Amber
|
|
8
|
+
url: "https://github.com/AmberLee2427/microlens-submit"
|
|
9
|
+
doi: "10.5281/zenodo.17468488"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: microlens-submit
|
|
3
|
-
Version: 0.16.
|
|
3
|
+
Version: 0.16.3
|
|
4
4
|
Summary: A tool for managing and submitting microlensing solutions
|
|
5
5
|
Home-page: https://github.com/AmberLee2427/microlens-submit
|
|
6
6
|
Author: Amber Malpas
|
|
@@ -41,6 +41,7 @@ Requires-Dist: isort; extra == "dev"
|
|
|
41
41
|
Requires-Dist: sphinx; extra == "dev"
|
|
42
42
|
Requires-Dist: sphinx_rtd_theme; extra == "dev"
|
|
43
43
|
Requires-Dist: importlib_resources; extra == "dev"
|
|
44
|
+
Requires-Dist: python-dotenv; extra == "dev"
|
|
44
45
|
Dynamic: author
|
|
45
46
|
Dynamic: home-page
|
|
46
47
|
Dynamic: license-file
|
|
@@ -197,3 +198,23 @@ A comprehensive test CSV file is provided at `tests/data/test_import.csv`. This
|
|
|
197
198
|
If you use **microlens-submit** in your research, please cite the project using
|
|
198
199
|
the metadata provided in the `CITATION.cff` file. Most reference managers can
|
|
199
200
|
import this file directly.
|
|
201
|
+
|
|
202
|
+
Bibtex:
|
|
203
|
+
```
|
|
204
|
+
@software{malpas_2025_17468488,
|
|
205
|
+
author = {Malpas, Amber},
|
|
206
|
+
title = {microlens-submit},
|
|
207
|
+
month = oct,
|
|
208
|
+
year = 2025,
|
|
209
|
+
publisher = {Zenodo},
|
|
210
|
+
version = {v0.16.3},
|
|
211
|
+
doi = {10.5281/zenodo.17468488},
|
|
212
|
+
url = {https://doi.org/10.5281/zenodo.17468488},
|
|
213
|
+
}
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
Cite without version:
|
|
217
|
+
Malpas, A. (2025). microlens-submit. Zenodo. https://doi.org/10.5281/zenodo.17459752
|
|
218
|
+
|
|
219
|
+
Cite current version:
|
|
220
|
+
Malpas, A. (2025). microlens-submit (v0.16.3). Zenodo. https://doi.org/10.5281/zenodo.17468488
|
|
@@ -149,3 +149,23 @@ A comprehensive test CSV file is provided at `tests/data/test_import.csv`. This
|
|
|
149
149
|
If you use **microlens-submit** in your research, please cite the project using
|
|
150
150
|
the metadata provided in the `CITATION.cff` file. Most reference managers can
|
|
151
151
|
import this file directly.
|
|
152
|
+
|
|
153
|
+
Bibtex:
|
|
154
|
+
```
|
|
155
|
+
@software{malpas_2025_17468488,
|
|
156
|
+
author = {Malpas, Amber},
|
|
157
|
+
title = {microlens-submit},
|
|
158
|
+
month = oct,
|
|
159
|
+
year = 2025,
|
|
160
|
+
publisher = {Zenodo},
|
|
161
|
+
version = {v0.16.3},
|
|
162
|
+
doi = {10.5281/zenodo.17468488},
|
|
163
|
+
url = {https://doi.org/10.5281/zenodo.17468488},
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Cite without version:
|
|
168
|
+
Malpas, A. (2025). microlens-submit. Zenodo. https://doi.org/10.5281/zenodo.17459752
|
|
169
|
+
|
|
170
|
+
Cite current version:
|
|
171
|
+
Malpas, A. (2025). microlens-submit (v0.16.3). Zenodo. https://doi.org/10.5281/zenodo.17468488
|
|
@@ -7,6 +7,7 @@ import typer
|
|
|
7
7
|
from rich.console import Console
|
|
8
8
|
from rich.panel import Panel
|
|
9
9
|
|
|
10
|
+
from microlens_submit.text_symbols import symbol
|
|
10
11
|
from microlens_submit.utils import load
|
|
11
12
|
|
|
12
13
|
console = Console()
|
|
@@ -48,30 +49,32 @@ def remove_event(
|
|
|
48
49
|
submission = load(str(project_path))
|
|
49
50
|
|
|
50
51
|
if event_id not in submission.events:
|
|
51
|
-
typer.echo(f"
|
|
52
|
+
typer.echo(f"{symbol('error')} Event '{event_id}' not found in submission")
|
|
52
53
|
raise typer.Exit(1)
|
|
53
54
|
|
|
54
55
|
event = submission.events[event_id]
|
|
55
56
|
solution_count = len(event.solutions)
|
|
56
57
|
|
|
57
58
|
if not force:
|
|
58
|
-
typer.echo(
|
|
59
|
+
typer.echo(
|
|
60
|
+
f"{symbol('warning')} This will permanently remove event '{event_id}' and all {solution_count} solutions."
|
|
61
|
+
)
|
|
59
62
|
typer.echo(" This action cannot be undone.")
|
|
60
63
|
confirm = typer.confirm("Are you sure you want to continue?")
|
|
61
64
|
if not confirm:
|
|
62
|
-
typer.echo("
|
|
65
|
+
typer.echo(f"{symbol('error')} Operation cancelled")
|
|
63
66
|
raise typer.Exit(0)
|
|
64
67
|
|
|
65
68
|
try:
|
|
66
69
|
removed = submission.remove_event(event_id, force=force)
|
|
67
70
|
if removed:
|
|
68
|
-
typer.echo(f"
|
|
71
|
+
typer.echo(f"{symbol('check')} Removed event '{event_id}' and all {solution_count} solutions")
|
|
69
72
|
submission.save()
|
|
70
73
|
else:
|
|
71
|
-
typer.echo(f"
|
|
74
|
+
typer.echo(f"{symbol('error')} Failed to remove event '{event_id}'")
|
|
72
75
|
raise typer.Exit(1)
|
|
73
76
|
except ValueError as e:
|
|
74
|
-
typer.echo(f"
|
|
77
|
+
typer.echo(f"{symbol('error')} Cannot remove event: {e}")
|
|
75
78
|
raise typer.Exit(1)
|
|
76
79
|
|
|
77
80
|
|
|
@@ -7,6 +7,7 @@ import typer
|
|
|
7
7
|
from rich.console import Console
|
|
8
8
|
from rich.panel import Panel
|
|
9
9
|
|
|
10
|
+
from microlens_submit.text_symbols import symbol
|
|
10
11
|
from microlens_submit.utils import load
|
|
11
12
|
|
|
12
13
|
console = Console()
|
|
@@ -101,19 +102,21 @@ def init(
|
|
|
101
102
|
# Run warnings-only validation
|
|
102
103
|
warnings = sub.run_validation_warnings()
|
|
103
104
|
if warnings:
|
|
104
|
-
console.print("[yellow]
|
|
105
|
+
console.print(f"[yellow]{symbol('warning')} Project initialized with warnings:[/yellow]")
|
|
105
106
|
for warning in warnings:
|
|
106
107
|
console.print(f" [yellow]• {warning}[/yellow]")
|
|
107
|
-
console.print("[yellow]
|
|
108
|
+
console.print(f"[yellow]{symbol('hint')} These warnings will become errors when saving or exporting.[/yellow]")
|
|
108
109
|
|
|
109
110
|
# Try to save, but don't fail if there are validation errors
|
|
110
111
|
try:
|
|
111
112
|
sub.save()
|
|
112
113
|
console.print(Panel(f"Initialized project at {project_path}", style="bold green"))
|
|
113
114
|
except ValueError as e:
|
|
114
|
-
console.print(
|
|
115
|
+
console.print(
|
|
116
|
+
f"[yellow]{symbol('warning')} Project initialized but could not save due to validation errors:[/yellow]"
|
|
117
|
+
)
|
|
115
118
|
console.print(f"[yellow]{str(e)}[/yellow]")
|
|
116
|
-
console.print("[yellow]
|
|
119
|
+
console.print(f"[yellow]{symbol('hint')} Fix validation errors before saving or exporting.[/yellow]")
|
|
117
120
|
console.print(Panel(f"Initialized project at {project_path} (unsaved)", style="bold yellow"))
|
|
118
121
|
|
|
119
122
|
|
|
@@ -156,17 +159,19 @@ def nexus_init(
|
|
|
156
159
|
# Run warnings-only validation after adding hardware info
|
|
157
160
|
warnings = sub.run_validation_warnings()
|
|
158
161
|
if warnings:
|
|
159
|
-
console.print("[yellow]
|
|
162
|
+
console.print(f"[yellow]{symbol('warning')} Project updated with warnings:[/yellow]")
|
|
160
163
|
for warning in warnings:
|
|
161
164
|
console.print(f" [yellow]• {warning}[/yellow]")
|
|
162
|
-
console.print("[yellow]
|
|
165
|
+
console.print(f"[yellow]{symbol('hint')} These warnings will become errors when saving or exporting.[/yellow]")
|
|
163
166
|
|
|
164
167
|
# Try to save, but don't fail if there are validation errors
|
|
165
168
|
try:
|
|
166
169
|
sub.save()
|
|
167
170
|
console.print("Nexus platform info captured.", style="bold green")
|
|
168
171
|
except ValueError as e:
|
|
169
|
-
console.print(
|
|
172
|
+
console.print(
|
|
173
|
+
f"[yellow]{symbol('warning')} Project updated but could not save due to validation errors:[/yellow]"
|
|
174
|
+
)
|
|
170
175
|
console.print(f"[yellow]{str(e)}[/yellow]")
|
|
171
|
-
console.print("[yellow]
|
|
176
|
+
console.print(f"[yellow]{symbol('hint')} Fix validation errors before saving or exporting.[/yellow]")
|
|
172
177
|
console.print("Nexus platform info captured (unsaved).", style="bold yellow")
|
{microlens_submit-0.16.1 → microlens_submit-0.16.3}/microlens_submit/cli/commands/solutions.py
RENAMED
|
@@ -10,6 +10,7 @@ from rich.console import Console
|
|
|
10
10
|
from rich.panel import Panel
|
|
11
11
|
|
|
12
12
|
from microlens_submit.error_messages import enhance_validation_messages, format_cli_error_with_suggestions
|
|
13
|
+
from microlens_submit.text_symbols import symbol
|
|
13
14
|
from microlens_submit.utils import import_solutions_from_csv, load
|
|
14
15
|
|
|
15
16
|
console = Console()
|
|
@@ -319,7 +320,7 @@ def add_solution(
|
|
|
319
320
|
console.print(f" • {msg}")
|
|
320
321
|
else:
|
|
321
322
|
console.print(
|
|
322
|
-
f"
|
|
323
|
+
f"{symbol('check')} Solution {sol.solution_id} created successfully!",
|
|
323
324
|
style="green",
|
|
324
325
|
)
|
|
325
326
|
|
|
@@ -362,7 +363,7 @@ def activate(
|
|
|
362
363
|
|
|
363
364
|
solution.activate()
|
|
364
365
|
submission.save()
|
|
365
|
-
console.print(f"[green]
|
|
366
|
+
console.print(f"[green]{symbol('check')} Activated solution {solution_id[:8]}... in event {event_id}[/green]")
|
|
366
367
|
|
|
367
368
|
|
|
368
369
|
def remove_solution(
|
|
@@ -390,14 +391,17 @@ def remove_solution(
|
|
|
390
391
|
removed = submission.events[event_id].remove_solution(solution_id, force=force)
|
|
391
392
|
if removed:
|
|
392
393
|
submission.save()
|
|
393
|
-
console.print(
|
|
394
|
+
console.print(
|
|
395
|
+
f"[green]{symbol('check')} Solution {solution_id[:8]}... removed from event {event_id}[/green]"
|
|
396
|
+
)
|
|
394
397
|
else:
|
|
395
398
|
console.print(f"[red]Error: Failed to remove solution {solution_id}[/red]")
|
|
396
399
|
raise typer.Exit(1)
|
|
397
400
|
except ValueError as e:
|
|
398
401
|
console.print(f"[red]Error: {e}[/red]")
|
|
399
402
|
console.print(
|
|
400
|
-
"[yellow]
|
|
403
|
+
f"[yellow]{symbol('hint')} Use --force to override safety checks, "
|
|
404
|
+
"or use deactivate to keep the solution[/yellow]"
|
|
401
405
|
)
|
|
402
406
|
raise typer.Exit(1)
|
|
403
407
|
|
|
@@ -482,10 +486,11 @@ def edit_solution(
|
|
|
482
486
|
if target_solution is None:
|
|
483
487
|
console.print(f"Solution {solution_id} not found", style="bold red")
|
|
484
488
|
raise typer.Exit(code=1)
|
|
489
|
+
arrow = symbol("arrow")
|
|
485
490
|
changes = []
|
|
486
491
|
if alias is not None:
|
|
487
492
|
if target_solution.alias != alias:
|
|
488
|
-
changes.append(f"Update alias: {target_solution.alias}
|
|
493
|
+
changes.append(f"Update alias: {target_solution.alias} {arrow} {alias}")
|
|
489
494
|
target_solution.alias = alias
|
|
490
495
|
if clear_relative_probability:
|
|
491
496
|
if target_solution.relative_probability is not None:
|
|
@@ -494,7 +499,7 @@ def edit_solution(
|
|
|
494
499
|
elif relative_probability is not None:
|
|
495
500
|
if target_solution.relative_probability != relative_probability:
|
|
496
501
|
changes.append(
|
|
497
|
-
f"Update relative_probability:
|
|
502
|
+
f"Update relative_probability: {target_solution.relative_probability} {arrow} {relative_probability}"
|
|
498
503
|
)
|
|
499
504
|
target_solution.relative_probability = relative_probability
|
|
500
505
|
if clear_log_likelihood:
|
|
@@ -503,7 +508,7 @@ def edit_solution(
|
|
|
503
508
|
target_solution.log_likelihood = None
|
|
504
509
|
elif log_likelihood is not None:
|
|
505
510
|
if target_solution.log_likelihood != log_likelihood:
|
|
506
|
-
changes.append(f"Update log_likelihood: {target_solution.log_likelihood}
|
|
511
|
+
changes.append(f"Update log_likelihood: {target_solution.log_likelihood} {arrow} {log_likelihood}")
|
|
507
512
|
target_solution.log_likelihood = log_likelihood
|
|
508
513
|
if clear_n_data_points:
|
|
509
514
|
if target_solution.n_data_points is not None:
|
|
@@ -511,7 +516,7 @@ def edit_solution(
|
|
|
511
516
|
target_solution.n_data_points = None
|
|
512
517
|
elif n_data_points is not None:
|
|
513
518
|
if target_solution.n_data_points != n_data_points:
|
|
514
|
-
changes.append(f"Update n_data_points: {target_solution.n_data_points}
|
|
519
|
+
changes.append(f"Update n_data_points: {target_solution.n_data_points} {arrow} {n_data_points}")
|
|
515
520
|
target_solution.n_data_points = n_data_points
|
|
516
521
|
# Notes file logic
|
|
517
522
|
canonical_notes_path = (
|
|
@@ -550,9 +555,9 @@ def edit_solution(
|
|
|
550
555
|
old_cpu = target_solution.compute_info.get("cpu_hours")
|
|
551
556
|
old_wall = target_solution.compute_info.get("wall_time_hours")
|
|
552
557
|
if cpu_hours is not None and old_cpu != cpu_hours:
|
|
553
|
-
changes.append(f"Update cpu_hours: {old_cpu}
|
|
558
|
+
changes.append(f"Update cpu_hours: {old_cpu} {arrow} {cpu_hours}")
|
|
554
559
|
if wall_time_hours is not None and old_wall != wall_time_hours:
|
|
555
|
-
changes.append(f"Update wall_time_hours: {old_wall}
|
|
560
|
+
changes.append(f"Update wall_time_hours: {old_wall} {arrow} {wall_time_hours}")
|
|
556
561
|
target_solution.set_compute_info(
|
|
557
562
|
cpu_hours=cpu_hours if cpu_hours is not None else old_cpu,
|
|
558
563
|
wall_time_hours=(wall_time_hours if wall_time_hours is not None else old_wall),
|
|
@@ -568,7 +573,7 @@ def edit_solution(
|
|
|
568
573
|
new_value = value
|
|
569
574
|
old_value = target_solution.parameters.get(key)
|
|
570
575
|
if old_value != new_value:
|
|
571
|
-
changes.append(f"Update parameter {key}: {old_value}
|
|
576
|
+
changes.append(f"Update parameter {key}: {old_value} {arrow} {new_value}")
|
|
572
577
|
target_solution.parameters[key] = new_value
|
|
573
578
|
if param_uncertainty:
|
|
574
579
|
if target_solution.parameter_uncertainties is None:
|
|
@@ -583,7 +588,7 @@ def edit_solution(
|
|
|
583
588
|
new_value = value
|
|
584
589
|
old_value = target_solution.parameter_uncertainties.get(key)
|
|
585
590
|
if old_value != new_value:
|
|
586
|
-
changes.append(f"Update uncertainty {key}: {old_value}
|
|
591
|
+
changes.append(f"Update uncertainty {key}: {old_value} {arrow} {new_value}")
|
|
587
592
|
target_solution.parameter_uncertainties[key] = new_value
|
|
588
593
|
if clear_higher_order_effects:
|
|
589
594
|
if target_solution.higher_order_effects:
|
|
@@ -592,7 +597,7 @@ def edit_solution(
|
|
|
592
597
|
elif higher_order_effect:
|
|
593
598
|
if target_solution.higher_order_effects != higher_order_effect:
|
|
594
599
|
changes.append(
|
|
595
|
-
f"Update higher_order_effects:
|
|
600
|
+
f"Update higher_order_effects: {target_solution.higher_order_effects} {arrow} {higher_order_effect}"
|
|
596
601
|
)
|
|
597
602
|
target_solution.higher_order_effects = higher_order_effect
|
|
598
603
|
if dry_run:
|
|
@@ -670,14 +675,14 @@ def import_solutions(
|
|
|
670
675
|
) -> None:
|
|
671
676
|
"""Import solutions from a CSV file into the current project."""
|
|
672
677
|
if on_duplicate not in ["error", "override", "ignore"]:
|
|
673
|
-
typer.echo(f"
|
|
678
|
+
typer.echo(f"{symbol('error')} Invalid --on-duplicate option: {on_duplicate}")
|
|
674
679
|
typer.echo(" Valid options: error, override, ignore")
|
|
675
680
|
raise typer.Exit(1)
|
|
676
681
|
|
|
677
682
|
try:
|
|
678
683
|
submission = load(str(project_path))
|
|
679
684
|
except Exception as e: # pragma: no cover - unexpected I/O errors
|
|
680
|
-
typer.echo(f"
|
|
685
|
+
typer.echo(f"{symbol('error')} Failed to load submission: {e}")
|
|
681
686
|
raise typer.Exit(1)
|
|
682
687
|
|
|
683
688
|
try:
|
|
@@ -692,17 +697,17 @@ def import_solutions(
|
|
|
692
697
|
project_path=project_path,
|
|
693
698
|
)
|
|
694
699
|
except Exception as e: # pragma: no cover - unexpected parse errors
|
|
695
|
-
typer.echo(f"
|
|
700
|
+
typer.echo(f"{symbol('error')} Failed to import solutions: {e}")
|
|
696
701
|
raise typer.Exit(1)
|
|
697
702
|
|
|
698
703
|
if not dry_run and stats["successful_imports"] > 0:
|
|
699
704
|
try:
|
|
700
705
|
submission.save()
|
|
701
706
|
except Exception as e: # pragma: no cover - disk failures
|
|
702
|
-
typer.echo(f"
|
|
707
|
+
typer.echo(f"{symbol('error')} Failed to save submission: {e}")
|
|
703
708
|
raise typer.Exit(1)
|
|
704
709
|
|
|
705
|
-
typer.echo("\n
|
|
710
|
+
typer.echo(f"\n{symbol('progress')} Import Summary:")
|
|
706
711
|
typer.echo(f" Total rows processed: {stats['total_rows']}")
|
|
707
712
|
typer.echo(f" Successful imports: {stats['successful_imports']}")
|
|
708
713
|
typer.echo(f" Skipped rows: {stats['skipped_rows']}")
|
|
@@ -710,13 +715,13 @@ def import_solutions(
|
|
|
710
715
|
typer.echo(f" Duplicates handled: {stats['duplicate_handled']}")
|
|
711
716
|
|
|
712
717
|
if stats["errors"]:
|
|
713
|
-
typer.echo("\n
|
|
718
|
+
typer.echo(f"\n{symbol('warning')} Errors encountered:")
|
|
714
719
|
for error in stats["errors"][:10]:
|
|
715
720
|
typer.echo(f" {error}")
|
|
716
721
|
if len(stats["errors"]) > 10:
|
|
717
722
|
typer.echo(f" ... and {len(stats['errors']) - 10} more errors")
|
|
718
723
|
|
|
719
724
|
if dry_run:
|
|
720
|
-
typer.echo("\n
|
|
725
|
+
typer.echo(f"\n{symbol('search')} Dry run completed - no changes made")
|
|
721
726
|
else:
|
|
722
|
-
typer.echo("\n
|
|
727
|
+
typer.echo(f"\n{symbol('check')} Import completed successfully")
|
{microlens_submit-0.16.1 → microlens_submit-0.16.3}/microlens_submit/cli/commands/validation.py
RENAMED
|
@@ -10,6 +10,7 @@ from rich.panel import Panel
|
|
|
10
10
|
from rich.table import Table
|
|
11
11
|
|
|
12
12
|
from microlens_submit.error_messages import enhance_validation_messages
|
|
13
|
+
from microlens_submit.text_symbols import symbol
|
|
13
14
|
from microlens_submit.utils import load
|
|
14
15
|
|
|
15
16
|
console = Console()
|
|
@@ -42,7 +43,7 @@ def validate_solution(
|
|
|
42
43
|
if not enhanced_messages:
|
|
43
44
|
console.print(
|
|
44
45
|
Panel(
|
|
45
|
-
f"
|
|
46
|
+
f"{symbol('check')} All validations passed for {solution_id} (event {target_event_id})",
|
|
46
47
|
style="bold green",
|
|
47
48
|
)
|
|
48
49
|
)
|
|
@@ -65,7 +66,7 @@ def validate_submission(
|
|
|
65
66
|
warnings = sub.run_validation_warnings()
|
|
66
67
|
|
|
67
68
|
if not warnings:
|
|
68
|
-
console.print(Panel("
|
|
69
|
+
console.print(Panel(f"{symbol('check')} All validations passed!", style="bold green"))
|
|
69
70
|
else:
|
|
70
71
|
console.print(Panel("Validation Warnings", style="yellow"))
|
|
71
72
|
for warning in warnings:
|
|
@@ -78,21 +79,24 @@ def validate_submission(
|
|
|
78
79
|
|
|
79
80
|
if has_repo_issue:
|
|
80
81
|
console.print(
|
|
81
|
-
"\n[blue]
|
|
82
|
+
f"\n[blue]{symbol('hint')} To fix repository URL issues:[/blue]\n"
|
|
82
83
|
" microlens-submit set-repo-url <url> <project_dir>",
|
|
83
84
|
style="blue",
|
|
84
85
|
)
|
|
85
86
|
|
|
86
87
|
if has_hardware_issue:
|
|
87
88
|
console.print(
|
|
88
|
-
"\n[blue]
|
|
89
|
+
f"\n[blue]{symbol('hint')} To fix hardware info issues:[/blue]\n"
|
|
89
90
|
" microlens-submit nexus-init --team-name <name> --tier <tier> <project_dir>\n"
|
|
90
91
|
" (or manually set hardware_info in submission.json)",
|
|
91
92
|
style="blue",
|
|
92
93
|
)
|
|
93
94
|
|
|
94
95
|
console.print(
|
|
95
|
-
"\n[yellow]
|
|
96
|
+
"\n[yellow]"
|
|
97
|
+
f"{symbol('warning')} Note: These warnings will become errors when saving or exporting."
|
|
98
|
+
"[/yellow]",
|
|
99
|
+
style="yellow",
|
|
96
100
|
)
|
|
97
101
|
|
|
98
102
|
|
|
@@ -121,10 +125,10 @@ def validate_event(
|
|
|
121
125
|
console.print(f" • {msg}")
|
|
122
126
|
all_messages.append(f"{solution.solution_id}: {msg}")
|
|
123
127
|
else:
|
|
124
|
-
console.print(f"
|
|
128
|
+
console.print(f"{symbol('check')} Solution {solution.solution_id}: All validations passed")
|
|
125
129
|
|
|
126
130
|
if not all_messages:
|
|
127
|
-
console.print(Panel("
|
|
131
|
+
console.print(Panel(f"{symbol('check')} All solutions passed validation!", style="bold green"))
|
|
128
132
|
else:
|
|
129
133
|
console.print(
|
|
130
134
|
f"\nFound {len(all_messages)} validation issue(s) across all solutions",
|
|
@@ -8,6 +8,8 @@ to help users understand and fix issues more easily.
|
|
|
8
8
|
import re
|
|
9
9
|
from typing import Dict, List, Optional
|
|
10
10
|
|
|
11
|
+
from microlens_submit.text_symbols import symbol
|
|
12
|
+
|
|
11
13
|
|
|
12
14
|
def get_model_type_suggestions(invalid_type: str) -> List[str]:
|
|
13
15
|
"""Get suggestions for model type corrections."""
|
|
@@ -156,9 +158,9 @@ def format_validation_message(message: str, suggestions: Optional[List[str]] = N
|
|
|
156
158
|
|
|
157
159
|
formatted = message
|
|
158
160
|
if len(suggestions) == 1:
|
|
159
|
-
formatted += f"\n
|
|
161
|
+
formatted += f"\n{symbol('hint')} Suggestion: {suggestions[0]}"
|
|
160
162
|
else:
|
|
161
|
-
formatted += "\n
|
|
163
|
+
formatted += f"\n{symbol('hint')} Suggestions:"
|
|
162
164
|
for suggestion in suggestions:
|
|
163
165
|
formatted += f"\n • {suggestion}"
|
|
164
166
|
|
|
@@ -259,7 +261,7 @@ def format_cli_error_with_suggestions(error_message: str, context: Dict) -> str:
|
|
|
259
261
|
|
|
260
262
|
# Add context-specific suggestions
|
|
261
263
|
if "model_type must be one of" in error_message:
|
|
262
|
-
enhanced += "\n\n
|
|
264
|
+
enhanced += f"\n\n{symbol('hint')} Quick Start Examples:"
|
|
263
265
|
enhanced += (
|
|
264
266
|
"\n microlens-submit add-solution EVENT123 1S1L " "--param t0=2459123.5 --param u0=0.1 --param tE=20.0"
|
|
265
267
|
)
|
|
@@ -275,7 +277,7 @@ def format_cli_error_with_suggestions(error_message: str, context: Dict) -> str:
|
|
|
275
277
|
enhanced += "\n Multiple parameters: --param t0=2459123.5 " "--param u0=0.1 --param tE=20.0"
|
|
276
278
|
|
|
277
279
|
elif "Cannot use --param with --params-file" in error_message:
|
|
278
|
-
enhanced += "\n\n
|
|
280
|
+
enhanced += f"\n\n{symbol('hint')} Parameter Options:"
|
|
279
281
|
enhanced += "\n Use --param for individual parameters on command line"
|
|
280
282
|
enhanced += "\n Use --params-file for parameters from a JSON/YAML file"
|
|
281
283
|
enhanced += "\n Choose one method, not both"
|
|
@@ -11,6 +11,7 @@ from typing import TYPE_CHECKING, Dict, List, Optional
|
|
|
11
11
|
|
|
12
12
|
from pydantic import BaseModel, Field
|
|
13
13
|
|
|
14
|
+
from ..text_symbols import symbol
|
|
14
15
|
from .solution import Solution
|
|
15
16
|
|
|
16
17
|
if TYPE_CHECKING:
|
|
@@ -122,11 +123,11 @@ class Event(BaseModel):
|
|
|
122
123
|
|
|
123
124
|
# Provide feedback about the created solution
|
|
124
125
|
alias_info = f" with alias '{alias}'" if alias else ""
|
|
125
|
-
print(f"
|
|
126
|
+
print(f"{symbol('check')} Created solution {solution_id}{alias_info}")
|
|
126
127
|
print(f" Model: {model_type}, Parameters: {len(parameters)}")
|
|
127
128
|
if alias:
|
|
128
|
-
print(f"
|
|
129
|
-
print("
|
|
129
|
+
print(f" {symbol('warning')} Note: Alias '{alias}' will be validated for uniqueness when saved")
|
|
130
|
+
print(f" {symbol('save')} Remember to call submission.save() to persist to disk")
|
|
130
131
|
|
|
131
132
|
return sol
|
|
132
133
|
|
|
@@ -322,14 +323,14 @@ class Event(BaseModel):
|
|
|
322
323
|
try:
|
|
323
324
|
if full_path.exists():
|
|
324
325
|
full_path.unlink()
|
|
325
|
-
print(f"
|
|
326
|
+
print(f"{symbol('trash')} Removed temporary notes file: {notes_path}")
|
|
326
327
|
except OSError:
|
|
327
|
-
print(f"
|
|
328
|
+
print(f"{symbol('warning')} Warning: Could not remove temporary file {notes_path}")
|
|
328
329
|
|
|
329
330
|
# Remove from solutions dict
|
|
330
331
|
del self.solutions[solution_id]
|
|
331
332
|
|
|
332
|
-
print(f"
|
|
333
|
+
print(f"{symbol('trash')} Removed solution {solution_id[:8]}... from event {self.event_id}")
|
|
333
334
|
return True
|
|
334
335
|
|
|
335
336
|
def remove_all_solutions(self, force: bool = False) -> int:
|
|
@@ -366,7 +367,9 @@ class Event(BaseModel):
|
|
|
366
367
|
removed_count += 1
|
|
367
368
|
except ValueError:
|
|
368
369
|
if not force:
|
|
369
|
-
print(
|
|
370
|
+
print(
|
|
371
|
+
f"{symbol('warning')} Skipped saved solution {solution_id[:8]}... (use force=True to remove)"
|
|
372
|
+
)
|
|
370
373
|
else:
|
|
371
374
|
# Force=True should override the saved check
|
|
372
375
|
if self.remove_solution(solution_id, force=True):
|
|
@@ -15,6 +15,7 @@ from typing import Dict, List, Optional
|
|
|
15
15
|
|
|
16
16
|
from pydantic import BaseModel, Field
|
|
17
17
|
|
|
18
|
+
from ..text_symbols import symbol
|
|
18
19
|
from .event import Event
|
|
19
20
|
from .solution import Solution
|
|
20
21
|
|
|
@@ -348,22 +349,22 @@ class Submission(BaseModel):
|
|
|
348
349
|
|
|
349
350
|
def print_solution_status(self) -> None:
|
|
350
351
|
status = self.get_solution_status()
|
|
351
|
-
print("
|
|
352
|
+
print(f"{symbol('progress')} Solution Status Summary:")
|
|
352
353
|
print(f" Total solutions: {status['total']}")
|
|
353
354
|
print(f" Saved to disk: {status['saved']}")
|
|
354
355
|
print(f" Unsaved (in memory): {status['unsaved']}")
|
|
355
356
|
if status["unsaved"] > 0:
|
|
356
|
-
print("
|
|
357
|
+
print(f" {symbol('save')} Call submission.save() to persist unsaved solutions")
|
|
357
358
|
if status["duplicate_aliases"]:
|
|
358
|
-
print("
|
|
359
|
+
print(f" {symbol('error')} Alias conflicts found:")
|
|
359
360
|
for error in status["duplicate_aliases"]:
|
|
360
361
|
print(f" {error}")
|
|
361
|
-
print("
|
|
362
|
+
print(f" {symbol('hint')} Resolve conflicts before saving")
|
|
362
363
|
for event_id, event_status in status["events"].items():
|
|
363
|
-
print(f"\n
|
|
364
|
+
print(f"\n{symbol('folder')} Event {event_id}:")
|
|
364
365
|
print(f" Solutions: {event_status['saved']} saved, {event_status['unsaved']} unsaved")
|
|
365
366
|
for sol_id, sol_status in event_status["solutions"].items():
|
|
366
|
-
status_icon = "
|
|
367
|
+
status_icon = symbol("check") if sol_status["saved"] else symbol("pending")
|
|
367
368
|
alias_info = f" (alias: {sol_status['alias']})" if sol_status["alias"] else ""
|
|
368
369
|
active_info = "" if sol_status["is_active"] else " [inactive]"
|
|
369
370
|
print(f" {status_icon} {sol_id} - {sol_status['model_type']}{alias_info}{active_info}")
|
|
@@ -372,25 +373,25 @@ class Submission(BaseModel):
|
|
|
372
373
|
# Run comprehensive validation first
|
|
373
374
|
validation_errors = self.run_validation()
|
|
374
375
|
if validation_errors:
|
|
375
|
-
print("
|
|
376
|
+
print(f"{symbol('warning')} Save completed with validation warnings:")
|
|
376
377
|
for error in validation_errors:
|
|
377
378
|
print(f" {error}")
|
|
378
|
-
print("
|
|
379
|
+
print(f"{symbol('hint')} Fix validation errors before exporting for submission")
|
|
379
380
|
|
|
380
381
|
if not force:
|
|
381
|
-
print("
|
|
382
|
+
print(f"{symbol('save')} Submission saved locally (incomplete - not ready for submission)")
|
|
382
383
|
else:
|
|
383
|
-
print("
|
|
384
|
+
print(f"{symbol('save')} Submission saved locally (forced save with validation errors)")
|
|
384
385
|
else:
|
|
385
|
-
print("
|
|
386
|
+
print(f"{symbol('check')} Submission saved successfully (ready for export)")
|
|
386
387
|
|
|
387
388
|
# Check for alias conflicts (existing behavior)
|
|
388
389
|
alias_errors = self._validate_alias_uniqueness()
|
|
389
390
|
if alias_errors:
|
|
390
|
-
print("
|
|
391
|
+
print(f"{symbol('error')} Save failed due to alias validation errors:")
|
|
391
392
|
for error in alias_errors:
|
|
392
393
|
print(f" {error}")
|
|
393
|
-
print("
|
|
394
|
+
print(f"{symbol('hint')} Solutions with duplicate aliases remain in memory but are not saved")
|
|
394
395
|
print(" Use different aliases or remove aliases to resolve conflicts")
|
|
395
396
|
raise ValueError("Alias validation failed:\n" + "\n".join(alias_errors))
|
|
396
397
|
|
|
@@ -420,9 +421,9 @@ class Submission(BaseModel):
|
|
|
420
421
|
for sol in event.solutions.values():
|
|
421
422
|
sol.saved = True
|
|
422
423
|
if unsaved_count > 0:
|
|
423
|
-
print(f"
|
|
424
|
+
print(f"{symbol('check')} Successfully saved {unsaved_count} new solution(s) to disk")
|
|
424
425
|
else:
|
|
425
|
-
print("
|
|
426
|
+
print(f"{symbol('check')} Successfully saved submission to disk")
|
|
426
427
|
saved_aliases = [
|
|
427
428
|
f"{event_id} {sol.alias}"
|
|
428
429
|
for event_id, event in self.events.items()
|
|
@@ -430,17 +431,17 @@ class Submission(BaseModel):
|
|
|
430
431
|
if sol.alias and sol.saved
|
|
431
432
|
]
|
|
432
433
|
if saved_aliases:
|
|
433
|
-
print(f"
|
|
434
|
+
print(f"{symbol('clipboard')} Saved aliases: {', '.join(saved_aliases)}")
|
|
434
435
|
|
|
435
436
|
def export(self, output_path: str) -> None:
|
|
436
437
|
# Run comprehensive validation first - export is strict
|
|
437
438
|
validation_errors = self.run_validation()
|
|
438
439
|
if validation_errors:
|
|
439
|
-
print("
|
|
440
|
+
print(f"{symbol('error')} Export failed due to validation errors:")
|
|
440
441
|
for error in validation_errors:
|
|
441
442
|
print(f" {error}")
|
|
442
|
-
print("
|
|
443
|
-
print("
|
|
443
|
+
print(f"{symbol('hint')} Fix validation errors before exporting for submission")
|
|
444
|
+
print(f"{symbol('hint')} Use submission.save() to save incomplete work locally")
|
|
444
445
|
raise ValueError("Validation failed:\n" + "\n".join(validation_errors))
|
|
445
446
|
|
|
446
447
|
project = Path(self.project_path)
|
|
@@ -559,11 +560,11 @@ class Submission(BaseModel):
|
|
|
559
560
|
try:
|
|
560
561
|
if full_path.exists():
|
|
561
562
|
full_path.unlink()
|
|
562
|
-
print(f"
|
|
563
|
+
print(f"{symbol('trash')} Removed temporary notes file: {notes_path}")
|
|
563
564
|
except OSError as e:
|
|
564
|
-
print(f"
|
|
565
|
+
print(f"{symbol('warning')} Warning: Could not remove temporary file {notes_path}: {e}")
|
|
565
566
|
del self.events[event_id]
|
|
566
|
-
print(f"
|
|
567
|
+
print(f"{symbol('trash')} Removed event '{event_id}' with {len(event.solutions)} solutions")
|
|
567
568
|
return True
|
|
568
569
|
|
|
569
570
|
# ... (all methods from Submission class, unchanged, including docstrings)
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"""Console-friendly symbols with graceful fallbacks.
|
|
2
|
+
|
|
3
|
+
Some Windows terminals still use legacy code pages (e.g., CP1252) that cannot
|
|
4
|
+
encode emoji-style glyphs. Attempting to print those characters raises
|
|
5
|
+
``UnicodeEncodeError``. This module exposes a :func:`symbol` helper that
|
|
6
|
+
returns the Unicode glyph when the current output stream supports it and
|
|
7
|
+
otherwise falls back to a readable ASCII alternative.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
|
|
12
|
+
import locale
|
|
13
|
+
import os
|
|
14
|
+
import sys
|
|
15
|
+
from typing import Dict, Tuple
|
|
16
|
+
|
|
17
|
+
_SYMBOL_MAP: Dict[str, Tuple[str, str]] = {
|
|
18
|
+
"check": ("✅", "[OK]"),
|
|
19
|
+
"warning": ("⚠️", "[WARN]"),
|
|
20
|
+
"error": ("❌", "[ERROR]"),
|
|
21
|
+
"save": ("💾", "[SAVE]"),
|
|
22
|
+
"progress": ("📊", "[STATUS]"),
|
|
23
|
+
"folder": ("📁", "[EVENT]"),
|
|
24
|
+
"pending": ("⏳", "[PENDING]"),
|
|
25
|
+
"clipboard": ("📋", "[ALIASES]"),
|
|
26
|
+
"hint": ("💡", "[HINT]"),
|
|
27
|
+
"note": ("💡", "[NOTE]"),
|
|
28
|
+
"trash": ("🗑️", "[REMOVE]"),
|
|
29
|
+
"search": ("🔍", "[DRY RUN]"),
|
|
30
|
+
"arrow": ("→", "->"),
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def _can_encode(text: str) -> bool:
|
|
35
|
+
"""Return ``True`` if ``text`` can be encoded using the current stdout/stderr."""
|
|
36
|
+
|
|
37
|
+
def _stream_supports(stream) -> bool | None:
|
|
38
|
+
if stream is None:
|
|
39
|
+
return None
|
|
40
|
+
encoding = getattr(stream, "encoding", None)
|
|
41
|
+
if not encoding:
|
|
42
|
+
return None
|
|
43
|
+
try:
|
|
44
|
+
text.encode(encoding)
|
|
45
|
+
except UnicodeEncodeError:
|
|
46
|
+
return False
|
|
47
|
+
else:
|
|
48
|
+
return True
|
|
49
|
+
|
|
50
|
+
# Prefer the actively used stdout/stderr streams.
|
|
51
|
+
for attr in ("stdout", "stderr"):
|
|
52
|
+
result = _stream_supports(getattr(sys, attr, None))
|
|
53
|
+
if result is not None:
|
|
54
|
+
return result
|
|
55
|
+
|
|
56
|
+
# Fall back to the original streams if the active ones are unavailable.
|
|
57
|
+
for attr in ("__stdout__", "__stderr__"):
|
|
58
|
+
result = _stream_supports(getattr(sys, attr, None))
|
|
59
|
+
if result:
|
|
60
|
+
return True
|
|
61
|
+
return False
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def symbol(name: str) -> str:
|
|
65
|
+
"""Return a console-friendly symbol for ``name``.
|
|
66
|
+
|
|
67
|
+
Args:
|
|
68
|
+
name: Symbol identifier such as ``"check"`` or ``"warning"``.
|
|
69
|
+
|
|
70
|
+
Returns:
|
|
71
|
+
The preferred Unicode glyph when supported, otherwise a readable ASCII
|
|
72
|
+
fallback.
|
|
73
|
+
"""
|
|
74
|
+
unicode_char, fallback = _SYMBOL_MAP.get(name, ("", ""))
|
|
75
|
+
|
|
76
|
+
if not unicode_char:
|
|
77
|
+
return fallback
|
|
78
|
+
|
|
79
|
+
# On Windows runners the locale is frequently a legacy code page (e.g. cp1252)
|
|
80
|
+
# even when rich/click report UTF-8. Prefer ASCII fallbacks unless we can
|
|
81
|
+
# confidently detect a UTF-capable encoding.
|
|
82
|
+
if os.name == "nt":
|
|
83
|
+
candidate_encodings = [
|
|
84
|
+
os.environ.get("PYTHONIOENCODING"),
|
|
85
|
+
getattr(sys.stdout, "encoding", None),
|
|
86
|
+
getattr(sys.stderr, "encoding", None),
|
|
87
|
+
getattr(sys.__stdout__, "encoding", None),
|
|
88
|
+
getattr(sys.__stderr__, "encoding", None),
|
|
89
|
+
locale.getpreferredencoding(False),
|
|
90
|
+
]
|
|
91
|
+
if not any(enc and "utf" in enc.lower() for enc in candidate_encodings if enc):
|
|
92
|
+
return fallback or unicode_char
|
|
93
|
+
|
|
94
|
+
if _can_encode(unicode_char):
|
|
95
|
+
return unicode_char
|
|
96
|
+
return fallback or unicode_char
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: microlens-submit
|
|
3
|
-
Version: 0.16.
|
|
3
|
+
Version: 0.16.3
|
|
4
4
|
Summary: A tool for managing and submitting microlensing solutions
|
|
5
5
|
Home-page: https://github.com/AmberLee2427/microlens-submit
|
|
6
6
|
Author: Amber Malpas
|
|
@@ -41,6 +41,7 @@ Requires-Dist: isort; extra == "dev"
|
|
|
41
41
|
Requires-Dist: sphinx; extra == "dev"
|
|
42
42
|
Requires-Dist: sphinx_rtd_theme; extra == "dev"
|
|
43
43
|
Requires-Dist: importlib_resources; extra == "dev"
|
|
44
|
+
Requires-Dist: python-dotenv; extra == "dev"
|
|
44
45
|
Dynamic: author
|
|
45
46
|
Dynamic: home-page
|
|
46
47
|
Dynamic: license-file
|
|
@@ -197,3 +198,23 @@ A comprehensive test CSV file is provided at `tests/data/test_import.csv`. This
|
|
|
197
198
|
If you use **microlens-submit** in your research, please cite the project using
|
|
198
199
|
the metadata provided in the `CITATION.cff` file. Most reference managers can
|
|
199
200
|
import this file directly.
|
|
201
|
+
|
|
202
|
+
Bibtex:
|
|
203
|
+
```
|
|
204
|
+
@software{malpas_2025_17468488,
|
|
205
|
+
author = {Malpas, Amber},
|
|
206
|
+
title = {microlens-submit},
|
|
207
|
+
month = oct,
|
|
208
|
+
year = 2025,
|
|
209
|
+
publisher = {Zenodo},
|
|
210
|
+
version = {v0.16.3},
|
|
211
|
+
doi = {10.5281/zenodo.17468488},
|
|
212
|
+
url = {https://doi.org/10.5281/zenodo.17468488},
|
|
213
|
+
}
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
Cite without version:
|
|
217
|
+
Malpas, A. (2025). microlens-submit. Zenodo. https://doi.org/10.5281/zenodo.17459752
|
|
218
|
+
|
|
219
|
+
Cite current version:
|
|
220
|
+
Malpas, A. (2025). microlens-submit (v0.16.3). Zenodo. https://doi.org/10.5281/zenodo.17468488
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
CHANGELOG.md
|
|
2
|
+
CITATION.cff
|
|
1
3
|
LICENSE
|
|
2
4
|
MANIFEST.in
|
|
3
5
|
README.md
|
|
@@ -5,6 +7,7 @@ pyproject.toml
|
|
|
5
7
|
setup.py
|
|
6
8
|
microlens_submit/__init__.py
|
|
7
9
|
microlens_submit/error_messages.py
|
|
10
|
+
microlens_submit/text_symbols.py
|
|
8
11
|
microlens_submit/tier_validation.py
|
|
9
12
|
microlens_submit/utils.py
|
|
10
13
|
microlens_submit/validate_parameters.py
|
|
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
|
|
|
6
6
|
|
|
7
7
|
[project]
|
|
8
8
|
name = "microlens-submit"
|
|
9
|
-
version = "0.16.
|
|
9
|
+
version = "0.16.3"
|
|
10
10
|
authors = [
|
|
11
11
|
{ name="Amber Malpas", email="malpas.1@osu.edu" },
|
|
12
12
|
{name = "Roman Science Platform Team", email = "roman-science-platform@stsci.edu"}
|
|
@@ -60,6 +60,7 @@ dev = [
|
|
|
60
60
|
"sphinx",
|
|
61
61
|
"sphinx_rtd_theme",
|
|
62
62
|
"importlib_resources",
|
|
63
|
+
"python-dotenv",
|
|
63
64
|
]
|
|
64
65
|
|
|
65
66
|
# Setuptools package configuration
|
|
@@ -8,7 +8,7 @@ from setuptools import find_packages, setup
|
|
|
8
8
|
if __name__ == "__main__":
|
|
9
9
|
setup(
|
|
10
10
|
name="microlens-submit",
|
|
11
|
-
version="0.16.
|
|
11
|
+
version="0.16.3",
|
|
12
12
|
packages=find_packages(include=("microlens_submit", "microlens_submit.*")),
|
|
13
13
|
include_package_data=True,
|
|
14
14
|
package_data={
|
|
@@ -390,10 +390,13 @@ def test_cli_compare_solutions_skips_zero_data_points():
|
|
|
390
390
|
|
|
391
391
|
result = runner.invoke(app, ["compare-solutions", "evt"])
|
|
392
392
|
assert result.exit_code == 0
|
|
393
|
-
# Should only show the valid solution in the table
|
|
394
|
-
#
|
|
395
|
-
#
|
|
396
|
-
|
|
393
|
+
# Should only show the valid solution in the table. Depending on console support
|
|
394
|
+
# Rich may render Unicode box characters or ASCII fallbacks. Count the header row
|
|
395
|
+
# that contains the "Relative" column (ignoring the footer line that describes BIC).
|
|
396
|
+
header_lines = [
|
|
397
|
+
line for line in result.stdout.splitlines() if "Relative" in line and "Relative probabilities" not in line
|
|
398
|
+
]
|
|
399
|
+
assert len(header_lines) == 1
|
|
397
400
|
|
|
398
401
|
|
|
399
402
|
def test_params_file_option_and_bands():
|
|
File without changes
|
{microlens_submit-0.16.1 → microlens_submit-0.16.3}/microlens_submit/assets/github-desktop_logo.png
RENAMED
|
File without changes
|
{microlens_submit-0.16.1 → microlens_submit-0.16.3}/microlens_submit/assets/rges-pit_logo.png
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{microlens_submit-0.16.1 → microlens_submit-0.16.3}/microlens_submit/cli/commands/__init__.py
RENAMED
|
File without changes
|
{microlens_submit-0.16.1 → microlens_submit-0.16.3}/microlens_submit/cli/commands/dossier.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{microlens_submit-0.16.1 → microlens_submit-0.16.3}/microlens_submit/dossier/solution_page.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{microlens_submit-0.16.1 → microlens_submit-0.16.3}/microlens_submit.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{microlens_submit-0.16.1 → microlens_submit-0.16.3}/microlens_submit.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|