@@ -183,7 +183,7 @@ def test_server_detect_file_format_from_magic(tmp_path: Path) -> None:
183183def test_loopback_proxy_round_trip () -> None :
184184 connection = _start_loopback_server (ServerStub )
185185 session = connection [0 ]
186- data_path = str (Path (__file__ ).parent / "data" / "test1.nc" )
186+ data_path = str (Path (__file__ ).parents [ 2 ] / "p5rem" / "tests" / "data" / "test1.nc" )
187187 try :
188188 with session .open (data_path ) as proxy :
189189 assert "tas" in proxy .keys ()
@@ -228,7 +228,7 @@ def test_loopback_proxy_round_trip() -> None:
228228def test_loopback_get_chunk_recovers_when_server_loses_file_state () -> None :
229229 connection = _start_loopback_server (DropFileStateBeforeGetChunkServer )
230230 session = connection [0 ]
231- data_path = str (Path (__file__ ).parent / "data" / "contiguous_eg.nc" )
231+ data_path = str (Path (__file__ ).parents [ 2 ] / "p5rem" / "tests" / "data" / "contiguous_eg.nc" )
232232 try :
233233 with session .open (data_path ) as proxy :
234234 q = proxy ["q" ]
@@ -241,7 +241,7 @@ def test_loopback_get_chunk_recovers_when_server_loses_file_state() -> None:
241241def test_loopback_get_chunks_recovers_when_server_loses_file_state () -> None :
242242 connection = _start_loopback_server (DropFileStateBeforeGetChunksServer )
243243 session = connection [0 ]
244- data_path = str (Path (__file__ ).parent / "data" / "test1.nc" )
244+ data_path = str (Path (__file__ ).parents [ 2 ] / "p5rem" / "tests" / "data" / "test1.nc" )
245245 try :
246246 with session .open (data_path ) as proxy :
247247 tas = proxy ["tas" ]
@@ -254,7 +254,7 @@ def test_loopback_get_chunks_recovers_when_server_loses_file_state() -> None:
254254def test_loopback_reduce_recovers_when_server_loses_file_state () -> None :
255255 connection = _start_loopback_server (DropFileStateBeforeReduceServer )
256256 session = connection [0 ]
257- data_path = str (Path (__file__ ).parent / "data" / "test1.nc" )
257+ data_path = str (Path (__file__ ).parents [ 2 ] / "p5rem" / "tests" / "data" / "test1.nc" )
258258 try :
259259 session .file_open (data_path )
260260 response = session .reduce_selection (
@@ -272,7 +272,7 @@ def test_loopback_reduce_recovers_when_server_loses_file_state() -> None:
272272def test_contiguous_file_data_and_coordinates_round_trip () -> None :
273273 connection = _start_loopback_server (ServerStub )
274274 session = connection [0 ]
275- data_path = str (Path (__file__ ).parent / "data" / "contiguous_eg.nc" )
275+ data_path = str (Path (__file__ ).parents [ 2 ] / "p5rem" / "tests" / "data" / "contiguous_eg.nc" )
276276 try :
277277 with session .open (data_path ) as proxy :
278278 ref_file = pyfive .File (data_path )
@@ -310,7 +310,7 @@ def test_contiguous_file_data_and_coordinates_round_trip() -> None:
310310def test_enum_file_round_trip () -> None :
311311 connection = _start_loopback_server (ServerStub )
312312 session = connection [0 ]
313- data_path = str (Path (__file__ ).parent / "data" / "enum_variable.nc" )
313+ data_path = str (Path (__file__ ).parents [ 2 ] / "p5rem" / "tests" / "data" / "enum_variable.nc" )
314314 try :
315315 with session .open (data_path ) as proxy :
316316 ref_file = pyfive .File (data_path )
@@ -341,7 +341,7 @@ def test_enum_file_round_trip() -> None:
341341def test_loopback_shared_roundtrip_assertions (filename : str ) -> None :
342342 connection = _start_loopback_server (ServerStub )
343343 session = connection [0 ]
344- data_path = Path (__file__ ).parent / "data" / filename
344+ data_path = Path (__file__ ).parents [ 2 ] / "p5rem" / "tests" / "data" / filename
345345 try :
346346 assert_roundtrip_file_matches (session , data_path , str (data_path ))
347347 finally :
@@ -371,7 +371,7 @@ def test_unexpected_response_type_raises() -> None:
371371def test_real_server_var_open_includes_rich_metadata () -> None :
372372 connection = _start_loopback_server (ServerStub )
373373 session = connection [0 ]
374- data_path = Path (__file__ ).parent / "data" / "test1.nc"
374+ data_path = Path (__file__ ).parents [ 2 ] / "p5rem" / "tests" / "data" / "test1.nc"
375375 try :
376376 file_info = session .file_open (str (data_path ))
377377 assert "tas" in file_info ["keys" ]
@@ -421,7 +421,7 @@ def __getitem__(self, key: str) -> FakeDataset:
421421 def close (self ) -> None :
422422 self .closed = True
423423
424- data_path = Path (__file__ ).parent / "data" / "test1.nc"
424+ data_path = Path (__file__ ).parents [ 2 ] / "p5rem" / "tests" / "data" / "test1.nc"
425425 first_file = FakeFile ("old_var" , FakeDataset ("old_var" , 1 ))
426426 second_file = FakeFile ("new_var" , FakeDataset ("new_var" , 2 ))
427427 opened_files = iter ([first_file , second_file ])
@@ -465,7 +465,7 @@ def test_get_dataset_rejects_stale_cache_when_file_not_open() -> None:
465465def test_real_server_get_chunk_for_chunked_and_contiguous () -> None :
466466 connection = _start_loopback_server (ServerStub )
467467 session = connection [0 ]
468- data_path = Path (__file__ ).parent / "data" / "test1.nc"
468+ data_path = Path (__file__ ).parents [ 2 ] / "p5rem" / "tests" / "data" / "test1.nc"
469469 try :
470470 session .file_open (str (data_path ))
471471
@@ -504,7 +504,7 @@ def test_real_server_get_chunk_for_chunked_and_contiguous() -> None:
504504def test_real_server_reduce_supports_selection_and_chunk_modes () -> None :
505505 connection = _start_loopback_server (ServerStub )
506506 session = connection [0 ]
507- data_path = Path (__file__ ).parent / "data" / "contiguous_eg.nc"
507+ data_path = Path (__file__ ).parents [ 2 ] / "p5rem" / "tests" / "data" / "contiguous_eg.nc"
508508 try :
509509 session .file_open (str (data_path ))
510510
@@ -543,7 +543,7 @@ def test_real_server_reduce_supports_selection_and_chunk_modes() -> None:
543543def test_real_server_reduce_selection_parallel_full_dataset () -> None :
544544 connection = _start_loopback_server (ServerStub )
545545 session = connection [0 ]
546- data_path = Path (__file__ ).parent / "data" / "test1.nc"
546+ data_path = Path (__file__ ).parents [ 2 ] / "p5rem" / "tests" / "data" / "test1.nc"
547547 try :
548548 session .file_open (str (data_path ))
549549 response = session .reduce_selection (
@@ -568,7 +568,7 @@ def test_real_server_reduce_selection_parallel_full_dataset() -> None:
568568def test_real_server_reduce_selection_parallel_partial_selection () -> None :
569569 connection = _start_loopback_server (ServerStub )
570570 session = connection [0 ]
571- data_path = Path (__file__ ).parent / "data" / "test1.nc"
571+ data_path = Path (__file__ ).parents [ 2 ] / "p5rem" / "tests" / "data" / "test1.nc"
572572 try :
573573 session .file_open (str (data_path ))
574574 response = session .reduce_selection (
@@ -597,7 +597,7 @@ def test_real_server_reduce_selection_parallel_partial_selection() -> None:
597597def test_real_server_reduce_selection_chunk_planned_with_single_thread () -> None :
598598 connection = _start_loopback_server (ServerStub )
599599 session = connection [0 ]
600- data_path = Path (__file__ ).parent / "data" / "test1.nc"
600+ data_path = Path (__file__ ).parents [ 2 ] / "p5rem" / "tests" / "data" / "test1.nc"
601601 try :
602602 session .file_open (str (data_path ))
603603 response = session .reduce_selection (
@@ -639,7 +639,7 @@ def test_real_server_reduce_selection_chunk_planned_with_single_thread() -> None
639639def test_reduce_selection_chunked_all_operations_full_dataset (operation , ref_fn ) -> None :
640640 connection = _start_loopback_server (ServerStub )
641641 session = connection [0 ]
642- data_path = Path (__file__ ).parent / "data" / "test1.nc"
642+ data_path = Path (__file__ ).parents [ 2 ] / "p5rem" / "tests" / "data" / "test1.nc"
643643 try :
644644 session .file_open (str (data_path ))
645645 response = session .reduce_selection (str (data_path ), "tas" , operation , selection = None , thread_count = 4 )
@@ -670,7 +670,7 @@ def test_reduce_selection_chunked_all_operations_full_dataset(operation, ref_fn)
670670def test_reduce_selection_chunked_all_operations_partial_selection (operation , ref_fn ) -> None :
671671 connection = _start_loopback_server (ServerStub )
672672 session = connection [0 ]
673- data_path = Path (__file__ ).parent / "data" / "test1.nc"
673+ data_path = Path (__file__ ).parents [ 2 ] / "p5rem" / "tests" / "data" / "test1.nc"
674674 sel = [
675675 {"type" : "slice" , "start" : 2 , "stop" : 10 , "step" : 1 },
676676 {"type" : "slice" , "start" : 10 , "stop" : 50 , "step" : 1 },
@@ -707,7 +707,7 @@ def test_reduce_selection_chunked_all_operations_partial_selection(operation, re
707707def test_reduce_selection_contiguous_all_operations_full_dataset (operation , ref_fn ) -> None :
708708 connection = _start_loopback_server (ServerStub )
709709 session = connection [0 ]
710- data_path = Path (__file__ ).parent / "data" / "contiguous_eg.nc"
710+ data_path = Path (__file__ ).parents [ 2 ] / "p5rem" / "tests" / "data" / "contiguous_eg.nc"
711711 try :
712712 session .file_open (str (data_path ))
713713 response = session .reduce_selection (str (data_path ), "q" , operation , selection = None )
@@ -730,7 +730,7 @@ def test_reduce_selection_contiguous_all_operations_full_dataset(operation, ref_
730730def test_reduce_chunk_on_chunked_variable () -> None :
731731 connection = _start_loopback_server (ServerStub )
732732 session = connection [0 ]
733- data_path = Path (__file__ ).parent / "data" / "test1.nc"
733+ data_path = Path (__file__ ).parents [ 2 ] / "p5rem" / "tests" / "data" / "test1.nc"
734734 try :
735735 session .file_open (str (data_path ))
736736 meta = session .var_open (str (data_path ), "tas" )
@@ -754,7 +754,7 @@ def test_reduce_chunk_on_chunked_variable() -> None:
754754def test_reduce_chunk_on_contiguous_variable () -> None :
755755 connection = _start_loopback_server (ServerStub )
756756 session = connection [0 ]
757- data_path = Path (__file__ ).parent / "data" / "contiguous_eg.nc"
757+ data_path = Path (__file__ ).parents [ 2 ] / "p5rem" / "tests" / "data" / "contiguous_eg.nc"
758758 try :
759759 session .file_open (str (data_path ))
760760 meta = session .var_open (str (data_path ), "q" )
@@ -791,7 +791,7 @@ def test_reduce_chunk_on_contiguous_variable() -> None:
791791def test_reduce_selection_unknown_operation_chunked_raises () -> None :
792792 connection = _start_loopback_server (ServerStub )
793793 session = connection [0 ]
794- data_path = Path (__file__ ).parent / "data" / "test1.nc"
794+ data_path = Path (__file__ ).parents [ 2 ] / "p5rem" / "tests" / "data" / "test1.nc"
795795 try :
796796 session .file_open (str (data_path ))
797797 with pytest .raises (ResponseError , match = "unsupported reduction operation" ):
@@ -807,7 +807,7 @@ def test_reduce_selection_unknown_operation_chunked_raises() -> None:
807807def test_reduce_selection_thread_count_exceeds_chunk_count () -> None :
808808 connection = _start_loopback_server (ServerStub )
809809 session = connection [0 ]
810- data_path = Path (__file__ ).parent / "data" / "test1.nc"
810+ data_path = Path (__file__ ).parents [ 2 ] / "p5rem" / "tests" / "data" / "test1.nc"
811811 try :
812812 session .file_open (str (data_path ))
813813 # A 1-timestep selection hits at most a handful of chunks; use 1000 workers.
0 commit comments