-
Notifications
You must be signed in to change notification settings - Fork 69
cleaner deeptable instantiation pattern #172
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
cleaner deeptable instantiation pattern #172
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
37721e5
to
89b9a63
Compare
89b9a63
to
5703fd8
Compare
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.
Important
Looks good to me! 👍
Reviewed 89b9a63 in 1 minute and 51 seconds. Click for details.
- Reviewed
92
lines of code in2
files - Skipped
1
files when reviewing. - Skipped posting
4
draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. src/Deeptable.ts:191
- Draft comment:
Consider replacing the lazy manifest check (using '!tileManifest.max_ix') with an explicit flag for clarity. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 30% vs. threshold = 70% The comment makes a reasonable suggestion - using a property presence check as a type discriminator is a bit hacky. An explicit flag would make the code's intent clearer. However, this seems like a relatively minor improvement and the current code is not obviously wrong or problematic. The TODO comment already acknowledges this could be cleaner. The comment may be premature optimization - the current code works and the meaning is documented in the TODO. Without more context about the manifest types and their usage patterns, it's hard to be certain this change would be an improvement. While an explicit flag would be cleaner, the current code is functional and its intent is documented. The suggested change would be nice-to-have but not critical. The comment makes a reasonable suggestion but is not critical enough to keep, given the existing TODO and working code.
2. src/Deeptable.ts:147
- Draft comment:
Good use of a static async 'fromQuadfeather' method with camelCase; consider adding a comment on tileProxy support for future expansion. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =30%
<= threshold70%
The comment suggests adding a comment for future expansion, which aligns with the rule that extremely complicated code needs comments. However, it doesn't specify if the code is complicated or if the comment is necessary for understanding. It seems more like a suggestion for documentation rather than a necessary code review comment.
3. src/scatterplot.ts:376
- Draft comment:
Updated to use the new 'fromQuadfeather' API; ensure downstream error handling for unsupported tileProxy cases. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 70% The comment has two parts: 1) Noting the API change - this is purely informative and not actionable. 2) Suggesting to ensure error handling - this is speculative ("ensure that...") and doesn't point to a specific issue. The comment seems to violate the rules about not making purely informative comments and not asking authors to verify/ensure things. The comment could be pointing to a real error handling issue with tileProxy that I'm missing. The API change could introduce breaking changes that need attention. While those are valid concerns, the comment doesn't provide specific evidence of issues. If there were known error handling problems, they should be called out directly. API changes should be handled through tests and types, not comments. This comment should be deleted as it is purely informative about the API change and makes a speculative suggestion about error handling without identifying a specific issue.
4. src/Deeptable.ts:148
- Draft comment:
Typographical issue: In the comment, consider changing "version 2.0 or great of the quadfeather package" to "version 2.0 or greater of the quadfeather package". - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 0% vs. threshold = 70% While this is technically correct - it is a typo - the rules state not to make purely informative comments or comments that are obvious/unimportant. A minor typo in a docstring that doesn't affect functionality or clarity is not worth a comment. The meaning is still clear even with "great" instead of "greater". The typo could theoretically cause confusion for non-native English speakers. Documentation quality is important for public APIs. While documentation quality matters, this typo is so minor that it doesn't meaningfully impact understanding. The rules explicitly say not to make purely informative comments. Delete this comment as it violates the rule against making purely informative comments that don't require code changes.
Workflow ID: wflow_FeanLWLUKKo3n9D0
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
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.
Caution
Changes requested ❌
Reviewed 5703fd8 in 1 minute and 51 seconds. Click for details.
- Reviewed
103
lines of code in3
files - Skipped
1
files when reviewing. - Skipped posting
7
draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. src/Deeptable.ts:144
- Draft comment:
Good improvement using _makePromise in the constructor. Note that the lazy manifest check (if (!tileManifest.max_ix)) is still marked TODO—consider refining this check to robustly detect incomplete manifests. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 0% vs. threshold = 70% The code in question was moved from the constructor into a new protected method _makePromise(), but the logic itself wasn't changed. The TODO comment was already there before. The review comment is just highlighting an existing TODO without providing specific suggestions for improvement. It's more of an observation than an actionable code review comment. The comment does point out a potential robustness issue in the code. Perhaps there could be cases where max_ix exists but the manifest is still incomplete? While the concern about robustness is valid, simply noting an existing TODO without providing concrete suggestions for improvement doesn't help the PR author. The comment doesn't meet our bar for being clearly actionable. This comment should be deleted as it merely points out an existing TODO without providing specific, actionable feedback about changes made in this PR.
2. src/Deeptable.ts:185
- Draft comment:
Consider rewriting _makePromise to use async/await consistently instead of mixing .then with async. This would improve readability. - Reason this comment was not posted:
Confidence changes required:70%
<= threshold70%
None
3. src/Deeptable.ts:1248
- Draft comment:
Renaming the manifest loader to 'loadTileManifest' to follow camelCase is a nice improvement. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold70%
None
4. src/scatterplot.ts:375
- Draft comment:
Changing instantiation to 'await Deeptable.fromQuadfeather({ baseUrl, plot, tileProxy })' ensures the deeptable is fully initialized before use. This async pattern is an improvement over the previous synchronous style. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%
<= threshold70%
This comment is purely informative, praising the change without providing any actionable feedback or suggestions. It doesn't align with the rules as it doesn't offer a specific code suggestion or highlight a potential issue.
5. src/scatterplot.ts:368
- Draft comment:
In the load_deeptable method, handling of multiple data sources (source_url, arrow_table, arrow_buffer) looks solid—just ensure downstream code always awaits the deeptable's readiness to avoid race conditions. - Reason this comment was not posted:
Confidence changes required:70%
<= threshold70%
None
6. src/Deeptable.ts:148
- Draft comment:
Typographical note: The comment says "version 2.0 or great"; it likely should read "version 2.0 or greater". - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 70% The rules say not to make purely informative comments and to avoid obvious or unimportant changes. While this is technically about changed code, fixing a typo in a docstring is extremely minor and doesn't affect functionality. The meaning is still clear even with the typo. The typo could theoretically cause confusion for users reading the API docs. Documentation quality is important. While docs are important, this typo is so minor that the meaning is still completely clear. The cost of the PR review comment outweighs the tiny benefit. Delete this comment as it's too minor and doesn't affect functionality. The rules specifically say not to make purely informative comments.
7. src/Deeptable.ts:182
- Draft comment:
The comment "Internal function to ensure" appears incomplete. Please verify if additional context or wording is intended. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%
<= threshold70%
This comment is asking the PR author to verify if additional context or wording is intended, which violates the rule against asking the author to confirm their intention or to ensure the behavior is intended. It does not provide a specific code suggestion or request for a test, nor does it address any of the additional rules provided.
Workflow ID: wflow_xQRsxPWYfhLbdJTg
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
/** | ||
* Loads a quadtree created by version 2.0 or great of the quadfeather package (including manifests). | ||
* | ||
* @param tileProxy A tileProxy to use for fetching tiles. Can be used to wrap authentication. |
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.
Ensure the limitation of throwing on tileProxy
in the fromQuadfeather
factory method is documented.
* @param tileProxy A tileProxy to use for fetching tiles. Can be used to wrap authentication. | |
* @param tileProxy A tileProxy to use for fetching tiles. Passing this will throw, as it is not yet supported. |
if (tileProxy !== undefined) { | ||
throw new Error('Not yet supported'); | ||
} else { |
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.
There appears to be an inconsistency in the fromQuadfeather
method. It throws an error when tileProxy
is provided with the message 'Not yet supported', but then proceeds to pass this same tileProxy
parameter to the Deeptable
constructor. This could lead to confusing behavior since the code suggests the parameter isn't supported in one place but attempts to use it in another.
Consider either:
- Implementing proper support for the
tileProxy
parameter, or - Not passing the
tileProxy
to the constructor when it's defined
This would ensure consistent behavior and prevent potential issues when a tileProxy
is provided.
if (tileProxy !== undefined) { | |
throw new Error('Not yet supported'); | |
} else { | |
if (tileProxy !== undefined) { | |
// We'll handle tileProxy properly in a future update | |
console.warn('tileProxy parameter is not fully supported yet'); | |
} |
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
1f29cc2
to
128eff0
Compare
5703fd8
to
8f25b89
Compare
128eff0
to
4637f47
Compare
8f25b89
to
7a83241
Compare
4637f47
to
ab8ffb4
Compare
7a83241
to
ee5e075
Compare
Merge activity
|
60ef60a
to
ccd639b
Compare
Testing scaling to 10 billion points.
Important
Introduces
fromQuadfeather
method inDeeptable.ts
for cleaner instantiation with quadfeather data and updatesscatterplot.ts
to use this method.fromQuadfeather
static method inDeeptable.ts
for initializingDeeptable
with quadfeather data.Deeptable
with loaded data.tileManifest
toloadTileManifest
inDeeptable.ts
for better clarity.scatterplot.ts
to usefromQuadfeather
method forDeeptable
instantiation, replacingfrom_quadfeather
.This description was created by
for 5703fd8. You can customize this summary. It will automatically update as commits are pushed.