-
Notifications
You must be signed in to change notification settings - Fork 70
number matcher #191
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
base: main
Are you sure you want to change the base?
number matcher #191
Conversation
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 everything up to 4de6b28 in 2 minutes and 25 seconds. Click for details.
- Reviewed
43lines of code in1files - Skipped
0files when reviewing. - Skipped posting
5draft 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/selection.ts:879
- Draft comment:
DRY: The code for assigning the transformation and applying it is duplicated across type branches. Consider refactoring the common logic into a helper to avoid repetition. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
2. src/selection.ts:915
- Draft comment:
Code clarity: Instead of using the short-circuit operator for side effects (i.e. 'matchings.has(values[i]) && bitmask.set(i)'), consider using an explicit if-statement for better readability. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 70% The short-circuit && operator is a common and well-understood pattern in JavaScript/TypeScript, especially for conditional execution. While an if statement would be more verbose, the current code is not unclear. The same pattern is used in the bigintmatcher function above, suggesting this is a consistent style choice. The code is performance-sensitive as it runs in a tight loop over potentially large datasets. The if statement version would be more explicit and potentially more readable for junior developers. The current pattern could be seen as a "trick" by some. The short-circuit && pattern is idiomatic in JavaScript/TypeScript and using it consistently across similar functions aids readability. In performance-sensitive code, concise expressions can be preferable. The comment should be deleted. The current code uses a common JavaScript idiom consistently and changing it would not meaningfully improve clarity.
3. src/selection.ts:877
- Draft comment:
When checking codes[0] to determine its type, consider handling the case when the codes array is empty to avoid unexpected undefined behavior. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
4. src/selection.ts:390
- Draft comment:
Typo: In the documentation comment for the selection name (line 390), 'colun' should be corrected to 'column'. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
5. src/selection.ts:217
- Draft comment:
Typo: In the comment within the Bitmask.which() method (around line 217), 'THese are sparse...' should be corrected to 'These are sparse...'. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
Workflow ID: wflow_ovSukLj30Ut45aYz
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
| const matchings = new Set(matches); | ||
| return async function (tile: Tile) { | ||
| const col = (await tile.get_column(field, subfield)).data[0]; | ||
| const values = col.values as number[]; |
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.
The new numbermatcher function duplicates logic from bigintmatcher. Consider refactoring common parts to adhere to DRY principles.

Important
Adds
numbermatcherfunction tosrc/selection.tsfor handling number-based matching inDataSelection, updatingadd_identifier_columnto support number arrays.numbermatcherfunction insrc/selection.tsfor handling number-based matching inDataSelection.add_identifier_columninDataSelectionto usenumbermatcherfor number arrays.codes[0]type is unrecognized inadd_identifier_column.This description was created by
for 4de6b28. You can customize this summary. It will automatically update as commits are pushed.