File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 1919import pynwb
2020import yaml
2121from tqdm import tqdm
22+ from natsort import natsorted
2223
2324from . import available_checks
2425from .inspector_tools import (
@@ -379,7 +380,7 @@ def inspect_all(
379380 yield InspectorMessage (
380381 message = (
381382 f"The identifier '{ identifier } ' is used across the .nwb files: "
382- f"{ [ str ( x ) for x in nwbfiles_with_identifier ]} \n "
383+ f"{ natsorted ([ x . name for x in nwbfiles_with_identifier ]) } . "
383384 "The identifier of any NWBFile should be a completely unique value - "
384385 "we recommend using uuid4 to achieve this."
385386 ),
@@ -388,7 +389,7 @@ def inspect_all(
388389 object_type = "NWBFile" ,
389390 object_name = "root" ,
390391 location = "/" ,
391- file_path = str (Path ( nwbfiles_with_identifier [0 ]) .parent ),
392+ file_path = str (nwbfiles_with_identifier [0 ].parent ),
392393 )
393394
394395 nwbfiles_iterable = nwbfiles
Original file line number Diff line number Diff line change 1111from pynwb .file import TimeIntervals
1212from pynwb .behavior import SpatialSeries , Position
1313from hdmf .common import DynamicTable
14+ from natsort import natsorted
1415
1516from nwbinspector import (
1617 Importance ,
@@ -617,12 +618,11 @@ def tearDownClass(cls):
617618 rmtree (cls .tempdir )
618619
619620 def test_check_unique_identifiers_fail (self ):
620- print (list (inspect_all (path = self .tempdir , select = ["check_data_orientation" ])))
621621 assert list (inspect_all (path = self .tempdir , select = ["check_data_orientation" ])) == [
622622 InspectorMessage (
623623 message = (
624624 "The identifier 'not a unique identifier!' is used across the .nwb files: "
625- f"{ [ str (x ) for x in self .non_unique_id_nwbfile_paths ]} \n "
625+ f"{ natsorted ([ Path (x ). name for x in self .non_unique_id_nwbfile_paths ]) } . "
626626 "The identifier of any NWBFile should be a completely unique value - "
627627 "we recommend using uuid4 to achieve this."
628628 ),
@@ -631,6 +631,6 @@ def test_check_unique_identifiers_fail(self):
631631 object_type = "NWBFile" ,
632632 object_name = "root" ,
633633 location = "/" ,
634- file_path = str (Path ( self .non_unique_id_nwbfile_paths [ 0 ]). parent ),
634+ file_path = str (self .tempdir ),
635635 )
636636 ]
You can’t perform that action at this time.
0 commit comments