Skip to content

Commit b18147b

Browse files
committed
ENH: Add CaretMetaData._sanitize static method to focus warning code
1 parent ee6c5a0 commit b18147b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

nibabel/caret.py

+7
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,15 @@ class CaretMetaData(xml.XmlSerializable, MutableMapping):
4545
b'<MetaData><MD><Name>key</Name><Value>val</Value></MD></MetaData>'
4646
"""
4747
def __init__(self, *args, **kwargs):
48+
args, kwargs = self._sanitize(args, kwargs)
4849
self._data = dict(*args, **kwargs)
4950

51+
@staticmethod
52+
def _sanitize(args, kwargs):
53+
""" Override in subclasses to accept and warn on previous invocations
54+
"""
55+
return args, kwargs
56+
5057
def __getitem__(self, key):
5158
""" Get metadata entry by name
5259

0 commit comments

Comments
 (0)