"Study DLP over time" fails charts (?)
Not sure if this has already been addressed (or if I have missed something obvious in the install), but I have a small issue with plotting charts: - when checking "Study DLP over time" (in "Chart options"), none of the charts are generated due to a "UnboundLocalError: local variable 'studyMeanDLPoverTime' referenced before assignment." (views.py, line 928). Unchecking this generates the other charts as normal.
Tried to work around this by copying line 906 (in views.py) to line 902 to ensure that "studyMeanDLPoverTime" was defined, however, this only solves the problem if "PlotAverageChoice" in the user profile is set to 'mean' (not for 'median' and 'both').
Tried this on a clean 0.7.0b6, all default settings (SQLite, numpy 1.10.1). I think I had this issue on b5 as well. Any suggestions?
Comments (9)
-
-
Hi. This is a bug, which I'm about to fix. Your error is caused because line 905 of view.py is only run if the median calculation is available. This is only the case for a PostgreSQL database. The "median_available and" part of the "if" statement on line 905 needs to go, then all should be well.
-
- changed status to resolved
Fixed bug that was causing study DLP over time chart to fail. Fixes issue
#295→ <<cset 15ea89783862>>
-
My test system is based on PostgreSQL, including the median function. It would be good for someone to confirm that this really has fixed the problem for an OpenREM installation that uses another database. I'm 99.9 % sure that it will now be fixed.
-
- changed milestone to 0.7.0
-
assigned issue to
- marked as major
-
I've checked every other instance of
if median_available and...
in views.py: there are no other slip-ups like this. -
reporter Very good, I'll test it with SQLite when I'm back at the office (over the weekend).
-
reporter Hi @dplatten, I can confirm that it seems to work nicely with SQLite as well.
-
Excellent – thanks for checking for me.
- Log in to comment
@dplatten might be able to confirm, but I think this has been probably been fixed between the last beta release and the current dev code.