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

chore: replace reduciable with reducible #3888

Merged
merged 1 commit into from
Jun 21, 2024

Conversation

njzjz
Copy link
Member

@njzjz njzjz commented Jun 19, 2024

Fix the spelling as suggested by #3867 (comment).

Summary by CodeRabbit

  • Bug Fixes

    • Corrected typos in attribute names from reduciable to reducible across multiple files, enhancing the accuracy of parameter definitions and improving code consistency.
  • Tests

    • Updated test cases to reflect the corrected attribute names, ensuring that tests accurately validate the new reducible parameter.

These changes improve the clarity and correctness of the codebase, ensuring that attribute names are consistent and accurately reflect their intended functionality.

Fix the spelling as suggested by deepmodeling#3867 (comment).

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
@njzjz njzjz requested a review from wanghan-iapcm June 19, 2024 21:20
Copy link
Contributor

coderabbitai bot commented Jun 19, 2024

Walkthrough

Walkthrough

This update corrects a typo across multiple files in the deepmd codebase, specifically changing the attribute name reduciable to reducible. This correction ensures consistency in the codebase and affects logic related to the reducibility of various output variables in models, fitting procedures, inferences, and tests.

Changes

File or Group of Files Change Summary
deepmd/dpmodel/atomic_model/base_atomic_model.py Corrected the reduciable attribute to reducible in atomic_output_def.
deepmd/dpmodel/atomic_model/linear_atomic_model.py, …/pairtab_atomic_model.py Corrected the reduciable attribute to reducible in fitting output definitions.
deepmd/dpmodel/fitting/dipole_fitting.py, …/invar_fitting.py, …/polarizability_fitting.py Corrected the reduciable attribute to reducible for differentiation-related variables and output definitions.
deepmd/dpmodel/model/transform_output.py Changed reduciable to reducible within functions affecting output transformation.
deepmd/dpmodel/output_def.py Corrected reduciable to reducible across the class OutputVariableDef and related functions.
deepmd/infer/deep_dos.py, …/deep_polar.py, …/deep_pot.py, …/deep_tensor.py` Corrected reduciable to reducible within the output_def functions for various inference tasks.
deepmd/pt/model/atomic_model/base_atomic_model.py Changed reduciable to reducible in atomic_output_def.
deepmd/pt/model/atomic_model/linear_atomic_model.py, …/pairtab_atomic_model.py` Corrected reduciable to reducible in the OutputVariableDef within fitting output definitions.
deepmd/pt/model/model/transform_output.py Changed reduciable to reducible in functions handling model output transformations.
deepmd/pt/model/task/denoise.py, …/dos.py, …/ener.py, …/invar_fitting.py, …/polarizability.py Changed reduciable to reducible in multiple output_def functions affecting various tasks.
source/tests/common/dpmodel/test_dp_atomic_model.py, …/test_output_def.py` Corrected the reduciable attribute to reducible within test cases.
source/tests/pt/model/test_atomic_model_atomic_stat.py, …/test_atomic_model_global_stat.py` Corrected reduciable to reducible in OutputVariableDef declarations within test files.
source/tests/pt/model/test_dp_atomic_model.py, …/test_linear_atomic_model_stat.py` Corrected reduciable to reducible in specific test functions.

Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 0c472d1 and 9a9b941.

Files selected for processing (29)
  • deepmd/dpmodel/atomic_model/base_atomic_model.py (1 hunks)
  • deepmd/dpmodel/atomic_model/linear_atomic_model.py (1 hunks)
  • deepmd/dpmodel/atomic_model/pairtab_atomic_model.py (1 hunks)
  • deepmd/dpmodel/fitting/dipole_fitting.py (2 hunks)
  • deepmd/dpmodel/fitting/invar_fitting.py (1 hunks)
  • deepmd/dpmodel/fitting/polarizability_fitting.py (1 hunks)
  • deepmd/dpmodel/model/transform_output.py (2 hunks)
  • deepmd/dpmodel/output_def.py (11 hunks)
  • deepmd/infer/deep_dos.py (1 hunks)
  • deepmd/infer/deep_polar.py (1 hunks)
  • deepmd/infer/deep_pot.py (2 hunks)
  • deepmd/infer/deep_tensor.py (1 hunks)
  • deepmd/infer/deep_wfc.py (1 hunks)
  • deepmd/pt/model/atomic_model/base_atomic_model.py (1 hunks)
  • deepmd/pt/model/atomic_model/linear_atomic_model.py (1 hunks)
  • deepmd/pt/model/atomic_model/pairtab_atomic_model.py (1 hunks)
  • deepmd/pt/model/model/transform_output.py (2 hunks)
  • deepmd/pt/model/task/denoise.py (1 hunks)
  • deepmd/pt/model/task/dipole.py (2 hunks)
  • deepmd/pt/model/task/dos.py (1 hunks)
  • deepmd/pt/model/task/ener.py (1 hunks)
  • deepmd/pt/model/task/invar_fitting.py (1 hunks)
  • deepmd/pt/model/task/polarizability.py (1 hunks)
  • source/tests/common/dpmodel/test_dp_atomic_model.py (1 hunks)
  • source/tests/common/dpmodel/test_output_def.py (15 hunks)
  • source/tests/pt/model/test_atomic_model_atomic_stat.py (1 hunks)
  • source/tests/pt/model/test_atomic_model_global_stat.py (1 hunks)
  • source/tests/pt/model/test_dp_atomic_model.py (1 hunks)
  • source/tests/pt/model/test_linear_atomic_model_stat.py (2 hunks)
Files skipped from review due to trivial changes (9)
  • deepmd/dpmodel/atomic_model/linear_atomic_model.py
  • deepmd/dpmodel/model/transform_output.py
  • deepmd/infer/deep_polar.py
  • deepmd/infer/deep_pot.py
  • deepmd/infer/deep_tensor.py
  • deepmd/infer/deep_wfc.py
  • deepmd/pt/model/atomic_model/pairtab_atomic_model.py
  • deepmd/pt/model/model/transform_output.py
  • source/tests/common/dpmodel/test_dp_atomic_model.py
Additional context used
Ruff
deepmd/pt/model/task/dos.py

48-48: Do not use mutable data structures for argument defaults (B006)

Replace with None; initialize within function


58-58: Do not use mutable data structures for argument defaults (B006)

Replace with None; initialize within function

deepmd/pt/model/task/denoise.py

32-32: Do not use mutable data structures for argument defaults (B006)

Replace with None; initialize within function

deepmd/pt/model/task/invar_fitting.py

89-89: Do not use mutable data structures for argument defaults (B006)

Replace with None; initialize within function


99-99: Do not use mutable data structures for argument defaults (B006)

Replace with None; initialize within function

deepmd/pt/model/task/dipole.py

82-82: Do not use mutable data structures for argument defaults (B006)

Replace with None; initialize within function


91-91: Do not use mutable data structures for argument defaults (B006)

Replace with None; initialize within function

source/tests/pt/model/test_linear_atomic_model_stat.py

179-179: Local variable f is assigned to but never used (F841)

Remove assignment to unused variable f

deepmd/dpmodel/fitting/dipole_fitting.py

92-92: Do not use mutable data structures for argument defaults (B006)

Replace with None; initialize within function


105-105: Do not use mutable data structures for argument defaults (B006)

Replace with None; initialize within function

deepmd/pt/model/task/ener.py

50-50: Do not use mutable data structures for argument defaults (B006)

Replace with None; initialize within function

deepmd/dpmodel/fitting/invar_fitting.py

120-120: Do not use mutable data structures for argument defaults (B006)

Replace with None; initialize within function


135-135: Do not use mutable data structures for argument defaults (B006)

Replace with None; initialize within function

deepmd/pt/model/task/polarizability.py

86-86: Do not use mutable data structures for argument defaults (B006)

Replace with None; initialize within function


95-95: Do not use mutable data structures for argument defaults (B006)

Replace with None; initialize within function

deepmd/dpmodel/atomic_model/base_atomic_model.py

40-40: Do not use mutable data structures for argument defaults (B006)

Replace with None; initialize within function


41-41: Do not use mutable data structures for argument defaults (B006)

Replace with None; initialize within function


87-87: Do not use mutable data structures for argument defaults (B006)

Replace with None; initialize within function


97-97: Do not use mutable data structures for argument defaults (B006)

Replace with None; initialize within function


201-201: Use key in dict instead of key in dict.keys() (SIM118)

Remove .keys()


247-247: Use key in dict instead of key in dict.keys() (SIM118)

Remove .keys()

deepmd/dpmodel/fitting/polarizability_fitting.py

97-97: Do not use mutable data structures for argument defaults (B006)

Replace with None; initialize within function


110-110: Do not use mutable data structures for argument defaults (B006)

Replace with None; initialize within function

source/tests/pt/model/test_atomic_model_atomic_stat.py

171-171: Local variable f is assigned to but never used (F841)

Remove assignment to unused variable f


341-341: Local variable f is assigned to but never used (F841)

Remove assignment to unused variable f

deepmd/dpmodel/output_def.py

107-107: Use key in dict instead of key in dict.keys() (SIM118)

Remove .keys()


436-436: Loop control variable kk not used within loop body (B007)

Rename unused kk to _kk

source/tests/pt/model/test_atomic_model_global_stat.py

173-173: Local variable f is assigned to but never used (F841)

Remove assignment to unused variable f


490-490: Local variable at is assigned to but never used (F841)

Remove assignment to unused variable at

deepmd/pt/model/atomic_model/base_atomic_model.py

80-80: Do not use mutable data structures for argument defaults (B006)

Replace with None; initialize within function


81-81: Do not use mutable data structures for argument defaults (B006)

Replace with None; initialize within function


95-95: Local variable ntypes is assigned to but never used (F841)

Remove assignment to unused variable ntypes


129-129: Do not use mutable data structures for argument defaults (B006)

Replace with None; initialize within function


139-139: Do not use mutable data structures for argument defaults (B006)

Replace with None; initialize within function


254-254: Use key in dict instead of key in dict.keys() (SIM118)

Remove .keys()


542-542: Use key in dict instead of key in dict.keys() (SIM118)

Remove .keys()


543-543: Use key in dict instead of key in dict.keys() (SIM118)

Remove .keys()

source/tests/common/dpmodel/test_output_def.py

482-482: Local variable context is assigned to but never used (F841)

Remove assignment to unused variable context


492-492: Local variable context is assigned to but never used (F841)

Remove assignment to unused variable context


496-496: Local variable context is assigned to but never used (F841)

Remove assignment to unused variable context


509-509: Local variable context is assigned to but never used (F841)

Remove assignment to unused variable context


522-522: Local variable context is assigned to but never used (F841)

Remove assignment to unused variable context


608-608: Do not use mutable data structures for argument defaults (B006)

Replace with None; initialize within function


609-609: Do not use mutable data structures for argument defaults (B006)

Replace with None; initialize within function


661-661: Local variable nall is assigned to but never used (F841)

Remove assignment to unused variable nall


693-693: Do not use mutable data structures for argument defaults (B006)

Replace with None; initialize within function

Additional comments not posted (32)
deepmd/pt/model/task/dos.py (1)

94-94: Correct spelling change from reduciable to reducible enhances consistency and correctness.

deepmd/infer/deep_dos.py (1)

51-51: Correct spelling change from reduciable to reducible enhances consistency and correctness.

deepmd/pt/model/task/denoise.py (1)

80-80: Correct spelling change from reduciable to reducible enhances consistency and correctness.

Also applies to: 87-87

deepmd/pt/model/task/invar_fitting.py (1)

151-151: Correct spelling change from reduciable to reducible enhances consistency and correctness.

deepmd/pt/model/task/dipole.py (2)

69-69: Corrected the spelling of "reducible" in the comments describing the properties of r_differentiable and c_differentiable.

Also applies to: 72-72


145-145: Corrected the spelling of "reducible" in the output_def method. This change aligns with the stated PR objectives and ensures consistency across the codebase.

source/tests/pt/model/test_linear_atomic_model_stat.py (1)

55-55: Corrected the spelling of "reducible" in the output_def method for both FooFittingA and FooFittingB classes. This change aligns with the stated PR objectives and ensures consistency across the codebase.

Also applies to: 107-107

source/tests/pt/model/test_dp_atomic_model.py (1)

174-174: Corrected the spelling of "reducible" in the test_excl_consistency method. This change aligns with the stated PR objectives and ensures consistency across the codebase.

deepmd/dpmodel/fitting/dipole_fitting.py (2)

79-79: Corrected the spelling of "reducible" in the comments describing the properties of r_differentiable and c_differentiable.

Also applies to: 82-82


175-175: Corrected the spelling of "reducible" in the output_def method. This change aligns with the stated PR objectives and ensures consistency across the codebase.

deepmd/pt/model/task/ener.py (2)

166-166: Corrected typo in the OutputVariableDef for "energy".


173-173: Corrected typo in the OutputVariableDef for "dforce".

deepmd/dpmodel/fitting/invar_fitting.py (1)

204-204: Corrected typo in the OutputVariableDef.

deepmd/pt/model/task/polarizability.py (1)

219-219: Corrected typo in the OutputVariableDef for "polarizability".

deepmd/dpmodel/atomic_model/base_atomic_model.py (1)

114-114: Corrected typo in the OutputVariableDef for "mask".

deepmd/dpmodel/fitting/polarizability_fitting.py (3)

Line range hint 75-117: Constructor logic for unsupported configurations is correctly implemented.


218-218: Spelling correction from reduciable to reducible is correctly applied.


Line range hint 218-333: The call method is well-structured and correctly implements the model computation logic.

deepmd/dpmodel/atomic_model/pairtab_atomic_model.py (1)

102-102: Spelling correction from reduciable to reducible is correctly applied.

source/tests/pt/model/test_atomic_model_atomic_stat.py (1)

Line range hint 1-400: The test cases are comprehensive and correctly test the functionality of atomic models.

deepmd/dpmodel/output_def.py (6)

68-68: Corrected spelling from reduciable to reducible.


169-169: Corrected spelling from reduciable to reducible in the class OutputVariableDef.

Also applies to: 195-195, 211-211


410-410: Corrected spelling from reduciable to reducible and made logical adjustments in the do_reduce function.

Also applies to: 415-415


432-432: Corrected spelling from reduciable to reducible in the do_mask function.

Also applies to: 442-442


461-461: Corrected spelling from reduciable to reducible and made logical adjustments in the do_derivative function.

Also applies to: 473-473, 488-488, 498-498


173-173: Ensure consistency in the logical conditions related to reducible and atomic.

Also applies to: 216-216

source/tests/pt/model/test_atomic_model_global_stat.py (3)

60-60: Corrected typo in the attribute name enhances code readability and consistency.


67-67: Typo correction aligns with the project's standards for attribute names.


74-74: Spelling correction ensures consistency in attribute naming across the module.

deepmd/pt/model/atomic_model/linear_atomic_model.py (1)

296-296: Corrected attribute name spelling improves consistency and readability.

deepmd/pt/model/atomic_model/base_atomic_model.py (1)

179-179: Corrected the typo from 'reduciable' to 'reducible' in the atomic_output_def method.

source/tests/common/dpmodel/test_output_def.py (1)

43-43: Corrected the typo from 'reduciable' to 'reducible' in various test definitions.

Also applies to: 52-52, 61-61, 70-70, 78-78, 104-108, 163-167


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Outside diff range and nitpick comments (26)
deepmd/pt/model/task/dos.py (2)

Line range hint 48-48: Avoid mutable default arguments as they can lead to unexpected behaviors.

- neuron: List[int] = [128, 128, 128],
+ neuron: Optional[List[int]] = None,

And in the constructor, add:

if neuron is None:
    neuron = [128, 128, 128]

Line range hint 58-58: Avoid mutable default arguments for the same reasons as above.

- exclude_types: List[int] = [],
+ exclude_types: Optional[List[int]] = None,

And in the constructor, add:

if exclude_types is None:
    exclude_types = []
deepmd/pt/model/task/denoise.py (1)

Line range hint 32-32: Avoid mutable default arguments as they can lead to unexpected behaviors.

- prefactor=[0.5, 0.5],
+ prefactor: Optional[List[float]] = None,

And in the constructor, add:

if prefactor is None:
    prefactor = [0.5, 0.5]
deepmd/pt/model/task/invar_fitting.py (1)

Line range hint 89-89: Avoid mutable default arguments as they can lead to unexpected behaviors.

- neuron: List[int] = [128, 128, 128],
+ neuron: Optional[List[int]] = None,

And in the constructor, add:

if neuron is None:
    neuron = [128, 128, 128]

Also applies to: 99-99

deepmd/pt/model/task/dipole.py (1)

Line range hint 82-82: Avoid using mutable default arguments for function parameters.

- neuron: List[int] = [128, 128, 128],
- exclude_types: List[int] = [],
+ neuron: Optional[List[int]] = None,
+ exclude_types: Optional[List[int]] = None,

Initialize these in the function body to ensure they are created fresh on each function call. This prevents potential bugs related to mutable defaults being shared across multiple calls.

Also applies to: 91-91

source/tests/pt/model/test_linear_atomic_model_stat.py (1)

Line range hint 179-179: Remove assignment to unused variable f.

- with h5py.File(h5file, "w") as f:
+ with h5py.File(h5file, "w"):

This change removes the unused variable, adhering to clean code practices and preventing potential confusion about its purpose.

deepmd/dpmodel/fitting/dipole_fitting.py (1)

Line range hint 92-92: Avoid using mutable default arguments for function parameters.

- neuron: List[int] = [120, 120, 120],
- exclude_types: List[int] = [],
+ neuron: Optional[List[int]] = None,
+ exclude_types: Optional[List[int]] = None,

Initialize these in the function body to ensure they are created fresh on each function call. This prevents potential bugs related to mutable defaults being shared across multiple calls.

Also applies to: 105-105

deepmd/pt/model/task/ener.py (1)

Line range hint 50-50: Avoid using mutable default arguments in function definitions.

- neuron: List[int] = [128, 128, 128],
+ neuron: Optional[List[int]] = None,

And then initialize within the function:

if neuron is None:
    neuron = [128, 128, 128]
deepmd/dpmodel/fitting/invar_fitting.py (1)

Line range hint 120-120: Avoid using mutable default arguments in function definitions.

- neuron: List[int] = [120, 120, 120],
+ neuron: Optional[List[int]] = None,

And then initialize within the function:

if neuron is None:
    neuron = [120, 120, 120]

Also applies to: 135-135

deepmd/pt/model/task/polarizability.py (1)

Line range hint 86-86: Avoid using mutable default arguments in function definitions.

- neuron: List[int] = [128, 128, 128],
+ neuron: Optional[List[int]] = None,

And then initialize within the function:

if neuron is None:
    neuron = [128, 128, 128]

Also applies to: 95-95

deepmd/dpmodel/atomic_model/base_atomic_model.py (2)

Line range hint 40-40: Avoid using mutable default arguments in function definitions.

- atom_exclude_types: List[int] = [],
- pair_exclude_types: List[Tuple[int, int]] = [],
+ atom_exclude_types: Optional[List[int]] = None,
+ pair_exclude_types: Optional[List[Tuple[int, int]]] = None,

And then initialize within the function:

if atom_exclude_types is None:
    atom_exclude_types = []
if pair_exclude_types is None:
    pair_exclude_types = []

Also applies to: 41-41, 87-87, 97-97


Line range hint 201-201: Use key in dict instead of key in dict.keys().

- if key in self.bias_keys.keys():
+ if key in self.bias_keys:

Also applies to: 247-247

deepmd/dpmodel/fitting/polarizability_fitting.py (1)

Line range hint 97-97: Replace mutable default arguments with immutable defaults in the constructor.

- neuron: List[int] = [120, 120, 120],
+ neuron: Optional[List[int]] = None,

- trainable: Optional[List[bool]] = None,
+ trainable: Optional[List[bool]] = None,

Initialize these within the function if they are None.

Also applies to: 110-110

source/tests/pt/model/test_atomic_model_atomic_stat.py (1)

Line range hint 171-171: Remove assignment to unused variable f in the test cases.

- with h5py.File(h5file, "w") as f:
+ with h5py.File(h5file, "w"):

Also applies to: 341-341

source/tests/pt/model/test_atomic_model_global_stat.py (2)

Line range hint 173-173: Remove the unused variable to clean up the code.

- f = ...

Line range hint 490-490: Remove the unused variable to enhance code cleanliness.

- at = ...
deepmd/pt/model/atomic_model/base_atomic_model.py (7)

Line range hint 80-80: Replace mutable default arguments with None to avoid potential bugs.

- atom_exclude_types: List[int] = [],
+ atom_exclude_types: Optional[List[int]] = None,

Line range hint 81-81: Replace mutable default arguments with None to avoid potential bugs.

- pair_exclude_types: List[Tuple[int, int]] = [],
+ pair_exclude_types: Optional[List[Tuple[int, int]]] = None,

Line range hint 129-129: Replace mutable default arguments with None to avoid potential bugs.

- exclude_types: List[int] = [],
+ exclude_types: Optional[List[int]] = None,

Line range hint 139-139: Replace mutable default arguments with None to avoid potential bugs.

- exclude_types: List[Tuple[int, int]] = [],
+ exclude_types: Optional[List[Tuple[int, int]]] = None,

Line range hint 254-254: Simplify dictionary key checking by removing .keys().

- if kk in self.bias_keys.keys():
+ if kk in self.bias_keys:

Line range hint 542-542: Simplify dictionary key checking by removing .keys().

- if kk in out_bias.keys():
+ if kk in out_bias:

Line range hint 543-543: Simplify dictionary key checking by removing .keys().

- if kk in out_std.keys():
+ if kk in out_std:
source/tests/common/dpmodel/test_output_def.py (3)

Line range hint 608-608: Replace mutable default arguments with None to avoid potential bugs.

- shape_rd=[nf, 1],
- shape_dr=[nf, nall, 1, 3],
+ shape_rd=None,
+ shape_dr=None,

Initialize shape_rd and shape_dr within the constructor if they are None.

Also applies to: 609-609, 693-693


Line range hint 482-482: Remove unused variable context in exception handling.

- with self.assertRaises(ValueError) as context:
+ with self.assertRaises(ValueError):

Also applies to: 492-492, 496-496, 509-509, 522-522


Line range hint 661-661: Remove unused variable nall.

- nall = 4

Copy link

codecov bot commented Jun 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.74%. Comparing base (e2b659a) to head (9a9b941).
Report is 118 commits behind head on devel.

Additional details and impacted files
@@            Coverage Diff             @@
##            devel    #3888      +/-   ##
==========================================
+ Coverage   82.71%   82.74%   +0.02%     
==========================================
  Files         517      518       +1     
  Lines       50139    50215      +76     
  Branches     2984     2984              
==========================================
+ Hits        41472    41548      +76     
  Misses       7757     7757              
  Partials      910      910              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wanghan-iapcm wanghan-iapcm added this pull request to the merge queue Jun 21, 2024
Merged via the queue into deepmodeling:devel with commit 82e685d Jun 21, 2024
60 checks passed
mtaillefumier pushed a commit to mtaillefumier/deepmd-kit that referenced this pull request Sep 18, 2024
Fix the spelling as suggested by
deepmodeling#3867 (comment).

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Bug Fixes**
- Corrected typos in attribute names from `reduciable` to `reducible`
across multiple files, enhancing the accuracy of parameter definitions
and improving code consistency.

- **Tests**
- Updated test cases to reflect the corrected attribute names, ensuring
that tests accurately validate the new `reducible` parameter.

These changes improve the clarity and correctness of the codebase,
ensuring that attribute names are consistent and accurately reflect
their intended functionality.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants