Open plesueur opened 1 year ago
this required a pretty extensive overhaul of the method of formatting/displaying figures - ready to review on both the scenarios and risks pages, please take a look and let me know if there are issues
@JulieVdV @plesueur @tieganh please review
I started looking into this yesterday and following @plesueur rounding scheme above comparing it on beta riskprofiler and against our postgis db (v1p4p3). Writing a specific query for each condition to match above scheme and picking a few spots to validate the results. Will compare 1 scenario assuming the method applies to all and look at the risks.
Gone through 1 scenario and everything looks fine. Only one possible mismatch I noticed is when rounding to 2 sig figs for values under 100. For example, 14.xx becomes 10, 27 becomes 30 etc. Technically that's 1 sig fig only so not sure if that needs to be changed or mentioned somewhere else that its ok. @plesueur @phil-evans
Will start looking at the probabilistic next.
Hi, I notice that the scores given in the 'pop-out' on the left are not rounded for probabilistic, whereas the scores given on the pop-ups on the map are rounded. See screenshot below:
fixed today along with the eCr_Fatality bug - see #74
Just following up from our meeting on Thurs for small values that are >0 and mentioning display sig figs, it should still display the sig fig value and not 0. For example actual value 0.0022 should display 0.002 (1 sig fig, psra life loss rule) and not 0.
Hello Folks!
First of all, this looks awesome. Thank Habitat7 for all the effort on this one.
As a final check, I looked over the rounding results, and have a few edits below (listed in order of priority).
[ ] Highlighting Will C's observations about the 0 values being reported for probabilistic results. Please follow the scheme for rounding probabilistic values.
[x] Need to apply the rounding scheme to the scenario overview side panels. In the below examples, Deaths should = 3.4 thousand; Damage should = 18 thousand buildings
[x] I am proposing the following minor edit to the rounding scheme provided at the top of the page. The rationale for the change is that you can clearly see the exact values on the graphs when x < 100, and notice a discrepancy in what is reported. This will resolve that.
Scenario data - Injuries/Building Damages: if x = 0, display '0' if 0 < x <= 1, display '1 or less' if 1 < x < 100, report a range to the nearest 10 (1 to 10, 10 to 20, 20 to 30, 30 to 40, 40 to 50, etc...). if x >= 10, display two significant figures (e.g. 422 becomes 420, etc.)
Risk scores are rounded to the nearest ten currently (as requested, sorry about that!). Please round to the integer.
this may have been addressed already - could you clarify where these figures are exactly?
Just reviewed. Looking so good! Thanks for all the effort. A few comments.
[x] I'm not sure if I'm looking at the most recent version, but I don't see the scenario injuries/building damage data rounding scheme update. This includes reporting values between 1 < x < 100 as a range to the nearest 10 (e.g. if X is between 1 and 10 report '1 to 10' on the bars and map, if it's between 10 and 20, report it as '10 to 20' on the bars and map, and so forth up to x < 100). See example below. Let me know if you have questions.
[x] you may be working on this now, but if not, for the average annual fatalities and annual probability of fatality (probabilistic data), the values shown on the map should match those on the sidebar. In other words, use the same rounding rules. See examples below.
-here average annual fatalities reported on the map should be 0.0008.
-here the annual probability of fatality reported on the map should be 0.000001.
check it out now @plesueur - for the first one i misread the request and i had only made it round to the nearest 10 rather than a range.:
Nice work Phil! Using a range to the nearest ten works great! No proposed edits on that one at this point.
Also nice work on matching the map and sidebar values. Looks good to me.
@wkhchow and @phil-evans , I'm getting some interesting results for the annual probability of fatality and average annual fatalities.
Example 1: showing 0 average annual fatalities even though the color shows its much higher.
Example 2: I get a 0 annual probability of fatality for Toronto. @wkhchow is that correct based on our database?
Also nice work on matching the map and sidebar values. Looks good to me.
@wkhchow and @phil-evans , I'm getting some interesting results for the annual probability of fatality and average annual fatalities. Example 1: showing 0 average annual fatalities even though the color shows its much higher.
Example 2: I get a 0 annual probability of fatality for Toronto. @wkhchow is that correct based on our database?
The newest revision is being updated and should fix the 0 probabilities mentioned above.
Following up again on this rule above. It looks like the rules are applied to the PSRA as well for absolute damages/injuries, but when viewing the probability we see the actual 'rounding' applied. Just want to confirm we want that applied to PSRA side as well? @phil-evans @plesueur
good catch @wkhchow - the sidebar indicators were formatting according to the rules of the current selected indicator, rather than the rules that should be applied for each individual figure. so it looked right when you were exploring 'annual fatalities' etc but not 'economic loss'. please review and let me know if you're still seeing bugs.
also see below:
if a number is tiny enough javascript returns it as 'Xe-Y' - should we change that to display as 0.0000000X? @plesueur
@phil-evans. Annual probability of fatality is often reported in scientific notation, but I think you're right to report it as a decimal for this case. We may lose people when there are too many zeros, but we would probably lose more people to a number with a 'e' in the middle.
done!
There are a few issues open pertaining to data rounding (#29, #46, #43), so I am making one issue that will cover them all.
Included below is a proposed rounding scheme for data presented on RiskProfiler. This should be implemented site-wide (maps and charts). I suspect some back and forth between the science and dev team will be needed to get this right, so consider this scheme as V1. Also, @phil-evans, as you implement this, if you notice the results are coming out weird, make a comment here so it can be addressed.
Scenario data Dollars: if x = 0, display '0' if x < 1000, display 'less than 1000' if x >= 1000 display two significant figures (e.g. 23,456 becomes 23 thousand; 234,567 becomes 230 thousand; 2,345,678 becomes 2.3 million)
Injuries/Building Damages: if x = 0, display '0' if 0 < x < 1, display '0' if 1 <= x < 10, display 'less than 10' if x >= 10, display two significant figures (e.g. 422 becomes 420, etc.)
Disaster Debris: if x = 0, display '0' if x < 100, display 'less than 100' if x > 100 display two significant figures (as above).
Probabilistic Data Probable Life Loss: if x = 0, display '0' if 0 < x < 0.01, display one significant figure. if x > 0.01 display two significant figures.
Ratios: if x = 0, display '0' if x < 0.01, display one significant figure. if 0.01 < x < 0, display two significant figures.
Capital Asset Loss: Follow DRSA scheme for dollars Building Damage: Follow DSRA scheme for building damages