Skip to content

Commit 8be7fc5

Browse files
committed
Merge branch '389-no-default-material-yaml' into 'development'
overload of functions not needed anymore Closes #389 See merge request damask/DAMASK!926
2 parents 87ef018 + ce32c19 commit 8be7fc5

File tree

3 files changed

+2
-51
lines changed

3 files changed

+2
-51
lines changed

python/damask/_configmaterial.py

+1-38
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import numpy as np
44
import h5py
55

6-
from ._typehints import FileHandle, FloatSequence, StrSequence
6+
from ._typehints import FloatSequence, StrSequence
77
from . import YAML
88
from . import Rotation
99
from . import Orientation
@@ -56,43 +56,6 @@ def __init__(self,
5656
super().__init__(config,**kwargs)
5757

5858

59-
def save(self,
60-
fname: FileHandle = 'material.yaml',
61-
**kwargs):
62-
"""
63-
Save to YAML file.
64-
65-
Parameters
66-
----------
67-
fname : file, str, or pathlib.Path, optional
68-
Filename or file for writing. Defaults to 'material.yaml'.
69-
**kwargs
70-
Keyword arguments parsed to yaml.dump.
71-
72-
"""
73-
super().save(fname,**kwargs)
74-
75-
76-
@classmethod
77-
def load(cls,
78-
fname: FileHandle = 'material.yaml') -> 'ConfigMaterial':
79-
"""
80-
Load from YAML file.
81-
82-
Parameters
83-
----------
84-
fname : file, str, or pathlib.Path, optional
85-
Filename or file to read from. Defaults to 'material.yaml'.
86-
87-
Returns
88-
-------
89-
loaded : damask.ConfigMaterial
90-
Material configuration from file.
91-
92-
"""
93-
return super(ConfigMaterial,cls).load(fname)
94-
95-
9659
@staticmethod
9760
def load_DREAM3D(fname: str,
9861
grain_data: Optional[str] = None,

python/tests/test_ConfigMaterial.py

-12
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,6 @@ def test_init_some(self,kwargs):
3737
for k,v in kwargs.items():
3838
if k in kwargs: assert v == kwargs[k]
3939

40-
@pytest.mark.parametrize('fname',[None,'test.yaml'])
41-
def test_load_save(self,res_path,tmp_path,fname):
42-
reference = ConfigMaterial.load(res_path/'material.yaml')
43-
os.chdir(tmp_path)
44-
if fname is None:
45-
reference.save()
46-
new = ConfigMaterial.load('material.yaml')
47-
else:
48-
reference.save(fname)
49-
new = ConfigMaterial.load(fname)
50-
assert reference == new
51-
5240
def test_valid_complete(self,res_path):
5341
material_config = ConfigMaterial.load(res_path/'material.yaml')
5442
assert material_config.is_valid and material_config.is_complete

python/tests/test_YAML.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def test_init_both(self,config):
1919
assert YAML(config,p=2)['p'] == 2
2020

2121
@pytest.mark.parametrize('flow_style',[None,True,False])
22-
def test_load_save_str(self,tmp_path,flow_style):
22+
def test_load_save_path(self,tmp_path,flow_style):
2323
config = YAML()
2424
config['A'] = 1
2525
config['B'] = [2,3]

0 commit comments

Comments
 (0)