-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data rounding on RiskProfiler #64
Comments
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 |
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. |
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. |
Changes since 2022-09-12: * wp-app 2bf917f...ad9132a (3): > data output formatting (OpenDRR#64) > WPML fix for page tour plugin > PSRA indicator descriptions
this may have been addressed already - could you clarify where these figures are exactly? |
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. |
The newest revision is being updated and should fix the 0 probabilities mentioned above.
Following up again on this rule above. |
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. |
Changes since 2022-10-17: * wp-app 6808772...9cb3fb7 (1): > risks - fixed sidebar indicators using incorrect formatting rules (#64)
Changes since 2022-10-17: * wp-app 6808772...9cb3fb7 (1): > risks - fixed sidebar indicators using incorrect formatting rules (OpenDRR#64)
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
The text was updated successfully, but these errors were encountered: