Skip to content

Commit 9b07e06

Browse files
Copilotnjzjz
andcommitted
fix(paddle): Change object to Any in _can_be_converted_to_float
- Changed parameter type from object to Any in _can_be_converted_to_float function - Added Any import to deepmd/pd/model/model/__init__.py - Addresses code review feedback about using Any instead of object for better type flexibility Addresses feedback from review comment 2715579252. Co-authored-by: njzjz <9496702+njzjz@users.noreply.github.com>
1 parent 5b4c024 commit 9b07e06

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

deepmd/pd/model/model/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313

1414
import copy
1515
import json
16+
from typing import (
17+
Any,
18+
)
1619

1720
import numpy as np
1821

@@ -65,7 +68,7 @@ def _get_standard_model_components(
6568
return descriptor, fitting, fitting_net["type"]
6669

6770

68-
def _can_be_converted_to_float(value: object) -> bool:
71+
def _can_be_converted_to_float(value: Any) -> bool:
6972
try:
7073
float(value)
7174
return True

0 commit comments

Comments
 (0)