Skip to content

Commit

Permalink
fix type hints
Browse files Browse the repository at this point in the history
Signed-off-by: Jinzhe Zeng <[email protected]>
  • Loading branch information
njzjz committed May 28, 2024
1 parent 0bcd410 commit 88c5219
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion deepmd/dpmodel/model/spin_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def get_model_def_script(self) -> str:
"""Get the model definition script."""
return self.backbone_model.get_model_def_script()

def get_min_nbor_dist(self) -> float:
def get_min_nbor_dist(self) -> Optional[float]:
"""Get the minimum neighbor distance."""
return self.backbone_model.get_min_nbor_dist()

Check warning on line 232 in deepmd/dpmodel/model/spin_model.py

View check run for this annotation

Codecov / codecov/patch

deepmd/dpmodel/model/spin_model.py#L232

Added line #L232 was not covered by tests

Expand Down
2 changes: 1 addition & 1 deletion deepmd/pt/model/model/frozen.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def get_model_def_script(self) -> str:
return self.model.get_model_def_script()

@torch.jit.export
def get_min_nbor_dist(self) -> float:
def get_min_nbor_dist(self) -> Optional[float]:
"""Get the minimum neighbor distance."""
return self.model.get_min_nbor_dist()

Check warning on line 140 in deepmd/pt/model/model/frozen.py

View check run for this annotation

Codecov / codecov/patch

deepmd/pt/model/model/frozen.py#L140

Added line #L140 was not covered by tests

Expand Down
2 changes: 1 addition & 1 deletion deepmd/pt/model/model/spin_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def get_model_def_script(self) -> str:
return self.backbone_model.get_model_def_script()

@torch.jit.export
def get_min_nbor_dist(self) -> float:
def get_min_nbor_dist(self) -> Optional[float]:
"""Get the minimum neighbor distance."""
return self.backbone_model.get_min_nbor_dist()

Expand Down

0 comments on commit 88c5219

Please sign in to comment.