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

Updates to File Parsing #105

Merged
merged 5 commits into from
Jul 25, 2024
Merged

Updates to File Parsing #105

merged 5 commits into from
Jul 25, 2024

Conversation

srvasude
Copy link
Collaborator

  • Push test files in to separate subdirectory (for each of the data types).
  • Rename files to use _ naming everywhere.
  • Update util_io to do CSV parsing for the observations. This allows for spaces in the values (which is what we see in the PCLean datasets + other real datasets).
  • Improve error handling in file parsing.

Copy link
Collaborator

@emilyfertig emilyfertig left a comment

Choose a reason for hiding this comment

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

Thanks, this LG -- could you update the README too?

cxx/util_io.cc Outdated
}
},
schema.at(relname)));
} catch(const std::out_of_range& e) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we check schema.contains(relname) instead of try/catch? Do you know if try/catch here will make it harder to run this inside Google eventually, given the prohibition on exceptions?

I've been thinking about whether it's worth it to implement more graceful error handling at this stage (maybe propagating error codes up to main) and using asserts only to check for invalid program state. Let's talk next week about what to do with that -- in the meantime, I'd kind of prefer to just stick with assert everywhere for consistency.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated. Sticking with assert seems reasonable, since that is Google compatible. Do you mean using abseil Status and passing that around (to be Google compatible)?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I was thinking abseil Status, but I haven't done much thinking/investigating other options (there's std::expected, but that's not until C++23)

@srvasude srvasude merged commit 4448b33 into master Jul 25, 2024
1 check passed
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.

2 participants