Issue #47 and other#74
Merged
Linked-Liszt merged 2 commits intoOct 20, 2025
Merged
Conversation
matthewrdiamond
commented
Oct 17, 2025
Collaborator
- Added input validation, including helper functions
- Added load_file_indices callback
- Updated check_filenames to populate the field
- Added load_file_indices callback - Updated check_filenames to populate the field
Collaborator
Author
# Wire Reconstruction Validation Checks
This document lists all validation checks performed by `validate_wire_reconstruction_inputs` in `create_wire_reconstruction.py`.
## Global Parameter Validation
### 1. Root Path
- Root path is required (empty or None)
- Root path directory exists (directory does not exist at path)
### 2. Data Path
- Data path is required (empty or None)
- Data path parsing succeeds (parse_parameter raises ValueError)
### 3. All Other Parameters
For each parameter: `filenamePrefix`, `scanPoints`, `geoFile`, `depth_start`, `depth_end`, `depth_resolution`, `percent_brightest`, `outputFolder`, `scanNumber`, `wire_edges`, `author`
- Parameter is not missing/empty (value is None, empty string, or falsy except 0 for numeric fields)
- Parameter parsing succeeds (parse_parameter raises ValueError)
- Parameter count matches number of inputs (parsed list length ≠ number of data paths)
**Note**: `scanNumber` generates warnings instead of errors for all checks
## Per-Input Validation
### 4. Depth Parameters
- Depth start is required (empty for this input)
- Depth start is valid number (cannot convert to float)
- Depth end is required (empty for this input)
- Depth end is valid number (cannot convert to float)
- Depth resolution is required (empty for this input)
- Depth resolution is valid number (cannot convert to float)
- Depth start < depth end (depth_start ≥ depth_end)
- Large depth range warning (depth_end - depth_start > 500 µm)
- Depth resolution is positive (depth_resolution ≤ 0)
- Very small depth resolution warning (depth_resolution < 0.1 µm)
- Depth resolution < depth range (depth_resolution > |depth_end - depth_start|)
### 5. Intensity Percentile
- Intensity percentile is required (empty for this input)
- Intensity percentile is valid number (cannot convert to float)
- Intensity percentile in valid range (value ≤ 0 or > 100)
### 6. Geometry File
- Geometry file is required (empty for this input)
- Geometry file exists (file does not exist at root_path/geoFile)
### 7. Output Folder
- Output folder is required (empty for this input)
- Output folder already exists warning (directory exists at root_path/outputFolder, skipped if contains %d)
### 8. Data Files
- Data directory exists (directory does not exist at root_path/data_path)
- Data directory contains files (directory exists but contains no files)
- Catalog path matches warning (catalog database has different path for this scan number)
- Files match prefix pattern (no files match filenamePrefix pattern with wildcard substitution)
- Files match specific scan points (files missing for specific scan point numbers in scanPoints)
- Invalid scan points format (srange parsing fails for scanPoints)
### 9. Scan Number
- Scan number is valid integer warning (cannot verify .isdigit())
## Summary
**Total Checks**: ~30 global + ~25 per input
**Result Structure**:
```python
{
'heading': str, # "Validation Error!" | "Validation Warning!" | "Validation Success!"
'errors': list,
'warnings': list,
'field_highlights': dict # {field_id: 'error'|'warning'}
}Special Cases:
|
Collaborator
Author
|
scanNumber has hard-coded exemptions (warnings instead of errors) |
Collaborator
Author
|
Also, a missing '*' was added to the glob call to find for matching files in submit_parameters(). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.