From e0be5e2067071e410762689e9a493b58196d1a03 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Tue, 10 Sep 2019 22:01:04 -0500 Subject: [PATCH] Stop causing DeprecationWarning about across_dim_types in align_two --- islpy/__init__.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/islpy/__init__.py b/islpy/__init__.py index d034c56..21ef797 100644 --- a/islpy/__init__.py +++ b/islpy/__init__.py @@ -1221,16 +1221,20 @@ def align_spaces(obj, tgt, obj_bigger_ok=False, across_dim_types=None): return obj -def align_two(obj1, obj2, across_dim_types=False): +def align_two(obj1, obj2, across_dim_types=None): """Align the spaces of two objects, potentially modifying both of them. See also :func:`align_spaces`. """ - obj1 = align_spaces(obj1, obj2, obj_bigger_ok=True, - across_dim_types=across_dim_types) - obj2 = align_spaces(obj2, obj1, obj_bigger_ok=True, - across_dim_types=across_dim_types) + if across_dim_types is not None: + from warnings import warn + warn("across_dim_types is deprecated and should no longer be used. " + "It never had any effect anyway.", + DeprecationWarning, stacklevel=2) + + obj1 = align_spaces(obj1, obj2, obj_bigger_ok=True) + obj2 = align_spaces(obj2, obj1, obj_bigger_ok=True) return (obj1, obj2) -- GitLab