Skip to content
This repository has been archived by the owner. It is now read-only.

Fix sentiment dereference for latest model changes #110

Merged
merged 2 commits into from Aug 17, 2017
Merged

Fix sentiment dereference for latest model changes #110

merged 2 commits into from Aug 17, 2017

Conversation

@c-w
Copy link
Contributor

@c-w c-w commented Aug 17, 2017

Made necessary by changes in this pull request
CatalystCode/project-fortis-pipeline#118

@c-w c-w requested a review from erikschlegel Aug 17, 2017
*/
function computedtileToTile(row) {
const coordinates = [geotile.longitudeFromColumn(row.tiley, row.tilez), geotile.latitudeFromRow(row.tilex, row.tilez)];
const mentionCount = row.mentioncount;
const neg_sentiment = row.avgsentiment;
const neg_sentiment = row.avgsentimentnumerator / row.mentioncount;
Copy link
Contributor

@Smarker Smarker Aug 17, 2017

I'd guard against row.mentioncount = 0

Copy link
Contributor Author

@c-w c-w Aug 17, 2017

Division by zero is safe(-ish) in Javascript (just gives you infinity), but sure, let's make it explicit: 62c0ee2

Copy link
Contributor

@Smarker Smarker Aug 17, 2017

Oh interesting I didn't know that.

Copy link
Contributor

@Smarker Smarker left a comment

LGTM

@c-w c-w merged commit 376c80d into master Aug 17, 2017
2 checks passed
@c-w c-w deleted the fix-sentiment branch Aug 17, 2017
@c-w c-w removed the in progress label Aug 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants