Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error messaging in CSVReader #1095

Merged
merged 5 commits into from
Jan 13, 2025
Merged

Improve error messaging in CSVReader #1095

merged 5 commits into from
Jan 13, 2025

Conversation

jeremykubica
Copy link
Contributor

Fixes #1023

When CSVReader encounters a file with terminating blank lines and uses the read objects method, it throws a confusing error. This approach wraps the read in a try block and check if the error is just due to blank lines.

Review Checklist for Source Code Changes

  • Does pip install still work?
  • Have you written a unit test for any new functions?
  • Do all the units tests run successfully?
  • Does Sorcha run successfully on a test set of input files/databases?
  • Have you used black on the files you have updated to confirm python programming style guide enforcement?

@jeremykubica jeremykubica requested a review from mschwamb January 13, 2025 19:37
fix typo in comments
Copy link
Collaborator

@mschwamb mschwamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks @jeremykubica

@mschwamb mschwamb merged commit 06f2a44 into main Jan 13, 2025
7 checks passed
@mschwamb mschwamb deleted the cvs_robustness branch January 13, 2025 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Input files having >1 extra empty rows at the end breaks CSVReader
2 participants