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

Work in progress: ColumnFromBroadcast and ColumnFromAggregation #107

Draft
wants to merge 9 commits into
base: dev
Choose a base branch
from

Conversation

smmaurer
Copy link
Member

@smmaurer smmaurer commented Mar 29, 2019

This PR adds two more derived variable templates. This continues the implementation of issue #98. Like the first column template, they use settings objects (PR #108).

ColumnFromBroadcast

Template to register a column of derived data, generated by mapping values from another table via one or more join keys. Values calculated lazily.

Parameters:

meta : CoreTemplateSettings
data : BroadcastSettings
- source_table  # either single table or chain
- expression  # either single column or expression
output : OutputColumnSettings

Example use cases:

  • add tract population in thousands to the households table

ColumnFromAggregation

Template to register a column of derived data, generated by aggregating values from another table using group-by with a join key. Values calculated lazily.

Parameters:

meta : CoreTemplateSettings
data : AggregationSettings
- source_table  # either single table or chain
- expression  # either single column or expression (evaluated before grouping)
- filters  # filter rows before grouping
- group_by
- aggregation  # min, max, mean, count, sum, stdev, etc.
output : OutputColumnSettings

Example use cases:

  • calculate median building size by census tract
  • calculate total single-family housing units in a zone, in thousands

Versioning

  • 0.2.dev7, probably

To do before merging

  • revise ColumnFromBroadcast to use settings objects
  • finish testing ColumnFromBroadcast
  • implement and test ColumnFromAggregation
  • finalize versioning
  • update docs and changelog

@smmaurer smmaurer changed the base branch from master to dev February 16, 2021 23:50
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

1 participant