test more
This commit is contained in:
parent
5a2cd83186
commit
041d3ffdd7
|
@ -1 +1 @@
|
||||||
eb506713032481aebf870b965eaca8b5
|
6fb37bd65934de859dd6b6e0191e7d64
|
|
@ -0,0 +1 @@
|
||||||
|
bb783bb80ff04dd435e814f4b82a3234
|
|
@ -0,0 +1 @@
|
||||||
|
ba97286c5d95bf817143f7bb9cf58421
|
|
@ -1,10 +1,20 @@
|
||||||
import pytest
|
import pytest
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
|
import damask
|
||||||
from damask import Crystal
|
from damask import Crystal
|
||||||
|
|
||||||
class TestCrystal:
|
class TestCrystal:
|
||||||
|
|
||||||
|
@pytest.mark.parametrize('lattice,family',[('aP','cubic'),('xI','cubic')])
|
||||||
|
def test_invalid_init(self,lattice,family):
|
||||||
|
with pytest.raises(KeyError):
|
||||||
|
Crystal(family=family,lattice=lattice)
|
||||||
|
|
||||||
|
def test_eq(self):
|
||||||
|
family = np.random.choice(list(damask._crystal.lattice_symmetries.values()))
|
||||||
|
assert Crystal(family=family) == Crystal(family=family)
|
||||||
|
|
||||||
def test_double_to_lattice(self):
|
def test_double_to_lattice(self):
|
||||||
c = Crystal(lattice='cF')
|
c = Crystal(lattice='cF')
|
||||||
with pytest.raises(KeyError):
|
with pytest.raises(KeyError):
|
||||||
|
@ -55,3 +65,4 @@ class TestCrystal:
|
||||||
alpha=alpha,beta=beta,gamma=gamma)
|
alpha=alpha,beta=beta,gamma=gamma)
|
||||||
assert np.allclose(vector,
|
assert np.allclose(vector,
|
||||||
c.to_frame(**{keyFrame:c.to_lattice(**{keyLattice:vector})}))
|
c.to_frame(**{keyFrame:c.to_lattice(**{keyLattice:vector})}))
|
||||||
|
|
||||||
|
|
|
@ -369,8 +369,7 @@ class TestResult:
|
||||||
b = default.coordinates0_node.reshape(tuple(default.cells+1)+(3,),order='F')
|
b = default.coordinates0_node.reshape(tuple(default.cells+1)+(3,),order='F')
|
||||||
assert np.allclose(a,b)
|
assert np.allclose(a,b)
|
||||||
|
|
||||||
# need to wait for writing in parallel, output order might change if select more than one
|
@pytest.mark.parametrize('output',['F','*',['P'],['P','F']],ids=range(4))
|
||||||
@pytest.mark.parametrize('output',['F','*',['P']],ids=range(3))
|
|
||||||
@pytest.mark.parametrize('fname',['12grains6x7x8_tensionY.hdf5'],ids=range(1))
|
@pytest.mark.parametrize('fname',['12grains6x7x8_tensionY.hdf5'],ids=range(1))
|
||||||
@pytest.mark.parametrize('inc',[4,0],ids=range(2))
|
@pytest.mark.parametrize('inc',[4,0],ids=range(2))
|
||||||
def test_vtk(self,request,tmp_path,ref_path,update,patch_execution_stamp,patch_datetime_now,output,fname,inc):
|
def test_vtk(self,request,tmp_path,ref_path,update,patch_execution_stamp,patch_datetime_now,output,fname,inc):
|
||||||
|
|
Loading…
Reference in New Issue