center-randomize
center-randomize copied to clipboard
Validate TSV files for processing
Summary
Added data validation and enhanced error handling for input files in the school center allocation script.
Pull request type
Please try to limit your pull request to one type, and submit multiple pull requests if needed.
Please tick the type of change your PR introduces:
- [ ] Bugfix
- [x] Feature
- [ ] Code style update (formatting, renaming)
- [ ] Refactoring (no functional changes, no API changes)
- [ ] Build related changes
- [ ] Documentation content changes
- [ ] Other (please describe):
What is the current behaviour?
The current script does not validate the input data, which can lead to errors and incorrect allocations when invalid data is provided.
Issue Number: N/A
What is the current behaviour?
Please describe the changes or updates being made by this pull request.
- Added a validate_data function to check the integrity of input files for schools, centers, and preferences.
- Enhanced error handling for file operations to catch common issues like file not found, permission errors, and malformed data.
- The script now exits with a relevant error message if validation fails or if there are issues with reading the files.
Checklist
Please review and complete the following checklist before submitting your pull request:
- [x] I have tested the changes locally and they work as intended.
- [x] I have provided a detailed description of the changes made.
- [x] I have reviewed the formatting and ensured it follows the project's style guidelines.
- [ ] I have assigned the appropriate labels to the pull request.
- [ ] I have added necessary documentation or updated existing documentation for the changes made.
- [ ] I have addressed code review feedback and resolved any conflicts with the main branch.
Other information
Include screenshots of the component before and after the change.