From 08e6fcc301d07d297dc32c61e581c8f91c1599bd Mon Sep 17 00:00:00 2001 From: Marco De Donno Date: Thu, 13 Sep 2018 16:52:52 +0200 Subject: [PATCH] Patch the get_ntype() function to avoid empty ntypes --- NIST/core/__init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/NIST/core/__init__.py b/NIST/core/__init__.py index 38eaddc..4954866 100644 --- a/NIST/core/__init__.py +++ b/NIST/core/__init__.py @@ -1013,7 +1013,13 @@ class NIST( object ): >>> n.get_ntype() [1, 2] """ - return sorted( self.data.keys() ) + lst = [] + + for ntype in sorted( self.data.keys() ): + if( len( self.data[ ntype ] ) ): + lst.append( ntype ) + + return lst def get_idc( self, ntype ): """ -- GitLab