Skip to content

Commit

Permalink
Update setup in test_sur_error.py
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrovma committed Jun 24, 2024
1 parent accbf6b commit 440d686
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions spreg/tests/test_sur_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
import numpy as np
import libpysal
from libpysal.examples import load_example
from ..sur_utils import sur_dictxy
from ..sur_error import SURerrorML, SURerrorGM
from .test_sur import dict_compare
from spreg.sur_utils import sur_dictxy
from spreg.sur_error import SURerrorML, SURerrorGM
from libpysal.common import RTOL

ATOL = 0.0001

def dict_compare(actual, desired, rtol, atol=1e-7):
for i in actual.keys():
np.testing.assert_allclose(actual[i], desired[i], rtol, atol=atol)

class Test_SUR_error(unittest.TestCase):
def setUp(self):
Expand Down Expand Up @@ -316,9 +318,7 @@ class Test_SUR_error_gm(unittest.TestCase):
def setUp(self):
nat = load_example("Natregimes")
self.db = libpysal.io.open(nat.get_path("natregimes.dbf"), "r")
self.w = libpysal.weights.Queen.from_shapefile(
libpysal.examples.get_path("natregimes.shp")
)
self.w = libpysal.weights.Queen.from_shapefile(nat.get_path("natregimes.shp"))
self.w.transform = "r"

def test_error_gm(self): # 2 equations
Expand Down

0 comments on commit 440d686

Please sign in to comment.