MTgeophysics / mtpy

Python toolbox for standard Magnetotelluric (MT) data analysis
GNU General Public License v3.0
147 stars 66 forks source link

On Ubuntu Linux desktop the py.test tests/modeling failiures at interpolate.py #16

Closed zhang01GA closed 6 years ago

zhang01GA commented 6 years ago

fzhang@ubuntu16qos/e/Githubz/mtpy (develop) $ py.test tests/modeling/ =========================================================== test session starts ============================================================ platform linux2 -- Python 2.7.12, pytest-3.0.7, py-1.4.31, pluggy-0.4.0 rootdir: /Softlab/Githubz/mtpy, inifile: plugins: cov-2.4.0, celery-4.0.2 collected 64 items

tests/modeling/test_occam1d.py ... tests/modeling/test_occam2d.py FF tests/modeling/ModEM/test_ModEM_PlotDepthSlice.py . tests/modeling/ModEM/test_ModEM_PlotPTmap.py . tests/modeling/ModEM/test_ModEM_PlotRMSMap.py . tests/modeling/ModEM/test_ModEM_PlotResponse.py . tests/modeling/ModEM/test_data.py ssssssssssssssssFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF tests/modeling/ModEM/test_model.py ssFFFF tests/modeling/ModEM/test_modem_inputfiles_builder.py F

================================================================= FAILURES ================================================================= ___ TestOccam2D.test_fun ___

self =

def test_fun(self):
    """

        :return:
        """
  outdir = self._main_func(edipath=EDI_DATA_DIR)

tests/modeling/test_occam2d.py:130:


tests/modeling/test_occam2d.py:83: in _main_func ocd.write_data_file() mtpy/modeling/occam2d.py:2640: in write_data_file self._fill_data() mtpy/modeling/occam2d.py:2392: in _fill_data z_interp, t_interp = edi.interpolate(interp_freq) mtpy/core/mt.py:1718: in interpolate new_f) + 1j * z_func_imag(new_f) /usr/local/lib/python2.7/dist-packages/scipy/interpolate/interpolate.py:394: in call out_of_bounds = self._check_bounds(x_new)


self = <scipy.interpolate.interpolate.interp1d object at 0x7fc1c0e90810> x_new = array([ 78.125 , 62.5 , 46.875 , 39.0625 , 31.25 , 23.... 3.90625 , 3.125 , 2.34375 , 1.953125, 1.5625 , 1.171875])

def _check_bounds(self, x_new):
    """Check the inputs for being in the bounds of the interpolated data.

        Parameters
        ----------
        x_new : array

        Returns
        -------
        out_of_bounds : bool array
            The mask on x_new of values that are out of the bounds.
        """

    # If self.bounds_error is True, we raise an error if any x_new values
    # fall outside the range of x.  Otherwise, we return an array indicating
    # which values are outside the boundary region.
    below_bounds = x_new < self.x[0]
    above_bounds = x_new > self.x[-1]

    # !! Could provide more information about which values are out of bounds
    if self.bounds_error and below_bounds.any():
      raise ValueError("A value in x_new is below the interpolation "

"range.") E ValueError: A value in x_new is below the interpolation range.

