Skip to content

Commit

Permalink
added OpenPOMD dataset batman bo4 file and updated test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
krishivbhatia committed Nov 19, 2023
1 parent 92b3050 commit f9e1e7f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
Binary file added tests/grid_functions/batman.it00000000.bp4/data.0
Binary file not shown.
Binary file added tests/grid_functions/batman.it00000000.bp4/md.0
Binary file not shown.
Binary file added tests/grid_functions/batman.it00000000.bp4/md.idx
Binary file not shown.
3 changes: 3 additions & 0 deletions tests/grid_functions/batman.it00000000.bp4/profiling.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[
{ "rank": 0, "start": "Tue_Nov_14_12:09:49_2023", "threads": 1, "bytes": 8458128, "mkdir_mus": 409, "aggregation_mus": 0, "meta_sort_merge_mus": 156, "minmax_mus": 0, "memcpy_mus": 1047, "buffering_mus": 5984, "transport_0": { "type": "File_POSIX", "close_mus": 144, "write_mus": 4847, "open_mus": 8134}, "transport_1": { "type": "File_POSIX", "close_mus": 0, "write_mus": 216, "open_mus": 7255} }
]
15 changes: 8 additions & 7 deletions tests/test_cactus_grid_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def test_contains(self):

def test_contains_OpenPMDVars(self):
vars3D = self.gd.xyz
self.assertIn("admbasex_alp", vars3D)
self.assertIn('wavetoyx_u', vars3D)

def test__getitem(self):
self.assertIs(self.gd["xy"], self.gd._all_griddata[(0, 1)])
Expand Down Expand Up @@ -536,12 +536,8 @@ def test__init(self):
# Here we can we find all the variables
self.assertCountEqual(
list(self.gf._vars_openpmd_files.keys()),
['admbasex_alp', 'admbasex_kxx', 'admbasex_kxy', 'admbasex_kxz', 'admbasex_kyy',
'admbasex_kyz', 'admbasex_kzz', 'admbasex_gxx', 'admbasex_gxy', 'admbasex_gxz',
'admbasex_gyy', 'admbasex_gyz', 'admbasex_gzz', 'admbasex_betax', 'admbasex_betay',
'admbasex_betaz', 'weyl_psi0im', 'weyl_psi0re', 'weyl_psi1im', 'weyl_psi1re',
'weyl_psi2im', 'weyl_psi2re', 'weyl_psi3im', 'weyl_psi3re', 'weyl_psi4im',
'weyl_psi4re', 'z4c_allc', 'carpetx_regrid_error'
['wavetoyx_eps', 'wavetoyx_rho_err', 'wavetoyx_u_err', 'wavetoyx_rho_rhs',
'wavetoyx_u_rhs', 'wavetoyx_rho', 'wavetoyx_u'
]
)

Expand Down Expand Up @@ -570,6 +566,11 @@ def test_total_filesize(self):
size_KB = size_B / 1024
self.assertEqual(size_KB, self.gf.total_filesize("KB"))

def test_refinement_levels(self):
wavetoyx_u = self.gf.fields.wavetoyx_u
wavetoyx_u0=wavetoyx_u[0]
self.assertEquals(wavetoyx_u0.refinement_levels, [0,1])

def test__str(self):
self.assertIn("vz", str(self.gf))
self.assertIn("Available grid data of dimension 3D (xyz)", str(self.gf))

0 comments on commit f9e1e7f

Please sign in to comment.