-
Notifications
You must be signed in to change notification settings - Fork 3
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
chore: type centroid util #36
Conversation
Codecov Report
@@ Coverage Diff @@
## main #36 +/- ##
=======================================
Coverage 71.70% 71.70%
=======================================
Files 126 126
Lines 9988 9988
=======================================
Hits 7162 7162
Misses 2826 2826
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
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.
LGTM!! Thanks for updating the types, @seve 🙏 Just one question! Thank you!
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.
Overall looks good, with one caveat: the centrol helpers assume all labels are strings, which is incorrect AFAIK. We can have datasets with non-string categoricals (numbers, bools, etc).
@@ -31,7 +31,11 @@ describe("centroid", () => { | |||
schema, | |||
"field4", | |||
obsAnnotations, |
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.
Optional: given the confusion around the type of an obsAnnnotation, you may want to add tests which exercise the other label types (eg, number or boolean or blended)
@seve - you re-requested a review, but I don't see any changes to |
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.
LGTM.
You might consider additional test coverage as noted inline.
Type the centroid util and call sites as well as needed imports.
Note:
I did some retyping of the
CategeoricalColumnSchema
to make the categories field required on columns with type `categorical'. We'll have to do some tuning (#35) to reduce casting in favor of type guarding.I also had to untype
nextSharedState
(it was typing as RootState) as I believe it opens up a self reference . This should be fixed in #9 cc: @colinmegill