Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print invalid kpath_scheme, use_symmetrized_structure and list valid ones in PhononMaker error messages #728

Merged
merged 6 commits into from
Feb 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
simplify dict construction in lobster read_saved_json(), LobsterTaskD…
…ocument.from_directory
  • Loading branch information
janosh committed Feb 18, 2024
commit 0f326f529d523732dd9e93b8366b6886f823fc7d
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ default_language_version:
python: python3
repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.2.1
rev: v0.2.2
hooks:
- id: ruff
args: [--fix]
Expand Down
2 changes: 1 addition & 1 deletion src/atomate2/cp2k/sets/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def get_input_set(
Cp2kInput
A Cp2k input set.
"""
structure, prev_input, cp2k_output = self._get_previous(structure, prev_dir)
structure, prev_input, _cp2k_output = self._get_previous(structure, prev_dir)

input_updates = self.get_input_updates(
structure,
Expand Down
20 changes: 7 additions & 13 deletions src/atomate2/lobster/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -806,10 +806,8 @@ def from_directory(
"dos_comparison": True,
"n_bins": 256,
"bva_comp": True,
**(calc_quality_kwargs or {}),
}
if calc_quality_kwargs:
for args, values in calc_quality_kwargs.items():
calc_quality_kwargs_default[args] = values

calc_quality_summary = CalcQualitySummary.from_directory(
dir_name,
Expand Down Expand Up @@ -1319,16 +1317,12 @@ def read_saved_json(
Returns a dictionary with lobster task json data corresponding to query.
"""
with gzip.open(filename, "rb") as file:
lobster_data = {}
objects = ijson.items(file, "item", use_float=True)
for obj in objects:
if query is None:
for field, data in obj.items():
lobster_data[field] = data
elif query in obj:
for field, data in obj.items():
lobster_data[field] = data
break
lobster_data = {
field: data
for obj in ijson.items(file, "item", use_float=True)
for field, data in obj.items()
if query is None or query in obj
}
if not lobster_data:
raise ValueError(
"Please recheck the query argument. "
Expand Down
2 changes: 1 addition & 1 deletion src/atomate2/utils/file_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ def gunzip(
path.unlink()
else:
ssh = self.get_ssh(host)
_, stdout, _ = ssh.exec_command(f"gunzip -f {path!s}")
_stdin, _stdout, _stderr = ssh.exec_command(f"gunzip -f {path!s}")

def close(self) -> None:
"""Close all connections."""
Expand Down
Loading