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

Conversation

Projects
None yet
2 participants
@c-w
Copy link
Member

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

@c-w c-w added the in progress label 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;

This comment has been minimized.

Copy link
@Smarker

Smarker Aug 17, 2017

Contributor

I'd guard against row.mentioncount = 0

This comment has been minimized.

Copy link
@c-w

c-w Aug 17, 2017

Author Member

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

This comment has been minimized.

Copy link
@Smarker

Smarker Aug 17, 2017

Contributor

Oh interesting I didn't know that.

@Smarker
Copy link
Contributor

left a comment

LGTM

@c-w c-w merged commit 376c80d into master Aug 17, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@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.
You can’t perform that action at this time.