'/' is separator in h5py even on windows.
os.path assumes OS-dependent path separators
This commit is contained in:
parent
c11d38b2ec
commit
ff3d3afe9e
|
@ -125,9 +125,9 @@ class TestUtil:
|
||||||
def test_D3D_base_group(self,tmp_path,complete):
|
def test_D3D_base_group(self,tmp_path,complete):
|
||||||
base_group = ''.join(random.choices('DAMASK', k=10))
|
base_group = ''.join(random.choices('DAMASK', k=10))
|
||||||
with h5py.File(tmp_path/'base_group.dream3d','w') as f:
|
with h5py.File(tmp_path/'base_group.dream3d','w') as f:
|
||||||
f.create_group(os.path.join(base_group,'_SIMPL_GEOMETRY'))
|
f.create_group('/'.join((base_group,'_SIMPL_GEOMETRY')))
|
||||||
if complete:
|
if complete:
|
||||||
f[os.path.join(base_group,'_SIMPL_GEOMETRY')].create_dataset('SPACING',data=np.ones(3))
|
f['/'.join((base_group,'_SIMPL_GEOMETRY'))].create_dataset('SPACING',data=np.ones(3))
|
||||||
|
|
||||||
if complete:
|
if complete:
|
||||||
assert base_group == util.DREAM3D_base_group(tmp_path/'base_group.dream3d')
|
assert base_group == util.DREAM3D_base_group(tmp_path/'base_group.dream3d')
|
||||||
|
@ -141,12 +141,12 @@ class TestUtil:
|
||||||
cell_data_group = ''.join(random.choices('KULeuven', k=10))
|
cell_data_group = ''.join(random.choices('KULeuven', k=10))
|
||||||
cells = np.random.randint(1,50,3)
|
cells = np.random.randint(1,50,3)
|
||||||
with h5py.File(tmp_path/'cell_data_group.dream3d','w') as f:
|
with h5py.File(tmp_path/'cell_data_group.dream3d','w') as f:
|
||||||
f.create_group(os.path.join(base_group,'_SIMPL_GEOMETRY'))
|
f.create_group('/'.join((base_group,'_SIMPL_GEOMETRY')))
|
||||||
f[os.path.join(base_group,'_SIMPL_GEOMETRY')].create_dataset('SPACING',data=np.ones(3))
|
f['/'.join((base_group,'_SIMPL_GEOMETRY'))].create_dataset('SPACING',data=np.ones(3))
|
||||||
f[os.path.join(base_group,'_SIMPL_GEOMETRY')].create_dataset('DIMENSIONS',data=cells[::-1])
|
f['/'.join((base_group,'_SIMPL_GEOMETRY'))].create_dataset('DIMENSIONS',data=cells[::-1])
|
||||||
f[base_group].create_group(cell_data_group)
|
f[base_group].create_group(cell_data_group)
|
||||||
if complete:
|
if complete:
|
||||||
f[os.path.join(base_group,cell_data_group)].create_dataset('data',shape=np.append(cells,1))
|
f['/'.join((base_group,cell_data_group))].create_dataset('data',shape=np.append(cells,1))
|
||||||
|
|
||||||
if complete:
|
if complete:
|
||||||
assert cell_data_group == util.DREAM3D_cell_data_group(tmp_path/'cell_data_group.dream3d')
|
assert cell_data_group == util.DREAM3D_cell_data_group(tmp_path/'cell_data_group.dream3d')
|
||||||
|
|
Loading…
Reference in New Issue