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 messages for missing keywords #42

Open
hamogu opened this issue Aug 13, 2015 · 1 comment
Open

Improve error messages for missing keywords #42

hamogu opened this issue Aug 13, 2015 · 1 comment
Milestone

Comments

@hamogu
Copy link
Member

hamogu commented Aug 13, 2015

Currently, that just raises a KeyError at some point, but given the complex inheritance structure, it's easy to loose track of which keywords are required and which ones are optional.
Ideas:

  • Compile list of required and optional keywords. This probably needs a class level variable that hold this info.
  • It can also hold docs - can be added to the class docstring on generate with a metaclass.
  • The top of every __init__ could have a check that prints the help for missing keywords - a metaclass might help again.

I've heard of "traits" at some point. Need to investigate if that already provides this functionality.

@hamogu
Copy link
Member Author

hamogu commented Aug 20, 2015

Similarly, add warnings for process_photons runs:

  • if photons is empty (I got a "col missing" error, because I processed an empty table, so the process_photons added that column because it was never needed).
  • if photons is so long / big that memory problems might arise
  • if there are nans in pos, dir (in other columns, nan might mean "not applicable")?
  • ...

Could put these tests into __call__, so they would run only then and internally I continue to call process_photons. Would miss some warnings, but also save time.

@hamogu hamogu added this to the future milestone Jan 2, 2017
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

No branches or pull requests

1 participant