Exemplo n.º 1
0
 def test_bad_shape_error(self):
     with pytest.raises(ValueError,
                        match=r'Input arrays must be three-dimensional.'):
         strat.compute_boxy_stratigraphy_volume(self.elev[:, 10,
                                                          120].squeeze(),
                                                self.time[:, 10,
                                                          120].squeeze(),
                                                dz=0.05)
Exemplo n.º 2
0
 def test_returns_volume_and_elevations_given_nz(self):
     s, e = strat.compute_boxy_stratigraphy_volume(self.elev,
                                                   self.time,
                                                   nz=33)
     assert s.ndim == 3
     assert s.shape == e.shape
     assert s.shape[0] == 33 + 1
Exemplo n.º 3
0
 def test_returns_volume_and_elevations_given_dz(self):
     s, e = strat.compute_boxy_stratigraphy_volume(self.elev,
                                                   self.time,
                                                   dz=0.05)
     assert s.ndim == 3
     assert s.shape == e.shape
     assert e[1, 0, 0] - e[0, 0, 0] == pytest.approx(0.05)
Exemplo n.º 4
0
 def test_returns_volume_and_elevations_given_z(self):
     z = np.linspace(-20, 500, 200)
     s, e = strat.compute_boxy_stratigraphy_volume(self.elev,
                                                   self.time,
                                                   z=z)
     assert s.ndim == 3
     assert s.shape == e.shape
     assert np.all(e[:, 0, 0] == z)
Exemplo n.º 5
0
 def test_no_z_options(self):
     with pytest.warns(UserWarning, match=r'No specification .*'):
         strat.compute_boxy_stratigraphy_volume(self.elev, self.time)
Exemplo n.º 6
0
 def test_return_cube(self):
     s, e = strat.compute_boxy_stratigraphy_volume(self.elev,
                                                   self.time,
                                                   dz=0.05,
                                                   return_cube=True)