Experienced w/ django, new to hg

6 views
Skip to first unread message

Jeremy Dunck

unread,
Sep 27, 2009, 7:46:49 PM9/27/09
to djang...@googlegroups.com
Hey folks,
Doing an experiment framework for Django has been on my to-do list
for a while. I'm new to hg, so will need some pointers to push
patches back. I'm already familiar with svn and git, if there's a
tutorial from that perspective?

It looks like you have pretty good test coverage, nice to see in a
brand-new project.

A few things I noticed off the bat--
1) ClientSideExperimentNode sets "client_side_experiments", but only
in the top-most frame of the context stack. This means that when
context frames are popped off, the registered experiements will also
be lost. This doesn't do what's intended:
{% for a in list %}
{% clientsideexperiment test %}
{% endif %}
{% include "experiments/include/experiment_enrollment.html" %}
This problem is exacerbated with template inheritance, etc.

I think in ClientSideExperimentNode.render, rather than this:
context[self.CONTEXT_KEY][self.experiment_name]
you want this:
context.dicts[-1][self.CONTEXT_KEY][self.experiment_name]

2) experiment_enrollment.html depends on request being in the
context; this is often achieved by using RequestContext with the
'request' context processor in TEMPLATE_CONTEXT_PROCESSORS, but it's
not the default config, and so is worth documenting.

3) As virtualenv and pip usage becomes more widespread, it's getting
fairly common for projects to include a file w/ the output of "pip
freeze REQUIREMENTS.TXT". This helps people get dependencies more
quickly installed.

4) numpy is a pretty heavy dependency for just mean and isnan. Do
you use more than that internally, or would you mind fallback
implementations if numpy isn't available?

try:
from numpy import mean, isnan
except ImportError:
#def mean and isnan here...

Erik Wright

unread,
Sep 27, 2009, 8:06:33 PM9/27/09
to djang...@googlegroups.com, djang...@googlegroups.com
Hi Jeremy,

Thanks for the feedback. When you are ready to submit patches we'll be
happy to help. I don't know what tutorials exist.

(1) we haven't done too much experimentation in JS yet so it doesn't
surprise me if there's a bug there. Why not create a ticket with that
comment and suggestion. And/or submit a patch with teatcase.

(2) you're right. Feel like adding it to the docs?

(3) we don't use PIP or other dependency/packaging tools in-house so
it is hard to know what others might require. Definitely happy to
incorporate patches that make django-lean play friendly with such tools.

(4) we do use SciPy for statistical significance tests, and that
depends on NumPy. Confidence in conversion tests could be done with a
lookup table instead of SciPy, and the same applies to engagement
tests, although there is more work there. I'm happy to remove all
trivial uses of either library and make the others fallback to not
implemented. More precisely, I'm happy to accept patches that do that ;)

Thanks again for your attention to django-lean!

Erik (from my phone)

Erik Wright

unread,
Sep 28, 2009, 11:47:20 AM9/28/09
to django-lean

Jeremy Dunck

unread,
Sep 28, 2009, 12:00:18 PM9/28/09
to djang...@googlegroups.com

Ah, I didn't realize bitbucket had an issue tracker. Thanks for the feedback.

Reply all
Reply to author
Forward
0 new messages