diff --git a/tofu/imas2tofu/_core.py b/tofu/imas2tofu/_core.py index 44440a544..da640dc47 100644 --- a/tofu/imas2tofu/_core.py +++ b/tofu/imas2tofu/_core.py @@ -2699,7 +2699,14 @@ def _to_Cam_Du(self, ids, lk, indch, nan=None, pos=None): u = np.array([oo[:,1,0]*np.cos(oo[:,1,2]), oo[:,1,0]*np.sin(oo[:,1,2]), oo[:,1,1]]) u = (u-D) / np.sqrt(np.sum((u-D)**2, axis=0))[None,:] - dgeom = (D,u) + dgeom = (D, u) + indnan = np.any(np.isnan(D), axis=0) | np.any(np.isnan(u), axis=0) + if np.any(indnan): + nunav, ntot = str(indnan.sum()), str(D.shape[1]) + msg = "Some lines of sight geometry unavailable in ids:\n" + msg += " - unavailable LOS: {0} / {1}\n".format(nunav, ntot) + msg += " - indices: {0}".format(str(indnan.nonzero()[0])) + warnings.warn(msg) else: dgeom = None @@ -2935,6 +2942,7 @@ def to_Data(self, ids=None, dsig=None, data=None, X=None, tlim=None, dchans=dchans) cam.Id.set_dUSR( {'imas-nchMax': nchMax} ) + # ----------------------- # data lk = sorted(dsig.keys()) diff --git a/tofu/utils.py b/tofu/utils.py index 9b78bde8b..38a54167a 100644 --- a/tofu/utils.py +++ b/tofu/utils.py @@ -1451,11 +1451,13 @@ def _get_summary(cls, lar, lcol, # pass def __repr__(self): - if hasattr(self, 'get_summary'): - return self.get_summary(return_='msg', verb=False) - else: - return object.__repr__(self) - + try: + if hasattr(self, 'get_summary'): + return self.get_summary(return_='msg', verb=False) + else: + return object.__repr__(self) + except Exception: + return self.__class__.__name__ ############################# # strip and to/from dict diff --git a/tofu/version.py b/tofu/version.py index 9b4e6a6dc..3a178e146 100644 --- a/tofu/version.py +++ b/tofu/version.py @@ -1,2 +1,2 @@ # Do not edit, pipeline versioning governed by git tags! -__version__ = '1.4.1-177-g5b98902' +__version__ = '1.4.1-190-gd25622d'