Beispiel #1
0
 def test_arrange_along_xyt(self, create_filepaths):
     paths = create_filepaths(nxpe=3, nype=2, nt=2)
     expected_path_grid = [
         [
             [
                 "./run0/BOUT.dmp.0.nc",
                 "./run0/BOUT.dmp.1.nc",
                 "./run0/BOUT.dmp.2.nc",
             ],
             [
                 "./run0/BOUT.dmp.3.nc",
                 "./run0/BOUT.dmp.4.nc",
                 "./run0/BOUT.dmp.5.nc",
             ],
         ],
         [
             [
                 "./run1/BOUT.dmp.0.nc",
                 "./run1/BOUT.dmp.1.nc",
                 "./run1/BOUT.dmp.2.nc",
             ],
             [
                 "./run1/BOUT.dmp.3.nc",
                 "./run1/BOUT.dmp.4.nc",
                 "./run1/BOUT.dmp.5.nc",
             ],
         ],
     ]
     actual_path_grid, actual_concat_dims = _arrange_for_concatenation(
         paths, nxpe=3, nype=2)
     assert expected_path_grid == actual_path_grid
     assert actual_concat_dims == ["t", "y", "x"]
Beispiel #2
0
 def test_arrange_single(self, create_filepaths):
     paths = create_filepaths(nxpe=1, nype=1, nt=1)
     expected_path_grid = [[["./run0/BOUT.dmp.0.nc"]]]
     actual_path_grid, actual_concat_dims = _arrange_for_concatenation(
         paths, nxpe=1, nype=1)
     assert expected_path_grid == actual_path_grid
     assert actual_concat_dims == [None, None, None]
Beispiel #3
0
 def test_arrange_along_xt(self, create_filepaths):
     paths = create_filepaths(nxpe=3, nype=1, nt=2)
     expected_path_grid = [[['./run0/BOUT.dmp.0.nc', './run0/BOUT.dmp.1.nc', './run0/BOUT.dmp.2.nc']],
                           [['./run1/BOUT.dmp.0.nc', './run1/BOUT.dmp.1.nc', './run1/BOUT.dmp.2.nc']]]
     actual_path_grid, actual_concat_dims = _arrange_for_concatenation(
         paths, nxpe=3, nype=1)
     assert expected_path_grid == actual_path_grid
     assert actual_concat_dims == ['t', None, 'x']
Beispiel #4
0
 def test_arrange_along_t(self, create_filepaths):
     paths = create_filepaths(nxpe=1, nype=1, nt=3)
     expected_path_grid = [
         [["./run0/BOUT.dmp.0.nc"]],
         [["./run1/BOUT.dmp.0.nc"]],
         [["./run2/BOUT.dmp.0.nc"]],
     ]
     actual_path_grid, actual_concat_dims = _arrange_for_concatenation(
         paths, nxpe=1, nype=1)
     assert expected_path_grid == actual_path_grid
     assert actual_concat_dims == ["t", None, None]
Beispiel #5
0
 def test_arrange_along_y(self, create_filepaths):
     paths = create_filepaths(nxpe=1, nype=3, nt=1)
     expected_path_grid = [[
         ["./run0/BOUT.dmp.0.nc"],
         ["./run0/BOUT.dmp.1.nc"],
         ["./run0/BOUT.dmp.2.nc"],
     ]]
     actual_path_grid, actual_concat_dims = _arrange_for_concatenation(
         paths, nxpe=1, nype=3)
     assert expected_path_grid == actual_path_grid
     assert actual_concat_dims == [None, "y", None]