-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Hans Kallekleiv
committed
Sep 7, 2020
1 parent
c147444
commit 80625e2
Showing
9 changed files
with
282 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,11 @@ | ||
import numpy as np | ||
|
||
from webviz_subsurface._datainput.image_processing import ( | ||
array_to_png, | ||
get_colormap, | ||
) | ||
from webviz_subsurface._datainput.image_processing import array_to_png | ||
|
||
with open("tests/data/surface_png.txt", "r") as f: | ||
BASE64_SURFACE = f.read() | ||
with open("tests/data/colormap.txt", "r") as f: | ||
BASE64_COLORMAP = f.read() | ||
|
||
|
||
def test_array_to_png(): | ||
data = np.loadtxt("tests/data/surface_zarr.np.gz") | ||
assert array_to_png(data) == BASE64_SURFACE | ||
|
||
|
||
def test_colormap(): | ||
assert get_colormap("viridis") == BASE64_COLORMAP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.