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

allow subfield access #141

Conversation

bmschmidt
Copy link
Collaborator

@bmschmidt bmschmidt commented Sep 9, 2024

This makes it possible for deepscatter to access not just single-depth fields, but also structs that can get probed into.

Struct<x: Float32, y: Float32>

This is useful because often a single transformation should create two or more columns.


Important

Enhance Deepscatter by adding support for accessing subfields within struct fields, improving data transformation and rendering.

  • Enhancement:
    • Add support for accessing subfields within struct fields in Deepscatter.
    • Update Aesthetic class to handle subfields.
    • Modify AestheticSet to support subfield access.
    • Enhance buffer management for nested fields in regl_rendering.ts.
    • Adjust data selection and transformation logic in selection.ts and scatterplot.ts to work with subfields.
    • Introduce TupleMap and TupleSet in utilityFunctions.ts for managing nested keys.
    • Update Tile class to support subfield access.

This description was created by Ellipsis for a3d1a8a. It will automatically update as commits are pushed.

Copy link
Collaborator Author

bmschmidt commented Sep 9, 2024

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @bmschmidt and the rest of your teammates on Graphite Graphite

@bmschmidt bmschmidt marked this pull request as ready for review September 9, 2024 16:00
@bmschmidt bmschmidt assigned RLesser and unassigned RLesser Sep 10, 2024
@bmschmidt bmschmidt force-pushed the 09-09-use_a_shared_object_with_multiple_length_keys_to_store_regl_buffers branch from aa964e6 to 2dac6bb Compare September 19, 2024 19:00
for (let i = 0; i < this.subfield.length; i++) {
v = v[this.subfield[i]] as Input['domainType'];
}
return v;
// Needs a default perhaps?
return null;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The return null; statement is unreachable due to the preceding return v; statement. Consider restructuring the function to ensure all code paths are reachable.

@bmschmidt bmschmidt force-pushed the 09-09-use_a_shared_object_with_multiple_length_keys_to_store_regl_buffers branch from 2dac6bb to c7a8537 Compare September 20, 2024 02:55
for (let i = 0; i < this.subfield.length; i++) {
v = v[this.subfield[i]] as Input['domainType'];
}
return v;
// Needs a default perhaps?
return null;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The return null; statement is unreachable due to the preceding return statement. Consider handling the case where this.field is not found in point before the loop.

@bmschmidt bmschmidt force-pushed the 09-09-use_a_shared_object_with_multiple_length_keys_to_store_regl_buffers branch 3 times, most recently from d175c73 to fb591fb Compare September 20, 2024 15:32
for (let i = 0; i < this.subfield.length; i++) {
v = v[this.subfield[i]] as Input['domainType'];
}
return v;
// Needs a default perhaps?
return null;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The return statement here is unreachable due to the preceding return statement inside the if block. Consider removing it.

@@ -824,8 +824,8 @@ export class DataSelection {
if (i === undefined) {
i = this.cursor;
}
if (i > this.selectionSize) {
undefined;
if (i >= this.selectionSize) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition i > this.selectionSize should be i >= this.selectionSize to correctly handle out-of-bounds access.

Copy link
Contributor

RLesser commented Sep 25, 2024

same here, "trunk branch locked"

@bmschmidt bmschmidt force-pushed the 09-09-use_a_shared_object_with_multiple_length_keys_to_store_regl_buffers branch from fb591fb to 9cdf75f Compare October 1, 2024 00:36
for (let i = 0; i < this.subfield.length; i++) {
v = v[this.subfield[i]] as Input['domainType'];
}
return v;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unreachable code after return v; in value_for method. Remove the redundant return null; statement.

@bmschmidt bmschmidt force-pushed the 09-09-use_a_shared_object_with_multiple_length_keys_to_store_regl_buffers branch from 9cdf75f to 5903dbd Compare October 1, 2024 00:48
for (let i = 0; i < this.subfield.length; i++) {
v = v[this.subfield[i]] as Input['domainType'];
}
return v;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant return statement. Remove the line after return v;.

@bmschmidt bmschmidt closed this Oct 4, 2024
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

Successfully merging this pull request may close these issues.

2 participants