From 7225fd57154e17e8defc666efc75b08bd6c16a2f Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Mon, 8 Mar 2021 17:04:38 -0800 Subject: [PATCH] add traceback to port type warnings --- masque/builder/devices.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/masque/builder/devices.py b/masque/builder/devices.py index 519462f..8f82e32 100644 --- a/masque/builder/devices.py +++ b/masque/builder/devices.py @@ -1,6 +1,7 @@ from typing import Dict, Iterable, List, Tuple, Union, TypeVar, Any, Iterator, Optional, Sequence import copy import warnings +import traceback import logging from collections import Counter @@ -620,6 +621,7 @@ class Device(Copyable, Mirrorable): for nn, (k, v) in enumerate(map_in.items()): if type_conflicts[nn]: msg += f'{k} | {s_types[nn]:g}:{o_types[nn]:g} | {v}\n' + msg = ''.join(traceback.format_stack()) + '\n' + msg warnings.warn(msg, stacklevel=2) rotations = numpy.mod(s_rotations - o_rotations - pi, 2 * pi)