Ejemplo n.º 1
0
 def test_null_probabilities(self):
     """Test effect of "neutral" emos coefficients in probability space.
     Mean, 0 and 1 probabilities are not preserved."""
     expected_data = np.array([
         np.full((3, 3), 0.9999999),
         np.full((3, 3), 0.9452005),
         np.full((3, 3), 0.02274995),
     ])
     result = ApplyEMOS()(self.probabilities,
                          self.coefficients,
                          realizations_count=3)
     self.assertIn("probability_of", result.name())
     self.assertArrayAlmostEqual(result.data, expected_data)
Ejemplo n.º 2
0
 def test_percentiles_in_probabilities_out(self):
     """Test effect of "neutral" emos coefficients in percentile space
     (this is small but non-zero due to limited sampling of the
     distribution)"""
     expected_data = np.array(
         [np.ones((3, 3)), np.full((3, 3), 0.977250), np.full((3, 3), 0.001350)]
     )
     result = ApplyEMOS()(
         self.percentiles,
         self.coefficients,
         realizations_count=3,
         prob_template=self.probabilities,
     )
     self.assertIn("probability_of", result.name())
     self.assertArrayAlmostEqual(result.data, expected_data)