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

Add more type-hints #1156

Merged
merged 1 commit into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 3 additions & 3 deletions src/quacc/recipes/emt/defects.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
if "relax_cell" not in defect_relax_kwargs:
defect_relax_kwargs["relax_cell"] = False

def _make_defects(atoms):
def _make_defects(atoms: Atoms) -> list[Atoms]:

Check warning on line 84 in src/quacc/recipes/emt/defects.py

View check run for this annotation

Codecov / codecov/patch

src/quacc/recipes/emt/defects.py#L84

Added line #L84 was not covered by tests
return make_defects_from_bulk(
atoms,
defect_gen=defect_gen,
Expand All @@ -90,12 +90,12 @@
)

@subflow
def _relax_distributed(atoms):
def _relax_distributed(atoms: Atoms) -> list[OptSchema]:

Check warning on line 93 in src/quacc/recipes/emt/defects.py

View check run for this annotation

Codecov / codecov/patch

src/quacc/recipes/emt/defects.py#L93

Added line #L93 was not covered by tests
defects = _make_defects(atoms)
return [relax_job(defect, **defect_relax_kwargs) for defect in defects]

@subflow
def _relax_and_static_distributed(atoms):
def _relax_and_static_distributed(atoms: Atoms) -> list[RunSchema]:

Check warning on line 98 in src/quacc/recipes/emt/defects.py

View check run for this annotation

Codecov / codecov/patch

src/quacc/recipes/emt/defects.py#L98

Added line #L98 was not covered by tests
defects = _make_defects(atoms)
return [
static_job(
Expand Down
6 changes: 3 additions & 3 deletions src/quacc/recipes/emt/slabs.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,16 @@ def bulk_to_slabs_flow(
if "relax_cell" not in slab_relax_kwargs:
slab_relax_kwargs["relax_cell"] = False

def _make_slabs(atoms):
def _make_slabs(atoms: Atoms) -> list[Atoms]:
return make_slabs_from_bulk(atoms, **make_slabs_kwargs)

@subflow
def _relax_distributed(atoms):
def _relax_distributed(atoms: Atoms) -> list[OptSchema]:
slabs = _make_slabs(atoms)
return [relax_job(slab, **slab_relax_kwargs) for slab in slabs]

@subflow
def _relax_and_static_distributed(atoms):
def _relax_and_static_distributed(atoms: Atoms) -> list[OptSchema]:
slabs = _make_slabs(atoms)
return [
static_job(
Expand Down
12 changes: 6 additions & 6 deletions src/quacc/recipes/vasp/slabs.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,16 +186,16 @@
slab_static_kwargs = slab_static_kwargs or {}
make_slabs_kwargs = make_slabs_kwargs or {}

def _make_slabs(atoms):
def _make_slabs(atoms: Atoms) -> list[Atoms]:

Check warning on line 189 in src/quacc/recipes/vasp/slabs.py

View check run for this annotation

Codecov / codecov/patch

src/quacc/recipes/vasp/slabs.py#L189

Added line #L189 was not covered by tests
return make_slabs_from_bulk(atoms, **make_slabs_kwargs)

@subflow
def _relax_distributed(atoms):
def _relax_distributed(atoms: Atoms) -> list[VaspSchema]:

Check warning on line 193 in src/quacc/recipes/vasp/slabs.py

View check run for this annotation

Codecov / codecov/patch

src/quacc/recipes/vasp/slabs.py#L193

Added line #L193 was not covered by tests
slabs = _make_slabs(atoms)
return [slab_relax_job(slab, **slab_relax_kwargs) for slab in slabs]

@subflow
def _relax_and_static_distributed(atoms):
def _relax_and_static_distributed(atoms: Atoms) -> list[VaspSchema]:

Check warning on line 198 in src/quacc/recipes/vasp/slabs.py

View check run for this annotation

Codecov / codecov/patch

src/quacc/recipes/vasp/slabs.py#L198

Added line #L198 was not covered by tests
slabs = _make_slabs(atoms)
return [
slab_static_job(
Expand Down Expand Up @@ -255,16 +255,16 @@
slab_static_kwargs = slab_static_kwargs or {}
make_ads_kwargs = make_ads_kwargs or {}

def _make_ads_slabs(slab):
def _make_ads_slabs(slab: Atoms) -> list[Atoms]:

Check warning on line 258 in src/quacc/recipes/vasp/slabs.py

View check run for this annotation

Codecov / codecov/patch

src/quacc/recipes/vasp/slabs.py#L258

Added line #L258 was not covered by tests
return make_adsorbate_structures(slab, adsorbate, **make_ads_kwargs)

@subflow
def _relax_distributed(slab):
def _relax_distributed(slab: Atoms) -> list[VaspSchema]:

Check warning on line 262 in src/quacc/recipes/vasp/slabs.py

View check run for this annotation

Codecov / codecov/patch

src/quacc/recipes/vasp/slabs.py#L262

Added line #L262 was not covered by tests
slabs = _make_ads_slabs(slab)
return [slab_relax_job(slab, **slab_relax_kwargs) for slab in slabs]

@subflow
def _relax_and_static_distributed(slab):
def _relax_and_static_distributed(slab: Atoms) -> list[VaspSchema]:

Check warning on line 267 in src/quacc/recipes/vasp/slabs.py

View check run for this annotation

Codecov / codecov/patch

src/quacc/recipes/vasp/slabs.py#L267

Added line #L267 was not covered by tests
slabs = _make_ads_slabs(slab)
return [
slab_static_job(
Expand Down