Skip to content

Commit

Permalink
Merge pull request #126 from Exabyte-io/feat/SOF-6640-1
Browse files Browse the repository at this point in the history
feat/SOF-6640-1
  • Loading branch information
timurbazhirov committed Jun 16, 2023
2 parents f19e40a + ee8937a commit dfe7d2d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
repos:
- repo: https://github.com/Exabyte-io/pre-commit-hooks
rev: 2023.6.13
hooks:
- id: ruff
- id: black
- id: pydocstyle
4 changes: 2 additions & 2 deletions express/parsers/apps/espresso/formats/txt.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,8 +661,8 @@ def phonon_frequencies(self, modes_file):
"""
with open(modes_file, 'r') as f:
text = f.read()
qpoints = np.array(re.compile(settings.REGEX["qpoints"]["regex"]).findall(text), dtype=np.float)
frequencies = np.array(re.compile(settings.REGEX["phonon_frequencies"]["regex"]).findall(text), dtype=np.float)
qpoints = np.array(re.compile(settings.REGEX["qpoints"]["regex"]).findall(text), dtype=np.float32)
frequencies = np.array(re.compile(settings.REGEX["phonon_frequencies"]["regex"]).findall(text), dtype=np.float32)
frequencies = np.transpose(frequencies.reshape(qpoints.shape[0], frequencies.shape[0] // qpoints.shape[0]))
return qpoints, frequencies

Expand Down
2 changes: 1 addition & 1 deletion express/parsers/apps/espresso/formats/xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def final_basis(self):
})
coordinates.append({
'id': int(atom.tag[5:]),
'value': (Constant.BOHR * np.array(atom.attrib.get("tau").split()).astype(np.float)).tolist()
'value': (Constant.BOHR * np.array(atom.attrib.get("tau").split()).astype(np.float32)).tolist()
})

return {
Expand Down
2 changes: 1 addition & 1 deletion express/parsers/apps/vasp/formats/xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def _parse_varray(self, varray):
ndarray: a matrix containing all the values found in the varray.
"""
return np.array([v.text.split() for v in varray.findall('v')],
dtype=np.float) if varray is not None else np.array([])
dtype=np.float32) if varray is not None else np.array([])

def stress_tensor(self):
"""
Expand Down

0 comments on commit dfe7d2d

Please sign in to comment.