@@ -409,8 +409,9 @@ def _nix_to_neo_analogsignal(self, nix_da_group):
409409
410410 if sig_length > 1 :
411411 for attr_key , attr_val in neo_attrs .items ():
412- if isinstance (attr_val , (list , np .ndarray )) or (
413- isinstance (attr_val , pq .Quantity ) and attr_val .shape == ()):
412+ if isinstance (attr_val , (list , np .ndarray , pq .Quantity )):
413+ if isinstance (attr_val , (np .ndarray , pq .Quantity )) and attr_val .shape == ():
414+ attr_val = attr_val .flatten ()
414415 if len (attr_val ) == sig_length :
415416 if isinstance (attr_val , list ) or (isinstance (attr_val , np .ndarray ) and not (
416417 isinstance (attr_val , pq .Quantity ) and (
@@ -467,8 +468,9 @@ def _nix_to_neo_irregularlysampledsignal(self, nix_da_group):
467468
468469 if sig_length > 1 :
469470 for attr_key , attr_val in neo_attrs .items ():
470- if isinstance (attr_val , (list , np .ndarray )) or (
471- isinstance (attr_val , pq .Quantity ) and attr_val .shape == ()):
471+ if isinstance (attr_val , (list , np .ndarray , pq .Quantity )):
472+ if isinstance (attr_val , (np .ndarray , pq .Quantity )) and attr_val .shape == ():
473+ attr_val = attr_val .flatten ()
472474 if len (attr_val ) == sig_length :
473475 if isinstance (attr_val , list ) or (isinstance (attr_val , np .ndarray ) and not (
474476 isinstance (attr_val , pq .Quantity ) and (
@@ -512,8 +514,9 @@ def _nix_to_neo_event(self, nix_mtag):
512514
513515 if sig_length > 1 :
514516 for attr_key , attr_val in neo_attrs .items ():
515- if isinstance (attr_val , (list , np .ndarray )) or (
516- isinstance (attr_val , pq .Quantity ) and attr_val .shape == ()):
517+ if isinstance (attr_val , (list , np .ndarray , pq .Quantity )):
518+ if isinstance (attr_val , (np .ndarray , pq .Quantity )) and attr_val .shape == ():
519+ attr_val = attr_val .flatten ()
517520 if len (attr_val ) == sig_length :
518521 if isinstance (attr_val , list ) or (isinstance (attr_val , np .ndarray ) and not (
519522 isinstance (attr_val , pq .Quantity ) and (
@@ -550,8 +553,9 @@ def _nix_to_neo_epoch(self, nix_mtag):
550553
551554 if sig_length > 1 :
552555 for attr_key , attr_val in neo_attrs .items ():
553- if isinstance (attr_val , (list , np .ndarray )) or (
554- isinstance (attr_val , pq .Quantity ) and attr_val .shape == ()):
556+ if isinstance (attr_val , (list , np .ndarray , pq .Quantity )):
557+ if isinstance (attr_val , (np .ndarray , pq .Quantity )) and attr_val .shape == ():
558+ attr_val = attr_val .flatten ()
555559 if len (attr_val ) == sig_length :
556560 if isinstance (attr_val , list ) or (isinstance (attr_val , np .ndarray ) and not (
557561 isinstance (attr_val , pq .Quantity ) and (
@@ -591,8 +595,9 @@ def _nix_to_neo_spiketrain(self, nix_mtag):
591595
592596 if sig_length > 1 :
593597 for attr_key , attr_val in neo_attrs .items ():
594- if isinstance (attr_val , (list , np .ndarray )) or (
595- isinstance (attr_val , pq .Quantity ) and attr_val .shape == ()):
598+ if isinstance (attr_val , (list , np .ndarray , pq .Quantity )):
599+ if isinstance (attr_val , (np .ndarray , pq .Quantity )) and attr_val .shape == ():
600+ attr_val = attr_val .flatten ()
596601 if len (attr_val ) == sig_length :
597602 if isinstance (attr_val , list ) or (isinstance (attr_val , np .ndarray ) and not (
598603 isinstance (attr_val , pq .Quantity ) and (
0 commit comments