Skip to content

Commit

Permalink
fix locator (#78)
Browse files Browse the repository at this point in the history
* fix formatters and locator

* reinstate formatters
  • Loading branch information
bjlittle authored May 3, 2022
1 parent de3a965 commit 59e05fd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
9 changes: 4 additions & 5 deletions tephi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def __init__(self, step):
>>> from tephi import Locator
>>> locator = Locator(10)
>>> locator(-45, 23)
(array([-45., -35., -25., -15., -5., 5., 15., 25.]), 8, 1)
(array([-50, -40, -30, -20, -10, 0, 10, 20]), 8, 1)
Args:
Expand All @@ -296,10 +296,9 @@ def __call__(self, start, stop):
"""Calculate the axis ticks given the provided tick range."""

step = self.step
start = (int(start) / step) * step
stop = (int(stop) / step) * step
ticks = np.arange(start, stop + step, step)

start = (int(start) // step) * step
stop = (int(stop) // step) * step
ticks = np.arange(start, stop + step, step, dtype=int)
return ticks, len(ticks), 1


Expand Down
18 changes: 12 additions & 6 deletions tephi/tests/results/imagerepo.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,28 @@
"https://scitools.github.io/test-tephi-imagehash/images/e85a992d90c56630cced39afc6198cf6c734e26197997a9269669d8d387330e6.png"
],
"test_tephigram.TestTephigramPlot.test_plot_dews_locator_adiabat_numeric.0": [
"https://scitools.github.io/test-tephi-imagehash/images/e85a9e0c91a3663ccda5398c965a9cf6cb3462619b9c3f134c66cd099e737346.png"
"https://scitools.github.io/test-tephi-imagehash/images/e85a9e0c91a3663ccda5398c965a9cf6cb3462619b9c3f134c66cd099e737346.png",
"https://scitools.github.io/test-tephi-imagehash/images/e85a9f0991a76639cca53989965d98d6cf3462619b893f124c664b9c9c7b7256.png"
],
"test_tephigram.TestTephigramPlot.test_plot_dews_locator_adiabat_object.0": [
"https://scitools.github.io/test-tephi-imagehash/images/e85a9e0c91a3663ccda5398c965a9cf6cb3462619b9c3f134c66cd099e737346.png"
"https://scitools.github.io/test-tephi-imagehash/images/e85a9e0c91a3663ccda5398c965a9cf6cb3462619b9c3f134c66cd099e737346.png",
"https://scitools.github.io/test-tephi-imagehash/images/e85a9f0991a76639cca53989965d98d6cf3462619b893f124c664b9c9c7b7256.png"
],
"test_tephigram.TestTephigramPlot.test_plot_dews_locator_isotherm_numeric.0": [
"https://scitools.github.io/test-tephi-imagehash/images/e85a8f2c90c56630cce539ad96591c96cf347a6795986a924966cd8dbc73e1e4.png"
"https://scitools.github.io/test-tephi-imagehash/images/e85a8f2c90c56630cce539ad96591c96cf347a6795986a924966cd8dbc73e1e4.png",
"https://scitools.github.io/test-tephi-imagehash/images/e85a9f2d90c56630cce539ac96599cf6c7b46a6195986a924d66cd8d1e23363e.png"
],
"test_tephigram.TestTephigramPlot.test_plot_dews_locator_isotherm_object.0": [
"https://scitools.github.io/test-tephi-imagehash/images/e85a8f2c90c56630cce539ad96591c96cf347a6795986a924966cd8dbc73e1e4.png"
"https://scitools.github.io/test-tephi-imagehash/images/e85a8f2c90c56630cce539ad96591c96cf347a6795986a924966cd8dbc73e1e4.png",
"https://scitools.github.io/test-tephi-imagehash/images/e85a9f2d90c56630cce539ac96599cf6c7b46a6195986a924d66cd8d1e23363e.png"
],
"test_tephigram.TestTephigramPlot.test_plot_dews_locator_numeric.0": [
"https://scitools.github.io/test-tephi-imagehash/images/e85a9e0c91e3663ccda5398c965b1cd6cb346a639a9c27334c664d099c78e3f6.png"
"https://scitools.github.io/test-tephi-imagehash/images/e85a9e0c91e3663ccda5398c965b1cd6cb346a639a9c27334c664d099c78e3f6.png",
"https://scitools.github.io/test-tephi-imagehash/images/e85a9f0991e76639c5a53989965d1cd6cf346a63939867b30c664bcc1e1b7216.png"
],
"test_tephigram.TestTephigramPlot.test_plot_dews_locator_object.0": [
"https://scitools.github.io/test-tephi-imagehash/images/e85a9e0c91e3663ccda5398c965b1cd6cb346a639a9c27334c664d099c78e3f6.png"
"https://scitools.github.io/test-tephi-imagehash/images/e85a9e0c91e3663ccda5398c965b1cd6cb346a639a9c27334c664d099c78e3f6.png",
"https://scitools.github.io/test-tephi-imagehash/images/e85a9f0991e76639c5a53989965d1cd6cf346a63939867b30c664bcc1e1b7216.png"
],
"test_tephigram.TestTephigramPlot.test_plot_dews_temps.0": [
"https://scitools.github.io/test-tephi-imagehash/images/e969cc3992c76726cd973326c65869c6c3319e4d9c9849333c2c6399e5a7a7a4.png"
Expand Down

0 comments on commit 59e05fd

Please sign in to comment.