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

GPU Aggregation (3/8): CPUAggregator #8888

Open
wants to merge 2 commits into
base: x/aggregation-2
Choose a base branch
from

Conversation

Pessimistress
Copy link
Collaborator

For #7457

Change List

  • Add CPUAggregator

Copy link
Collaborator

@ibgreen ibgreen left a comment

Choose a reason for hiding this comment

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

Added some first impressions, will come back again for full review.

import {VertexAccessor, evaluateVertexAccessor} from './vertex-accessor';

/** Settings used to construct a new CPUAggregator */
export type CPUAggregatorSettings = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This mix of ...Settings and ...Props here kind of trips me up.

  • Can it be avoided?
  • Or can we work on the naming to make it clearer?
  • Could Props or Options be used as constructor arguments, rather than Settings. The latter seems more unfamiliar to me, but maybe used more extensively in deck.gl than I realize.

* If dimensions>1, bin ID should be an array with [dimensions] elements;
* The data point will be skipped if bin ID is null.
*/
getBin: VertexAccessor<number | number[] | null, any>;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: Always make it an array for cleaner types? Or there is a big enough convenience in allowing a single number?

*/
getBin: VertexAccessor<number | number[] | null, any>;
/** Accessor to map each data point to a weight value, defined per channel */
getWeight: VertexAccessor<number>[];
Copy link
Collaborator

Choose a reason for hiding this comment

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

getChannelValue()?

export type CPUAggregationProps = AggregationProps & {};

export type Bin = {
id: number | number[];
Copy link
Collaborator

Choose a reason for hiding this comment

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

Plural?

Suggested change
id: number | number[];
ids: number | number[];

attributes: {}
};

protected getBinId: CPUAggregatorSettings['getBin'];
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: probably clearer to type out the callback types here, rather than referencing another type.

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.

None yet

2 participants