Skip to content
This repository was archived by the owner on Mar 7, 2018. It is now read-only.

Fix sentiment dereference for latest model changes - #110

Merged
c-w merged 2 commits into
masterfrom
fix-sentiment
Aug 17, 2017
Merged

c-w merged 2 commits into
masterfrom
fix-sentiment

Conversation

@c-w

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

Copy link
Copy Markdown
Contributor

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

@c-w
c-w requested a review from erikschlegel August 17, 2017 20:35
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
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd guard against row.mentioncount = 0

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh interesting I didn't know that.

@Smarker Smarker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@c-w
c-w merged commit 376c80d into master Aug 17, 2017
@c-w
c-w deleted the fix-sentiment branch August 17, 2017 22:17
@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

Development

Successfully merging this pull request may close these issues.

2 participants