pysal / spreg

Spatial econometric regression in Python
https://pysal.org/spreg/
Other
66 stars 23 forks source link

Fixing failed tests for new release #105

Closed pedrovma closed 1 year ago

jGaboardi commented 1 year ago

Failure due to numpy.linalg.LinAlgError. And it is affecting Windows Py310.

self = <spreg.tests.test_panel_re.Test_Panel_RE_Error testMethod=test_Panel>
    def test_Panel(self):
>       reg = Panel_RE_Error(
            self.y,
            self.x,
            w=self.w,
            name_y=self.y_name,
            name_x=self.x_names,
            name_ds=self.ds_name,
        )

spreg\tests\test_panel_re.py:104: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
spreg\panel_re.py:754: in __init__
    BasePanel_RE_Error.__init__(self, bigy, bigx, w, epsilon=epsilon)
spreg\panel_re.py:597: in __init__
    vm1 = np.linalg.inv(v)
<__array_function__ internals>:180: in inv
    ???
C:\Users\runneradmin\micromamba-root\envs\test\lib\site-packages\numpy\linalg\linalg.py:552: in inv
    ainv = _umath_linalg.inv(a, signature=signature, extobj=extobj)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

err = 'invalid value', flag = 8

    def _raise_linalgerror_singular(err, flag):
>       raise LinAlgError("Singular matrix")
E       numpy.linalg.LinAlgError: Singular matrix
jGaboardi commented 1 year ago

Also, the error seems familiar. I've seen it recently, but can't remember where...

jGaboardi commented 1 year ago

It's actually here in #56.

pedrovma commented 1 year ago

Any idea why it passed on #99 and suddenly returned?

jGaboardi commented 1 year ago

No idea at all for now. Trying rerunning now.

pedrovma commented 1 year ago

I tried, but can't replicate the error. I will omit these tests for now until we find out what is going on.

jGaboardi commented 1 year ago

error also here: #87