yhat/ggplot — pull request #201 by JanSchulz (2014-02-06 22:38:09+00:00)
Title: ENH: Better transformations and don't deepcopy data

Data transformation in aes (`aes(x="np.log(column)")' now uses
patsy.eval.EvalEnvironment. This should enable things like
`np.log(column)`.

Closes: yhat/ggplot#188

The changes also let some bug in the current unittests show up:
setting a aes mapping (`aes(fill=True)`) was considered equivalent
to setting this values in the geom `geom_density(fill=True)`). Now
this will result in the same weired result as in ggplot (if we
would have already implemented fill... -> #191). The affected
unittests (test_basic.py, test_readme_examples.py) were changed.

Also implement `__depcopy__()` for `aes` and ´ggplot` to not
deepcopy the needed eval environment as deepcopy failed with
the above change. ggplot deepcopy now does *not* copy the
dataframe, so this should result in some speedups. Also adjusted
the unittest in test_geom.py to fit this new model.

Closes: yhat/ggplot#145

Added unittests (test_ggplot_internals.py) to make sure that the
original data is not changed and also that no data is changed
after a geom addition.