Skip to content

Commit ec222e2

Browse files
committed
Fix lazy modelcontext import flagged by ruff
1 parent 49c0db9 commit ec222e2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pymc/distributions/shape_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
from pytensor.tensor.type_other import NoneTypeT
3434
from pytensor.tensor.variable import TensorVariable
3535

36-
#from pymc.model import modelcontext
36+
# from pymc.model import modelcontext
3737
from pymc.pytensorf import convert_observed_data
3838

3939
__all__ = [
@@ -415,6 +415,8 @@ def get_support_shape(
415415
assert isinstance(dims, tuple)
416416
if len(dims) < ndim_supp:
417417
raise ValueError(f"Number of dims is too small for ndim_supp of {ndim_supp}")
418+
from pymc.model.core import modelcontext
419+
418420
model = modelcontext(None)
419421
inferred_support_shape = [
420422
model.dim_lengths[dims[i]] - support_shape_offset[i] for i in range(-ndim_supp, 0)

0 commit comments

Comments
 (0)