-
Notifications
You must be signed in to change notification settings - Fork 12
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
This PR rewrites to io.tess.TOI
object using pydantic
#425
This PR rewrites to io.tess.TOI
object using pydantic
#425
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #425 +/- ##
==========================================
+ Coverage 78.91% 79.44% +0.53%
==========================================
Files 30 30
Lines 3823 3800 -23
==========================================
+ Hits 3017 3019 +2
+ Misses 806 781 -25 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I approve this, but would appreciate feedback on the questions.
# Don't complain about connection errors | ||
"raise requests.ConnectionError", | ||
# Don't complain about script hooks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this to avoid errors during testing if the TESS servers are not available?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, and I wasn't sure how to test for that case...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I had to read through it a bit, but pydantic classes do make some things a lot easier, like having properties. That said, I wonder, can you now set the values of those properties by calling them or is pydantic preventing that. Not a huge concern, but one nice feature of @property
is allowing you to make read-only attributes... at the pydantic ones read-only once set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can now set them, but pydantic has a way of making them non-settable: https://docs.pydantic.dev/latest/concepts/models/#faux-immutability
Lmk if you want me to do that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(merging for now, though, so I can open the next PR)
Doing so has a couple of advantages:
Helps address, but does not complete fix the issue #188