Exemplo n.º 1
0
 def test_returns_sc_dc_given_dz(self):
     # check for the warning when no option passed
     with pytest.warns(UserWarning):
         sc, dc = strat.compute_boxy_stratigraphy_coordinates(self.elev)
     # now specify dz
     sc, dc = strat.compute_boxy_stratigraphy_coordinates(self.elev,
                                                          dz=0.05)
     assert sc.shape == dc.shape
     assert sc.shape[1] == 3
     assert sc.shape[0] > 1  # don't know how big it will be
Exemplo n.º 2
0
 def test_returns_sc_dc_given_z(self):
     z = np.linspace(0, 0.25, 7)
     sc, dc = strat.compute_boxy_stratigraphy_coordinates(self.elev, z=z)
     assert np.min(sc[:, 0]) == 0
     assert np.max(sc[:, 0]) == 6
     # check that the number of z values matches len(z)
     assert np.unique(sc[:, 0]).shape[0] == len(z)
Exemplo n.º 3
0
 def test_returns_sc_dc_return_strata(self):
     sc, dc, s = strat.compute_boxy_stratigraphy_coordinates(
         self.elev, dz=0.05, return_strata=True)
     assert s.ndim == 3
     assert s.shape == self.elev.shape
     assert sc.shape == dc.shape
     assert sc.shape[1] == 3
Exemplo n.º 4
0
 def test_returns_sc_dc(self):
     sc, dc = strat.compute_boxy_stratigraphy_coordinates(self.elev,
                                                          dz=0.05)
     assert sc.shape == dc.shape
     assert sc.shape[1] == 3
Exemplo n.º 5
0
 def test_no_z_options(self):
     with pytest.warns(UserWarning, match=r'No specification .*'):
         strat.compute_boxy_stratigraphy_coordinates(
             self.elev[:, 10, 120].squeeze())
Exemplo n.º 6
0
 def test_return_cube(self):
     s, sc, dc = strat.compute_boxy_stratigraphy_coordinates(
         self.elev, dz=0.05, return_cube=True)
Exemplo n.º 7
0
 def test_returns_sc_dc_given_nz(self):
     sc, dc = strat.compute_boxy_stratigraphy_coordinates(self.elev, nz=13)
     assert np.min(sc[:, 0]) == 0
     # check that the number of z values matches nz
     assert np.unique(sc[:, 0]).shape[0] == 13