Skip to content
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 histogram removing last spurious bin #123

Merged
merged 5 commits into from
Mar 19, 2021
Merged

Conversation

VictorVelarde
Copy link
Contributor

@VictorVelarde VictorVelarde commented Mar 16, 2021

This is a use case to detect the issue:

       const features = [
            { field: 1 },
            { field: 2 }, { field: 2 },
            { field: 3 }, { field: 3 }, { field: 3 },
            { field: 4 }, { field: 4 },
            { field: 5 }            
        ];

        const ticks = [2, 4, 6];

        const h = histogram(features, 'field', ticks, AggregationTypes.COUNT);        
        console.log(h); // [1, 5, 3, 0, 0]

Results

Histogram results should be interpreted as:
>=MIN to <2 --> 1 item
>=2 to <4 --> 5 items
>=4 to <6 --> 3 items
>=6 to MAX --> 0 items

BUT there is an extra bin, with value 0, that shouldn't be there (unless I'm missing something non obvious)

@VictorVelarde VictorVelarde requested a review from AdriSolid March 16, 2021 18:38
@VictorVelarde
Copy link
Contributor Author

We still have to fix tests on viewportFeatures. that I missed

@coveralls
Copy link
Collaborator

coveralls commented Mar 17, 2021

Pull Request Test Coverage Report for Build 667549435

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.04%) to 79.292%

Totals Coverage Status
Change from base Build 661969161: 0.04%
Covered Lines: 583
Relevant Lines: 698

💛 - Coveralls

@VictorVelarde VictorVelarde requested a review from padawannn March 19, 2021 10:04
@VictorVelarde VictorVelarde merged commit 30f7a90 into master Mar 19, 2021
@VictorVelarde VictorVelarde deleted the fix-histogram-last branch March 19, 2021 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants