1. OpenREM
  2. OpenREM
  3. OpenREM
  4. Issues

Issues

Issue #295 resolved

"Study DLP over time" fails charts (?)

Eivind L
created an issue

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)

  1. David Platten

    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.

  2. David Platten

    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.

  3. Log in to comment