Skip to content

Commit

Permalink
fix examples/fine_tuning.ipynb:cell 13:7:20: F821 Undefined name resu…
Browse files Browse the repository at this point in the history
…lt_dict

include jupyter in ruff lint and format
  • Loading branch information
janosh committed Jun 27, 2024
1 parent 501f36a commit 22a0dbb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ repos:
hooks:
- id: ruff
args: [--fix]
types_or: [python, jupyter]
- id: ruff-format
types_or: [python, jupyter]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
Expand Down
4 changes: 2 additions & 2 deletions examples/fine_tuning.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@
"structures = [Structure.from_dict(struct) for struct in dataset_dict[\"structure\"]]\n",
"energies = dataset_dict[\"energy_per_atom\"]\n",
"forces = dataset_dict[\"force\"]\n",
"stresses = None if result_dict[\"stress\"] in [None, []] else result_dict[\"stress\"]\n",
"magmoms = None if result_dict[\"magmom\"] in [None, []] else result_dict[\"magmom\"]"
"stresses = dataset_dict.get(\"stress\") or None\n",
"magmoms = dataset_dict.get(\"magmom\") or None"
]
},
{
Expand Down

0 comments on commit 22a0dbb

Please sign in to comment.