| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Codecov Report❌ Patch coverage is 95.00000% with 2 lines in your changes missing coverage. Please review.
📢 Thoughts on this report? Let us know! |
Sorry, something went wrong.
|
@gepcel @munechika-koyo can this be merged? |
Sorry, something went wrong.
|
|
||
| @pytest.mark.parametrize( | ||
| "norm", | ||
| ["linear", ["linear"], ("linear",)], |
There was a problem hiding this comment.
| ["linear", ["linear"], ("linear",)], | |
| ["linear", "log", ["linear"], ("linear",)], |
What about trying a different norm?
Sorry, something went wrong.
There was a problem hiding this comment.
We could; I am currently just testing against the explicit inputs which are str, list or tuple
Sorry, something went wrong.
There was a problem hiding this comment.
I understand that we conducted the type testing there.
It is probably confirmed somewhere that parsing a string and converting it into the corresponding normalizer is possible, so it might not be necessary here.
Sorry, something went wrong.
There was a problem hiding this comment.
I will check
Sorry, something went wrong.
There was a problem hiding this comment.
I added this test
@pytest.mark.parametrize("norm", [uplt.DiscreteNorm, uplt.colors.mcolors.Normalize])
def test_normalize_types(norm):
data = np.random.rand(10, 10)
target = norm
print(norm)
if norm is uplt.DiscreteNorm:
norm = uplt.DiscreteNorm(levels=[0, 1])
discrete = True
elif norm is uplt.colors.mcolors.Normalize:
norm = uplt.colors.mcolors.Normalize(vmin=0, vmax=1)
discrete = False
else:
raise ValueError("Norm not understood.")
fig, ax = uplt.subplots()
cm = ax.pcolormesh(data, norm=norm, discrete=discrete)
assert isinstance(cm.norm, target)
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Closes #689
When vmin, vmax is given, norms should not be allowed as inputs (as they are part of the norm object). When strings are given, however, we must allow the logic to run.