/usr/local/lib/python2.7/dist-packages/scipy/interpolate/interpolate.py:449: ValueError ---------------------------------------------------------- Captured stdout setup ----------------------------------------------------------- 2017-11-26T10:56:42 - tests.imaging - INFO - Testing using matplotlib backend TkAgg ----------------------------------------------------------- Captured stdout call ----------------------------------------------------------- 2017-11-26T10:56:42 - Edi - INFO - Reading the edi file /Softlab/Githubz/mtpy/examples/data/edi_files/pb32c.edi 2017-11-26T10:56:42 - Edi - INFO - Could not find any Tipper data. 2017-11-26T10:56:42 - Edi - INFO - Read in edi file for station pb32 2017-11-26T10:56:42 - Edi - INFO - Reading the edi file /Softlab/Githubz/mtpy/examples/data/edi_files/pb40c.edi 2017-11-26T10:56:42 - Edi - INFO - Could not find any Tipper data. 2017-11-26T10:56:42 - Edi - INFO - Read in edi file for station pb40 2017-11-26T10:56:42 - Edi - INFO - Reading the edi file /Softlab/Githubz/mtpy/examples/data/edi_files/pb39c.edi 2017-11-26T10:56:42 - Edi - INFO - Could not find any Tipper data. 2017-11-26T10:56:42 - Edi - INFO - Read in edi file for station pb39 2017-11-26T10:56:42 - Edi - INFO - Reading the edi file /Softlab/Githubz/mtpy/examples/data/edi_files/pb25c.edi 2017-11-26T10:56:42 - Edi - INFO - Could not find any Tipper data. 2017-11-26T10:56:42 - Edi - INFO - Read in edi file for station pb25 2017-11-26T10:56:42 - Edi - INFO - Reading the edi file /Softlab/Githubz/mtpy/examples/data/edi_files/pb41c.edi 2017-11-26T10:56:42 - Edi - INFO - Could not find any Tipper data. 2017-11-26T10:56:42 - Edi - INFO - Read in edi file for station pb41 2017-11-26T10:56:42 - Edi - INFO - Reading the edi file /Softlab/Githubz/mtpy/examples/data/edi_files/pb30c.edi 2017-11-26T10:56:42 - Edi - INFO - Could not find any Tipper data. 2017-11-26T10:56:42 - Edi - INFO - Read in edi file for station pb30 2017-11-26T10:56:42 - Edi - INFO - Reading the edi file /Softlab/Githubz/mtpy/examples/data/edi_files/pb23c.edi 2017-11-26T10:56:42 - Edi - INFO - Could not find any Tipper data. 2017-11-26T10:56:42 - Edi - INFO - Read in edi file for station pb23 2017-11-26T10:56:42 - Edi - INFO - Reading the edi file /Softlab/Githubz/mtpy/examples/data/edi_files/pb33c.edi 2017-11-26T10:56:42 - Edi - INFO - Could not find any Tipper data. 2017-11-26T10:56:42 - Edi - INFO - Read in edi file for station pb33 2017-11-26T10:56:42 - Edi - INFO - Reading the edi file /Softlab/Githubz/mtpy/examples/data/edi_files/pb44c.edi 2017-11-26T10:56:42 - Edi - INFO - Could not find any Tipper data. 2017-11-26T10:56:42 - Edi - INFO - Read in edi file for station pb44 2017-11-26T10:56:42 - Edi - INFO - Reading the edi file /Softlab/Githubz/mtpy/examples/data/edi_files/pb27c.edi 2017-11-26T10:56:42 - Edi - INFO - Could not find any Tipper data. 2017-11-26T10:56:42 - Edi - INFO - Read in edi file for station pb27 2017-11-26T10:56:42 - Edi - INFO - Reading the edi file /Softlab/Githubz/mtpy/examples/data/edi_files/pb43c.edi 2017-11-26T10:56:42 - Edi - INFO - Could not find any Tipper data. 2017-11-26T10:56:42 - Edi - INFO - Read in edi file for station pb43 2017-11-26T10:56:42 - Edi - INFO - Reading the edi file /Softlab/Githubz/mtpy/examples/data/edi_files/pb29c.edi 2017-11-26T10:56:42 - Edi - INFO - Could not find any Tipper data. 2017-11-26T10:56:42 - Edi - INFO - Read in edi file for station pb29 2017-11-26T10:56:42 - Edi - INFO - Reading the edi file /Softlab/Githubz/mtpy/examples/data/edi_files/pb35c.edi 2017-11-26T10:56:42 - Edi - INFO - Could not find any Tipper data. 2017-11-26T10:56:42 - Edi - INFO - Read in edi file for station pb35 2017-11-26T10:56:42 - Edi - INFO - Reading the edi file /Softlab/Githubz/mtpy/examples/data/edi_files/pb42c.edi 2017-11-26T10:56:42 - Edi - INFO - Could not find any Tipper data. 2017-11-26T10:56:42 - Edi - INFO - Read in edi file for station pb42 2017-11-26T10:56:42 - Edi - INFO - Reading the edi file /Softlab/Githubz/mtpy/examples/data/edi_files/pb37c.edi 2017-11-26T10:56:42 - Edi - INFO - Could not find any Tipper data. 2017-11-26T10:56:42 - Edi - INFO - Read in edi file for station pb37 Should input a freq array to know which index of the PT array corresponds to which freq. Should input a freq array to know which index of the PT array corresponds to which freq. Should input a freq array to know which index of the PT array corresponds to which freq. Should input a freq array to know which index of the PT array corresponds to which freq. Should input a freq array to know which index of the PT array corresponds to which freq. Should input a freq array to know which index of the PT array corresponds to which freq. Should input a freq array to know which index of the PT array corresponds to which freq. Should input a freq array to know which index of the PT array corresponds to which freq. Should input a freq array to know which index of the PT array corresponds to which freq. Should input a freq array to know which index of the PT array corresponds to which freq. Should input a freq array to know which index of the PT array corresponds to which freq. Should input a freq array to know which index of the PT array corresponds to which freq. Should input a freq array to know which index of the PT array corresponds to which freq. Should input a freq array to know which index of the PT array corresponds to which freq. Should input a freq array to know which index of the PT array corresponds to which freq.

Rotated Z and Tipper to align with +7.00 degrees E of N Profile angle is +97.00 degrees E of N

= 39 failed, 7 passed, 18 skipped

YingzhiGou commented 6 years ago

@zhang01GA are these tests still failing in the latest version?

zhang01GA commented 6 years ago

Sorry. Still NOT resolved.

YingzhiGou commented 6 years ago

seems like scipy is raising an exception could you provide the package installed in the python environment? please paste the output of

pip freeze
geojunky commented 6 years ago

It looks like this has been fixed -- just ran the tests concerned; all passed.