-
Notifications
You must be signed in to change notification settings - Fork 81
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
change assertion in test_m3gnet_site_transform #651
Conversation
WalkthroughThe recent changes enhance type-checking in the test suite for the Changes
Sequence Diagram(s)sequenceDiagram
participant Test as Test Suite
participant M3GNet as M3GNet Component
Test->>M3GNet: Run test_m3gnet_site_transform
M3GNet->>Test: Return atom_feat_dict
Test->>Test: Assert isinstance(atom_feat_dict, pd.DataFrame)
Test->>Test: Test passes if valid
Recent review detailsConfiguration used: .coderabbit.yaml Files selected for processing (1)
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this 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, codebase verification and nitpick comments (1)
tests/describers/test_m3gnet.py (1)
35-35
: Inconsistency intransform_one
return type and test assertionThe
transform_one
method insrc/maml/describers/_m3gnet.py
does not have a return type ofpd.DataFrame
, which contradicts the test assertion intests/describers/test_m3gnet.py
. This inconsistency should be addressed to ensure alignment between the implementation and the test expectations.
- File:
src/maml/describers/_m3gnet.py
- Method:
transform_one
Analysis chain
Verify the expected return type of
transform_one
.The assertion now checks if
atom_feat_dict
is apd.DataFrame
, indicating a change in the expected output type from a dictionary to a DataFrame. Ensure that thetransform_one
method inM3GNetSite
has been updated accordingly to return a DataFrame.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the `transform_one` method in `M3GNetSite` returns a DataFrame. # Test: Search for the `transform_one` method in `M3GNetSite` and check its return type. ast-grep --lang python --pattern $'class M3GNetSite { $$$ def transform_one($_) -> pd.DataFrame: $$$ $$$ }'Length of output: 626
Script:
#!/bin/bash # Description: Verify the return type of the `transform_one` method in the `M3GNetSite` class. # Search for the `transform_one` method definition and check its return type annotation. ast-grep --lang python --pattern 'def transform_one($_) -> pd.DataFrame:' --search-inside-class M3GNetSiteLength of output: 347
Script:
#!/bin/bash # Description: Search for the `transform_one` method and check its return type annotation. # Search for the `transform_one` method definition in the codebase. ast-grep --lang python --pattern 'def transform_one($_):' -A 5Length of output: 64
Script:
#!/bin/bash # Description: Use ripgrep to search for the `transform_one` method across the codebase. # Search for the `transform_one` method definition in the codebase. rg 'def transform_one' -A 5Length of output: 7638
Summary
Change the assertion in test_m3gnet_site_transform to fix the error.
Checklist
ruff
.mypy
.duecredit
@due.dcite
decorators to reference relevant papers by DOI (example)Tip: Install
pre-commit
hooks to auto-check types and linting before every commit: