Stop ignoring type for optional
@@ -38,9 +38,11 @@ def test_autocorr_returns_ndarray_of_correct_dtype() -> None:
net = m.to_bayes_net()
samples = sample(net=net, sample_from=net.get_latent_vertices(), algo="metropolis", draws=1000)
valid_key = list(samples.keys())[0]
- autocorr = stats.autocorrelation(samples.get(valid_key)) # type: ignore
+ sample_ = samples.get(valid_key)
+ assert sample_ is not None
+ autocorr = stats.autocorrelation(sample_)
assert type(autocorr) == np.ndarray
- assert autocorr.dtype == samples.get(valid_key)[0].dtype # type: ignore
+ assert autocorr.dtype == sample_[0].dtype
def test_cant_get_autocorrelation_of_np_bools() -> None:
