How to use the termgraph.termgraph.normalize function in termgraph

To help you get started, we’ve selected a few termgraph examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mkaz / termgraph / tests / test_termgraph.py View on Github external
def test_normalize_with_larger_width_does_not_normalize(self):
        expected = [[183.32], [231.23], [16.43], [50.21], [508.97], [212.05], [1.0]]
        results = tg.normalize(expected, 20000)
        assert results == expected
github mkaz / termgraph / tests / test_termgraph.py View on Github external
def test_normalize_with_negative_datapoint_returns_correct_results(self):
        expected = [[18.625354066709058], [23.241227816636798],
                    [2.546389964737846], [5.8009133475923464], [50.0],
                    [21.393336801741913], [0.0]]
        results = tg.normalize([[183.32], [231.23], [16.43], [50.21], [508.97],
                                [212.05], [-10.0]], 50)
        assert results == expected
github mkaz / termgraph / tests / test_termgraph.py View on Github external
def test_normalize_returns_correct_results(self):
        expected = [[18.00891997563707], [22.715484213214925],
                    [1.6140440497475292], [4.932510757019078], [50.0],
                    [20.83128671630941], [0.09823761714835845]]
        results = tg.normalize([[183.32], [231.23], [16.43], [50.21], [508.97],
                                [212.05], [1.0]], 50)
        assert results == expected