@@ -78,12 +78,11 @@ things are.)
7878 from patsy import (ModelDesc, EvalEnvironment, Term, EvalFactor,
7979 LookupFactor, demo_data, dmatrix)
8080 data = demo_data(" a" , " x" )
81- env = EvalEnvironment.capture()
8281
8382 # LookupFactor takes a dictionary key:
8483 a_lookup = LookupFactor(" a" )
8584 # EvalFactor takes arbitrary Python code:
86- x_transform = EvalFactor(" np.log(x ** 2)" , env )
85+ x_transform = EvalFactor(" np.log(x ** 2)" )
8786 # First argument is empty list for dmatrix; we would need to put
8887 # something there if we were calling dmatrices.
8988 desc = ModelDesc([],
@@ -157,7 +156,7 @@ The full interface looks like this:
157156 :term: `hashable `. These methods will determine which factors
158157 Patsy considers equal for purposes of redundancy elimination.
159158
160- .. method :: memorize_passes_needed(state)
159+ .. method :: memorize_passes_needed(state, eval_env )
161160
162161 Return the number of passes through the data that this factor
163162 will need in order to set up any :ref: `stateful-transforms `.
@@ -171,6 +170,9 @@ The full interface looks like this:
171170 will be passed back in to all memorization and evaluation
172171 methods.
173172
173+ `eval_env ` is an :class: `EvalEnvironment ` object, describing
174+ the Python environment where the factor is being evaluated.
175+
174176 .. method :: memorize_chunk(state, which_pass, data)
175177
176178 Called repeatedly with each 'chunk' of data produced by the
0 commit comments