-
Notifications
You must be signed in to change notification settings - Fork 57
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
MAINT: save data and rebuild model #49
Conversation
@@ -233,6 +239,12 @@ def fit_authors(data, | |||
trace.attrs['model-version'] = get_versions()['version'] | |||
trace.attrs['model-type'] = AUTHOR_MODEL_TYPE | |||
|
|||
if save_data: | |||
d = data.set_index(['meta_user_id', |
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.
These dimension names should match the ones used in the model (line 59)
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.
That way xarray knows that they are the same dimension, and doesn't store the coordinates twice.
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.
Ah, so then:
author
-> meta_user_id
algo
-> meta_algorithm_id
backtest
-> meta_code_id
Right?
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.
yes
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.
Done!
thanks |
@aseyboldt latest Jenkins build failed because of the same dim names
|
I think the easiest solution to this would be to change the dim names for I'm not sure if this is the most elegant solution though, since the user may wait to access the data by itself, and the underscores would make it a pain. @aseyboldt what do you think? |
It should be possible to fix that. We somehow need to tell xarray to reuse those coords. Give me a couple of minutes. |
This seems to be more difficult than I thought: pydata/xarray#1603 The dimension |
data storage is necromancy |
I created pydata/xarray#2299. I think we should just add a
just before the assignment to the xarray dataset. |
I forgot to save the data as part of the trace. This does that and also allows us to
rebuild_model
.