Closed iProzd closed 1 week ago
deepmd/dpmodel/fitting/ener_fitting.py
33-33: Do not use mutable data structures for argument defaults Replace with `None`; initialize within function (B006) --- 47-47: Do not use mutable data structures for argument defaults Replace with `None`; initialize within function (B006)deepmd/dpmodel/fitting/dos_fitting.py
36-36: Do not use mutable data structures for argument defaults Replace with `None`; initialize within function (B006) --- 46-46: Do not use mutable data structures for argument defaults Replace with `None`; initialize within function (B006)deepmd/dpmodel/fitting/dipole_fitting.py
93-93: Do not use mutable data structures for argument defaults Replace with `None`; initialize within function (B006) --- 106-106: Do not use mutable data structures for argument defaults Replace with `None`; initialize within function (B006)deepmd/dpmodel/fitting/invar_fitting.py
121-121: Do not use mutable data structures for argument defaults Replace with `None`; initialize within function (B006) --- 136-136: Do not use mutable data structures for argument defaults Replace with `None`; initialize within function (B006)deepmd/dpmodel/fitting/polarizability_fitting.py
98-98: Do not use mutable data structures for argument defaults Replace with `None`; initialize within function (B006) --- 111-111: Do not use mutable data structures for argument defaults Replace with `None`; initialize within function (B006)
deepmd/dpmodel/fitting/ener_fitting.py (2)
`72-72`: **Proper integration of `seed` parameter.** The `seed` parameter has been correctly added to the `__init__` method and passed to the superclass constructor, aligning with the PR objectives. --- `47-47`: **Refactor mutable default argument.** Similar to the previous comment, mutable default values should be avoided. This applies to the `trainable` parameter as well. ```diff - trainable: Optional[List[bool]] = None, + trainable: Optional[List[bool]] = None, ... + if trainable is None: + trainable = [True] * len(neuron) # Assuming that the length of neuron list is the intended size ``` > Likely invalid or redundant comment.Tools
Ruff
47-47: Do not use mutable data structures for argument defaults Replace with `None`; initialize within function (B006)deepmd/dpmodel/fitting/dos_fitting.py (1)
`71-71`: **Proper integration of `seed` parameter.** The `seed` parameter has been correctly added to the `__init__` method and passed to the superclass constructor, aligning with the PR objectives.deepmd/dpmodel/fitting/dipole_fitting.py (1)
`144-144`: **Proper integration of `seed` parameter and handling of `old_impl`.** The `seed` parameter has been correctly added and the `old_impl` flag has been set to `False` as part of the initialization. This aligns with the PR objectives and the changes are properly integrated.deepmd/dpmodel/fitting/invar_fitting.py (1)
`138-138`: **Proper integration of `seed` parameter.** The `seed` parameter has been correctly added to the `__init__` method and passed to the superclass constructor, aligning with the PR objectives.deepmd/dpmodel/fitting/polarizability_fitting.py (1)
`168-168`: **Proper integration of `seed` parameter.** The `seed` parameter has been correctly added to the `__init__` method and passed to the superclass constructor, aligning with the PR objectives.
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 82.72%. Comparing base (
17cdcb0
) to head (6d303ee
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Summary by CodeRabbit
seed
parameter across various fitting modules to enhance customization and reproducibility of model fitting processes.