diff --git a/pyomo/contrib/mindtpy/tests/MINLP_simple_grey_box.py b/pyomo/contrib/mindtpy/tests/MINLP_simple_grey_box.py index 00b78e7b89f..186db3bb5a2 100644 --- a/pyomo/contrib/mindtpy/tests/MINLP_simple_grey_box.py +++ b/pyomo/contrib/mindtpy/tests/MINLP_simple_grey_box.py @@ -1,5 +1,5 @@ from pyomo.common.dependencies import numpy as np -from pyomo.common.dependencies.scipy.sparse import coo_matrix +import pyomo.common.dependencies.scipy.sparse as scipy_sparse from pyomo.contrib.pynumero.interfaces.external_grey_box import ExternalGreyBoxModel from pyomo.contrib.pynumero.interfaces.external_grey_box import ExternalGreyBoxBlock @@ -135,4 +135,4 @@ def evaluate_jacobian_outputs(self): row[0], col[4], data[4] = (0, 4, 0.5) # y3 # sparse matrix - return coo_matrix((data, (row, col)), shape=(1, 5)) + return scipy_sparse.coo_matrix((data, (row, col)), shape=(1, 5)) diff --git a/pyomo/contrib/pynumero/interfaces/external_grey_box.py b/pyomo/contrib/pynumero/interfaces/external_grey_box.py index 1594098069c..8fd728a7c9b 100644 --- a/pyomo/contrib/pynumero/interfaces/external_grey_box.py +++ b/pyomo/contrib/pynumero/interfaces/external_grey_box.py @@ -11,8 +11,8 @@ import abc import logging -from pyomo.common.dependencies import numpy as np -from pyomo.common.dependencies.scipy.sparse import coo_matrix +import numpy as np +from scipy.sparse import coo_matrix from pyomo.common.deprecation import RenamedClass from pyomo.common.log import is_debug_set