From c3272f7776ddd7bd452ac23a8f4ba2f9f70b2f97 Mon Sep 17 00:00:00 2001 From: Joseph Weston <joseph@weston.cloud> Date: Wed, 21 Aug 2019 12:20:15 +0200 Subject: [PATCH] deprecate not specfiying 'norbs' when creating site families --- kwant/builder.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kwant/builder.py b/kwant/builder.py index 89ec7c24..b31edc6b 100644 --- a/kwant/builder.py +++ b/kwant/builder.py @@ -140,6 +140,10 @@ class SiteFamily(metaclass=abc.ABCMeta): self.canonical_repr = canonical_repr self.hash = hash(canonical_repr) self.name = name + if norbs is None: + warnings.warn("Not specfying norbs is deprecated. Always specify " + "norbs when creating site families.", + KwantDeprecationWarning, stacklevel=3) if norbs is not None: if int(norbs) != norbs or norbs <= 0: raise ValueError('The norbs parameter must be an integer > 0.') -- GitLab