test new functionality

This commit is contained in:
Martin Diehl 2023-12-18 16:43:41 +01:00
parent 939d5070b3
commit 809f5f455b
No known key found for this signature in database
GPG Key ID: 1FD50837275A0A9B
3 changed files with 20 additions and 3 deletions

View File

@ -1,2 +1,4 @@
[run]
source = damask
[report]
show_missing = true

View File

@ -453,7 +453,7 @@ class Result:
View with all attributes visible.
"""
return self.view(increments='*',phases='*',homogenizations='*',fieds='*')
return self.view(increments='*',phases='*',homogenizations='*',fields='*')
def rename(self,
@ -1920,7 +1920,7 @@ class Result:
out_dir.mkdir(parents=True,exist_ok=True)
with h5py.File(self.fname,'r') as f:
if self.version_minor >= 13:
if self.version_major == 1 or self.version_minor >= 13:
creator = f.attrs['creator'] if h5py3 else f.attrs['creator'].decode()
created = f.attrs['created'] if h5py3 else f.attrs['created'].decode()
v.comments += [f'{creator} ({created})']

View File

@ -79,7 +79,7 @@ class TestResult:
def test_view_all(self,default):
default = Result(default.fname)
a = default.view(increments=True).get('F')
a = default.view_all().get('F')
assert dict_equal(a,default.view(increments='*').get('F'))
assert dict_equal(a,default.view(increments=default.increments_in_range(0,np.iinfo(int).max)).get('F'))
@ -130,6 +130,21 @@ class TestResult:
times = list(default._times.values())
assert [default._increments[inc]] == default.view(times=times[inc]+eps)._visible['increments']
def test_getters(self,default):
file_layout = default.get('non-existing',prune=False,flatten=False)
for i in default.increments:
increment = file_layout[f'increment_{i}']
fields = []
for p in default.phases:
phase = increment['phase'][p]
for f in default.fields:
fields.append(phase[f])
for h in default.homogenizations:
homogenization = increment['homogenization'][h]
for f in default.fields:
fields.append(homogenization[f])
assert len(fields) > 0
def test_add_invalid(self,default):
default.add_absolute('xxxx')