Skip to content

Commit

Permalink
Merge pull request #26 from aiida-phonopy/pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
[pre-commit.ci] pre-commit autoupdate
  • Loading branch information
atztogo committed Apr 4, 2022
2 parents 8aff176 + cf5057c commit f1a3e3d
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.1.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -17,7 +17,7 @@ repos:
- "--ignore=E203,W503"

- repo: https://github.com/psf/black
rev: 21.12b0
rev: 22.3.0
hooks:
- id: black
args:
Expand Down
8 changes: 4 additions & 4 deletions aiida_phonopy/calculations/functions/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def phonopy_atoms_from_structure(structure, to_map=False):

kind_names = structure.get_kind_names()
# The numbers start from 1, otherwise phonopy will complain in the post processing.
kinds_to_numbers = {kind_names[i]: i+1 for i in range(len(kind_names))}
kinds_to_numbers = {kind_names[i]: i + 1 for i in range(len(kind_names))}

for site in sites:
kind = structure.get_kind(site.kind_name)
Expand All @@ -136,10 +136,10 @@ def phonopy_atoms_from_structure(structure, to_map=False):
masses=masses,
cell=structure.cell,
)

# Also here we start from 1.
numbers_to_kinds = {i+1: kind_names[i] for i in range(len(kind_names))}
numbers_to_kinds = {i + 1: kind_names[i] for i in range(len(kind_names))}

return (cell, [numbers_to_kinds, numbers_to_symbols])


Expand Down
17 changes: 13 additions & 4 deletions aiida_phonopy/calculations/phonopy.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class PhonopyCalculation(BasePhonopyCalculation):
"GROUP_VELOCITY": [bool],
"GV_DELTA_Q": [int, float],
# Symmetry
"SYMMETRY_TOLERANCE": [int, float], # !!!! ATTENTION TO INPUTS !!!!
"SYMMETRY_TOLERANCE": [int, float], # !!!! ATTENTION TO INPUTS !!!!
"SYMMETRY": [bool],
"MESH_SYMMETRY": [bool],
"FC_SYMMETRY": [bool],
Expand All @@ -110,7 +110,7 @@ class PhonopyCalculation(BasePhonopyCalculation):
_BLOCKED_TAGS = [
"DIM",
"ATOM_NAME",
"MASS", #??? from structure or also from here??
"MASS", # ??? from structure or also from here??
"MAGMOM",
"CREATE_DISPLACEMENTS",
"DISPLACEMENT_DISTANCE",
Expand Down Expand Up @@ -182,7 +182,12 @@ def prepare_for_submission(self, folder):

# =============== prepare the submit and conf file ====================

cmd_readcell = ["-c", self._DEFAULT_CELL_FILE, "--tolerance", str(self.inputs.symmetry_tolerance.value)] # in front any phonopy cmd line
cmd_readcell = [
"-c",
self._DEFAULT_CELL_FILE,
"--tolerance",
str(self.inputs.symmetry_tolerance.value),
] # in front any phonopy cmd line
cmd_writefc = ["--writefc", "--writefc-format=hdf5"] # first cmd if `parent_folder` is not specified
cmd_readfc = ["--readfc", "--readfc-format=hdf5"] # in front any phonopy post-process cmd line

Expand Down Expand Up @@ -283,7 +288,11 @@ def _write_born(self, folder):

def _write_cells_info(self, folder):
"""Write in `folder` the `phonopy_cells.yaml` file."""
phpy_yaml_txt = get_phonopy_yaml_txt(self.inputs.structure, symprec=self.inputs.symmetry_tolerance.value, supercell_matrix=self.inputs["supercell_matrix"])
phpy_yaml_txt = get_phonopy_yaml_txt(
self.inputs.structure,
symprec=self.inputs.symmetry_tolerance.value,
supercell_matrix=self.inputs["supercell_matrix"],
)
with folder.open(self._DEFAULT_CELL_FILE, "w", encoding="utf8") as handle:
handle.write(phpy_yaml_txt)

Expand Down
18 changes: 9 additions & 9 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,18 @@
master_doc = "index"

# General information about the project.
project = u"aiida-phonopy"
copyright = u"2017, Atsushi Togo, Abel Carreras"
author = u"Atsushi Togo, Abel Carreras"
project = "aiida-phonopy"
copyright = "2017, Atsushi Togo, Abel Carreras"
author = "Atsushi Togo, Abel Carreras"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = u"0.3"
version = "0.3"
# The full version, including alpha/beta/rc tags.
release = u"0.3"
release = "0.3"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -126,8 +126,8 @@
(
master_doc,
"aiida-phonopy.tex",
u"aiida-phonopy Documentation",
u"Abel Carreras",
"aiida-phonopy Documentation",
"Abel Carreras",
"manual",
),
]
Expand All @@ -136,7 +136,7 @@

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [(master_doc, "aiida-phonopy", u"aiida-phonopy Documentation", [author], 1)]
man_pages = [(master_doc, "aiida-phonopy", "aiida-phonopy Documentation", [author], 1)]

# -- Options for Texinfo output -------------------------------------------

Expand All @@ -147,7 +147,7 @@
(
master_doc,
"aiida-phonopy",
u"aiida-phonopy Documentation",
"aiida-phonopy Documentation",
author,
"aiida-phonopy",
"Running phonopy using AiiDA",
Expand Down

0 comments on commit f1a3e3d

Please sign in to comment.