Skip to content

Commit 1372041

Browse files
Merge pull request #10 from JuDFTteam/develop
🚀 Release `0.4.1`
2 parents fcbad4b + 1ba664f commit 1372041

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

.pre-commit-config.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ repos:
1515
- id: flake8
1616
args: ["--max-line-length=120"]
1717
- repo: https://github.com/psf/black
18-
rev: 22.3.0 # Replace by any tag/version: https://github.com/psf/black/tags
18+
rev: 22.10.0 # Replace by any tag/version: https://github.com/psf/black/tags
1919
hooks:
2020
- id: black
2121
language_version: python3 # Should be a command that runs python3.6+
2222

2323
- repo: https://github.com/ikamensh/flynt/
24-
rev: '0.76'
24+
rev: '0.77'
2525
hooks:
2626
- id: flynt
2727
args: [
@@ -46,7 +46,7 @@ repos:
4646
additional_dependencies: ['toml']
4747

4848
- repo: https://github.com/pre-commit/mirrors-mypy
49-
rev: 'v0.942' # Use the sha / tag you want to point at
49+
rev: 'v0.991' # Use the sha / tag you want to point at
5050
hooks:
5151
- id: mypy
5252
args: [

pymatgen/io/fleur/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99

1010
__copyright__ = "Copyright (c), Forschungszentrum Jülich GmbH, IAS-1/PGI-1, Germany. All rights reserved."
1111
__license__ = "MIT license, see LICENSE.txt file."
12-
__version__ = "0.4.0"
12+
__version__ = "0.4.1"
1313
__authors__ = "The JuDFT team"

pymatgen/io/fleur/fleurinput.py

+10-6
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from fleur input files (http://flapw.de).
99
"""
1010
import warnings
11-
from typing import Union, Any
11+
from typing import Optional, Union, Any
1212
from pathlib import Path
1313
from monty.io import zopen
1414
from monty.json import MSONable
@@ -42,8 +42,8 @@ class FleurInput(MSONable):
4242
def __init__(
4343
self,
4444
structure: Structure,
45-
title: str = None,
46-
lapw_parameters: dict = None,
45+
title: Optional[str] = None,
46+
lapw_parameters: Optional[dict] = None,
4747
**kwargs: Any,
4848
):
4949
"""
@@ -98,7 +98,7 @@ def from_string(data: Union[str, bytes], inpgen_input: bool = True, **kwargs) ->
9898
parameters = get_parameter_data(xmltree, schema_dict)
9999
title_in = parameters.pop("title", "")
100100

101-
positions, elements, _ = zip(*atoms)
101+
positions, elements = zip(*[(site.position, site.symbol) for site in atoms])
102102
# create lattice and structure object
103103
lattice_in = Lattice(cell, pbc=pbc)
104104
structure_in = Structure(lattice_in, elements, positions, coords_are_cartesian=True)
@@ -128,7 +128,7 @@ def from_file(filename: PathLike) -> "FleurInput":
128128
return FleurInput.from_string(data, inpgen_input=inpgen_input, base_url=filename)
129129

130130
def get_inpgen_file_content(
131-
self, parameters: dict = None, ignore_set_parameters: bool = False, **kwargs: Union[int, bool]
131+
self, parameters: Optional[dict] = None, ignore_set_parameters: bool = False, **kwargs: Union[int, bool]
132132
):
133133
"""
134134
Produce the inpgen input file corresponding to the given information
@@ -143,6 +143,7 @@ def get_inpgen_file_content(
143143
returns: str of the inpgen input file
144144
"""
145145
from masci_tools.io.fleur_inpgen import write_inpgen_file
146+
from masci_tools.io.common_functions import AtomSiteProperties
146147

147148
if parameters is None:
148149
parameters = {}
@@ -153,7 +154,10 @@ def get_inpgen_file_content(
153154
if "title" not in parameters:
154155
parameters["title"] = self.title
155156

156-
atom_sites = [(site.coords, site.specie.symbol, site.specie.symbol) for site in self.structure.sites]
157+
atom_sites = [
158+
AtomSiteProperties(position=site.coords, symbol=site.specie.symbol, kind=site.specie.symbol)
159+
for site in self.structure.sites
160+
]
157161

158162
return write_inpgen_file(
159163
self.structure.lattice.matrix,

0 commit comments

Comments
 (0)