mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-15 03:53:41 +02:00
feat: check for name doublers in Obs.__init__ optimized
This commit is contained in:
parent
12a93eafb0
commit
7937635ca2
1 changed files with 4 additions and 2 deletions
|
@ -74,8 +74,10 @@ class Obs:
|
||||||
if idl is not None:
|
if idl is not None:
|
||||||
if len(idl) != len(names):
|
if len(idl) != len(names):
|
||||||
raise Exception('Length of idl incompatible with samples and names.')
|
raise Exception('Length of idl incompatible with samples and names.')
|
||||||
if len(names) != len(set(names)):
|
name_length = len(names)
|
||||||
raise Exception('names are not unique.')
|
if name_length > 1:
|
||||||
|
if name_length != len(set(names)):
|
||||||
|
raise Exception('names are not unique.')
|
||||||
if not all(isinstance(x, str) for x in names):
|
if not all(isinstance(x, str) for x in names):
|
||||||
raise TypeError('All names have to be strings.')
|
raise TypeError('All names have to be strings.')
|
||||||
if min(len(x) for x in samples) <= 4:
|
if min(len(x) for x in samples) <= 4:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue