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

Add a data table template class #104

Open
apdjustino opened this issue Mar 7, 2019 · 1 comment
Open

Add a data table template class #104

apdjustino opened this issue Mar 7, 2019 · 1 comment
Assignees

Comments

@apdjustino
Copy link

As mentioned in issue #94, we need to have a template class that will define and register a table into Orca. The idea is for the user to be able to specify the table from a yaml spec, and all registered tables in Orca can also be written to a yaml.

A yaml specified table will support different data sources, where the user can specify the type of the source and any additional detail that are specific to different data sources. The table template should also include a calculated_columns property that is an array of columnType classes that will represent calculated columns.

@apdjustino apdjustino self-assigned this Mar 7, 2019
@smmaurer
Copy link
Member

smmaurer commented Mar 8, 2019

Generic TemplateGroup class?

What do you think about creating a generic TemplateGroup class, either to help with this or potentially as the full solution?

The TemplateGroup would bundle together an arbitrary set of other template objects. It would handle loading them all into ModelManager/Orca, saving them all to a single yaml file, and functionality for adding/removing/editing the individual objects.

So a user could create a group containing a table plus the derived columns needed for model simulation, and then maybe a separate group for indicator columns. This would keep the yaml files organized while maintaining a lot of flexibility.

For common use cases, we could provide some kind of wizard for automatically building particular types of groups, either in Python or just in the web ui.

Related examples

Earlier we built a template called SegmentedLargeMultinomialLogitStep that automatically creates multiple LargeMultinomialLogitStep models corresponding to categories of choosers. See PR #45 and segmented_large_multinomial_logit.py.

Having a generic TemplateGroup would help simplify this kind of thing too. I think we'd still need an explicit template for segmented models, to provide the logic for identifying segments and building sub-models, but some of the data management could come out.

We ended up including some neat functionality in the segmented model template, like having a defaults object that automatically updates all the sub-models when its properties are changed. But this added a lot of complexity to the code and i'm not sure it's worth it.

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

No branches or pull requests

2 participants