-
Notifications
You must be signed in to change notification settings - Fork 23
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
Add cmap
option to doper plots
#285
Conversation
Warning Rate limit exceeded@AntObi has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 12 minutes and 7 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughThe Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Doper
participant get_dopants
participant plot_dopants
User->>Doper: call get_dopants(get_selectivity, group_by_charge)
Doper->>get_dopants: retrieve dopants
get_dopants-->>Doper: return nested dict by type and charge
Doper-->>User: return dopants
User->>Doper: call plot_dopants(cmap)
Doper->>plot_dopants: generate heatmap with cmap
plot_dopants-->>Doper: return visualisation
Doper-->>User: return heatmap
Poem
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 Configration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #285 +/- ##
========================================
Coverage 74.65% 74.65%
========================================
Files 24 24
Lines 2099 2099
========================================
Hits 1567 1567
Misses 532 532 ☔ View full report in Codecov by Sentry. |
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 (3)
smact/dopant_prediction/doper.py (3)
163-167
: Document the new parameters.The new parameters
get_selectivity
andgroup_by_charge
need to be documented in the method's docstring.+ Args: + num_dopants (int): The number of suggestions to return for n- and p-type dopants. + get_selectivity (bool): Whether to calculate the selectivity of the dopants. + group_by_charge (bool): Whether to group the dopants by charge.
168-170
: Document the return value.The return value format needs to be documented in the method's docstring.
+ Returns: + dict: Dopant suggestions, given as a dictionary with keys + "n_type_cation", "p_type_cation", "n_type_anion", "p_type_anion".
379-379
: Add parameter to docstring.The new
cmap
parameter should be included in the docstring.+ Args: + cmap (str): The colormap to use for the heatmap.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- smact/dopant_prediction/doper.py (3 hunks)
Additional comments not posted (1)
smact/dopant_prediction/doper.py (1)
405-405
: LGTM!The addition of the
cmap
parameter looks good and enhances the functionality.
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)
smact/dopant_prediction/doper.py (1)
Ensure proper documentation of new parameters.
The
cmap
parameter in theplot_dopants
method is not documented in the docstring. Please update the docstring to include a description of this new parameter.
- File:
smact/dopant_prediction/doper.py
- Line:
373-379
Analysis chain
Line range hint
376-384
:
Ensure proper documentation of new parameters.The
plot_dopants
method has a new parametercmap
. Ensure this parameter is well-documented in the docstring.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the documentation of the new `cmap` parameter in the `plot_dopants` method. # Test: Search for the `cmap` parameter in the docstring. Expect: Parameter is documented. rg --type python -A 5 $'def plot_dopants' | grep 'cmap'Length of output: 85
Script:
#!/bin/bash # Description: Verify the documentation of the new `cmap` parameter in the `plot_dopants` method. # Test: Search for the `cmap` parameter in the docstring. Expect: Parameter is documented. rg --lang py -A 5 $'def plot_dopants' | grep 'cmap'Length of output: 459
Script:
#!/bin/bash # Description: Verify the documentation of the new `cmap` parameter in the `plot_dopants` method. # Test: Search for the `cmap` parameter in the docstring. Expect: Parameter is documented. rg --type py -A 5 $'def plot_dopants' | grep 'cmap'Length of output: 134
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- smact/dopant_prediction/doper.py (3 hunks)
Additional comments not posted (3)
smact/dopant_prediction/doper.py (3)
Line range hint
167-183
:
Ensure proper documentation of new parameters.The
get_dopants
method has new parametersget_selectivity
andgroup_by_charge
. Ensure these parameters are well-documented in the docstring.Verification successful
Verification successful: The new parameters
get_selectivity
andgroup_by_charge
are properly documented in the docstring of theget_dopants
method.
get_selectivity (bool): Whether to calculate the selectivity of the dopants.
group_by_charge (bool): Whether to group the dopants by charge.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the documentation of new parameters in the `get_dopants` method. # Test: Search for the new parameters in the docstring. Expect: Parameters are documented. rg --type python -A 5 $'def get_dopants' | grep -E 'get_selectivity|group_by_charge'Length of output: 116
Script:
#!/bin/bash # Description: Verify the documentation of new parameters in the `get_dopants` method. # Test: Search for the new parameters in the docstring. Expect: Parameters are documented. rg --type py -A 5 $'def get_dopants' | grep -E 'get_selectivity|group_by_charge'Length of output: 193
Script:
#!/bin/bash # Description: Extract and display the docstring for the `get_dopants` method to verify the documentation of new parameters. # Extract the `get_dopants` method along with its docstring. rg --type py -A 50 $'def get_dopants' smact/dopant_prediction/doper.py | grep -E '"""|def get_dopants|get_selectivity|group_by_charge'Length of output: 412
Line range hint
402-406
:
LGTM! Ensure custom colormap functionality is tested.The code changes are approved. Ensure that the custom colormap functionality is tested.
174-247
: Ensure consistency in return data format.The method returns a nested dictionary structure. Verify that the new parameters do not impact the consistency of the returned data.
Pull Request Template
Description
Doper().plot_dopants
has acmap
argument to let users choose the colour of the heatmapsType of change
Please delete options that are not relevant.
How Has This Been Tested?
Test Configuration:
Reviewers
N/A
Checklist:
Summary by CodeRabbit
New Features
Improvements
get_dopants
method now returns results in a nested dictionary format.plot_dopants
method supports acmap
parameter to choose colormap.