Skip to content

Commit

Permalink
fixed call to optimize jenk in plotting
Browse files Browse the repository at this point in the history
  • Loading branch information
wino6687 committed Feb 13, 2020
1 parent 6e04027 commit 1d6c614
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion swepy/classify.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def plot_jenks(image, gvt, interactive=False):
"yellow",
]
classes_jenk = jenkspy.jenks_breaks(
image.ravel(), optimal_jenk(image.ravel(), gvt)
image.ravel(), optimal_jenk(image.ravel(), gvt)[0]
)
classes = np.digitize(image, classes_jenk)
nclasses = len(classes_jenk)
Expand Down
11 changes: 5 additions & 6 deletions swepy/tests/test_classify.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

@pytest.fixture
def swe():
print(os.listdir())
swe = np.load("swepy/tests/swe_testfile.npy")
return swe

Expand Down Expand Up @@ -37,11 +36,11 @@ def test_optimal_jenk_bounds(swe):
"""
info = classify.optimal_jenk(swe.ravel(), 0.8)
assert info[1] == [
22.024993896484375,
27.162506103515625,
30.257492065429688,
33.41499328613281,
38.93499755859375,
13.257644653320312,
16.314910888671875,
18.693313598632812,
21.749465942382812,
28.034332275390625,
]


Expand Down

0 comments on commit 1d6c614

Please sign in to comment.