Skip to content

BUG: pickling with formulas - use original dataframe - #2375

Merged
josef-pkt merged 4 commits into
statsmodels:masterfrom
josef-pkt:BUG_pickle_formula
Jun 24, 2015
Merged

josef-pkt merged 4 commits into
statsmodels:masterfrom
josef-pkt:BUG_pickle_formula

Conversation

@josef-pkt

Copy link
Copy Markdown
Member

see reopened #1263

use original data frame to rebuild formula after unpickle

I will add unit tests before merging

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.0%) to 83.9% when pulling de53a6d on josef-pkt:BUG_pickle_formula into a1f53b0 on statsmodels:master.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.01%) to 83.9% when pulling e60282d on josef-pkt:BUG_pickle_formula into a1f53b0 on statsmodels:master.

Comment thread statsmodels/base/data.py Outdated

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

should we add a warning about which eval depth is used?
This could create problems if there are several function with the same name in different namespaces, I guess.

@josef-pkt

Copy link
Copy Markdown
Member Author

test error with user defined log: NameError: name 'log' is not defined
but only on python 2.6, 2.7, while on python 3 tests are green
There could also be a difference about which namespace is used for the unit tests.

I'm using now python 3.4 for development

@josef-pkt

Copy link
Copy Markdown
Member Author

It looks like in python 2 the exception is the NameError directly, and it's not hiding behind PatsyError as in python 3. In python 2 the exception was never caught.

(finally got my python 2.7 debugging environment set up.)

waiting to see if TravisCI confirms

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.0%) to 83.91% when pulling 56bc8ab on josef-pkt:BUG_pickle_formula into a1f53b0 on statsmodels:master.

@josef-pkt

Copy link
Copy Markdown
Member Author

@chrimobs @jseabold

Any comments, review?

I'm pretty much done here. TravisCI is green.
The change doesn't look dangerous, since it still allows the old behavior.
So still possible for 0.7

One problem in all the eval_env code is that the first matching eval environment wins, which might cause a mess if functions in local namespaces shadow functions in higher or in the global namespace, and we have no idea which one the user wants.
(We and users shouldn't do this anyway.)

@josef-pkt josef-pkt added this to the 0.7 milestone Apr 28, 2015
@josef-pkt
josef-pkt force-pushed the BUG_pickle_formula branch from 56bc8ab to e1dfd98 Compare April 28, 2015 12:33
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.0%) to 83.91% when pulling e1dfd98 on josef-pkt:BUG_pickle_formula into a1f53b0 on statsmodels:master.

@josef-pkt

Copy link
Copy Markdown
Member Author

rebased to change my author name

I will merge it in a few hours if there are no comments.

@josef-pkt

Copy link
Copy Markdown
Member Author

I will rebase and merge this.

We can refactor when patsy has pickling support

@josef-pkt
josef-pkt force-pushed the BUG_pickle_formula branch from e1dfd98 to 6d6e904 Compare June 24, 2015 11:43
josef-pkt added a commit that referenced this pull request Jun 24, 2015
BUG: pickling with formulas - use original dataframe
@josef-pkt
josef-pkt merged commit c64066f into statsmodels:master Jun 24, 2015
@josef-pkt
josef-pkt deleted the BUG_pickle_formula branch July 27, 2015 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants