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

remove white space when passing rescale parameters for float32 value #360

Merged
merged 1 commit into from
Aug 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Release Notes

## Next (TDB)
## 0.3.6 (2021-08-23)

### titiler.core

- fix morecantile related tests (https://github.com/developmentseed/titiler/issues/358)
- fix float parsing when datatype is float32 (https://github.com/developmentseed/rio-viz/issues/39)

### titiler.application

Expand Down
10 changes: 10 additions & 0 deletions src/titiler/core/tests/test_factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ def test_TilerFactory():
assert "postprocess;dur" in timing
assert "format;dur" in timing

response = client.get(
f"/tiles/8/87/48?url={DATA_DIR}/cog.tif&rescale=-3.4028235e+38,3.4028235e+38"
)
assert response.status_code == 200
assert response.headers["content-type"] == "image/jpeg"
timing = response.headers["server-timing"]
assert "dataread;dur" in timing
assert "postprocess;dur" in timing
assert "format;dur" in timing

response = client.get(
f"/tiles/8/87/48.tif?url={DATA_DIR}/cog.tif&expression=b1,b1,b1&return_mask=false"
)
Expand Down
2 changes: 1 addition & 1 deletion src/titiler/core/titiler/core/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ class RenderParams(DefaultDependency):
def __post_init__(self):
"""Post Init."""
self.rescale_range = (
[tuple(map(float, r.split(","))) for r in self.rescale]
[tuple(map(float, r.replace(" ", "").split(","))) for r in self.rescale]
if self.rescale
else None
)