-
Notifications
You must be signed in to change notification settings - Fork 15
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
fix: compact number in email should consider format #1656
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gulfaraz this is not fully correct. You have to take the weighted average, in this case through 'weightVar=total_houses', which is also an indicator-attribute. In aggregates.service in the front-end there is an example of how this is used. You can maybe argue this is already better than the sum we had before, but this will lead to differing numbers between email and portal. If too much work, you could yet again opt to omit the total (the whole line) in case of percentage. It's even arguable that this total percentage doesn't have much value, because it depends on how you go with including admin-areas in this set that are far from the track and have 1% damage, which is a semi-random rule anyway..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried and failed to understand the
weighted var
andweighted average
so I fell back to a simple average. I want the email and portal values to match. The calculation on the frontend is coupled with place codes and layers so it's not easy to extract the underlying calculation.Can you give a pseudo-code explanation of the correct calculation? I'm lost on which variables mean what and how they are connected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please realize that having this total figure in the email is a new feature, that is not currently not on production. So we're losing nothing with just omitting it.
Pseudocode formula is just something like: total-% = (area1-%*area1-total_houses + area2-%*area2-total_houses) / (area1-total_houses + area2-total_houses).
You probably don't have this additional data on 'total_houses' per area readily available at the place where you need it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted.
Thank you @jannisvisser
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gulfaraz I see your new commit. To be honest I was actually meaning to only omit the line in the percentage case. Because it does work correctly in the sum-case, which is the vast majority of all implementations (population_affected). I guess you would maybe judge this unclean code and therefore prefer to remove it altogether? But in this particular case, it might be better to split it with a clear comment in the code explaining why.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wasn't clear before and is now perplexing. Did the feature requirements describe this exception?
We agreed to have shared behaviour across countries and hazards without exceptions like these. I understand we implemented this feature before our agreement, but we're deciding to sign off on the feature now.
The requirement is to show the same aggregate value in the email as in the dashboard. If the suggestion is to show a value in the dashboard but not in the email, I advise to not ship a partial implementation. Let's refine this feature when it returns as feedback.
This addresses the discrepancy for us devs. However, it does not explain why the value is missing to the end-user, those demoing IBF, design, and other stakeholders.
We have the opportunity to,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'm convinced by your argumentation, but do not appreciate the unfriendly tone of the choice of the word 'perplexing' (unless I'm misinterpreting somehow).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By perplexing, I meant confusing. I apologize if it came across as unfriendly. It was very neutral.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, clear, thanks :)