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

Update band interpolation #56

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Update band interpolation #56

wants to merge 7 commits into from

Conversation

kavanase
Copy link
Member

@kavanase kavanase commented Jan 14, 2025

Just a small PR which switches from using pcolormesh to imshow in plotting, which then makes use of built-in interpolation and reduces some of the graininess of plotted grids mentioned in #55

Summary by CodeRabbit

  • Documentation

    • Fixed a minor grammatical error in documentation for crystalline silicon unfolding process
    • Updated comment clarity in spectral function plotting method
  • Improvements

    • Modified spectral function visualization technique using imshow for better rendering
    • Enhanced parameter handling in plotting methods for clarity and consistency
    • Updated exception handling configuration for stricter checks on caught exceptions

Copy link

coderabbitai bot commented Jan 14, 2025

Warning

Rate limit exceeded

@kavanase has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 25 minutes and 47 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

📥 Commits

Reviewing files that changed from the base of the PR and between 6adba6e and 39147d1.

📒 Files selected for processing (1)
  • .github/workflows/ci.yaml (3 hunks)

Walkthrough

The pull request introduces a minor textual correction in the documentation for the unfolding process of crystalline silicon, fixing a typographical error. Additionally, updates are made to the plot_dos and plot_spectral_function methods in the easyunfold/plotting.py file, including a change in the parameter order for plot_dos, a shift from pcolormesh to imshow in plot_spectral_function, and clarifications in comments and method calls. The changes enhance clarity in the code without altering functionality.

Changes

File Change Summary
docs/examples/example_si222.md Corrected typo: "with out" → "without" in documentation text
easyunfold/plotting.py Updated plot_dos method parameter order and handling of dos_options.
Modified plot_spectral_function method:
- Replaced ax_.pcolormesh with ax_.imshow for rendering.
- Updated shading from auto to gouraud.
- Revised comments for clarity.
- Adjusted method calls to reflect new parameter order.
.pylintrc Updated overgeneral-exceptions to include both builtins.BaseException and builtins.Exception for stricter exception handling checks.

Poem

🐰 In the world of code, a small delight,
A typo fixed, now shining bright!
From pcolormesh to imshow's grace,
Clarity found in every place.
With each small change, we hop along! 🌟


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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using 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 generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration 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

codecov bot commented Jan 15, 2025

Codecov Report

Attention: Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.

Project coverage is 0.00%. Comparing base (7f772bf) to head (39147d1).

Files with missing lines Patch % Lines
easyunfold/plotting.py 0.00% 8 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main     #56   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files         10      10           
  Lines       2055    2057    +2     
=====================================
- Misses      2055    2057    +2     

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

@kavanase
Copy link
Member Author

kavanase commented Feb 7, 2025

@zhubonan are you happy for me to merge this?
I will update the version number too. There is also #55 to be dealt with

@zhubonan
Copy link
Contributor

zhubonan commented Feb 9, 2025

I think the use of pcolormesh was due to it supporting none-regular mesh, which would be the case here as the k-points may not have uniform spacing the reciprocal space.

@kavanase
Copy link
Member Author

kavanase commented Feb 9, 2025

Ah ok, fair enough.

I've updated this to:

  • Add a comment on why pcolormesh is used to prevent future confusion / easier maintenance
  • Reverted to pcolormesh but updating shading to 'gouraud' which gives better interpolation (see here).

Small differences, but for comparison:
This is the NaBiS2 example with the default easyunfold unfold plot, with previous shading='auto':
NaBiS2_default_plot_shading_auto

With added shading='gouraud':
NaBiS2_default_plot_shading_gouraud

(Less grainy)

Copy link

@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

🧹 Nitpick comments (1)
.pylintrc (1)

425-426: LGTM! Enhanced exception handling checks.

The expanded configuration will now warn about catching both builtins.BaseException and builtins.Exception, encouraging the use of more specific exception types. This is a good practice as it:

  • Prevents accidentally catching too many exceptions
  • Makes error handling more explicit and maintainable
  • Helps identify and handle specific error cases appropriately

When catching exceptions, prefer using specific exception types that match your error cases. For example:

try:
    # Some file operation
except FileNotFoundError:
    # Handle missing file
except PermissionError:
    # Handle permission issues
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between afa9e17 and 6adba6e.

📒 Files selected for processing (2)
  • .pylintrc (1 hunks)
  • easyunfold/plotting.py (6 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • easyunfold/plotting.py
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: build (3.11)
  • GitHub Check: build (3.10)
  • GitHub Check: pre-commit
  • GitHub Check: build (3.9)
  • GitHub Check: build (3.11)
  • GitHub Check: build (3.10)
  • GitHub Check: build (3.9)
  • GitHub Check: pre-commit

@kavanase
Copy link
Member Author

@zhubonan codecov isn't detecting the tests directory, giving a coverage of zero. Previously it detected it with the __init__.py file in tests, but this causes some other issues when installing. I think it's likely just an issue of setting something in a configuration file / on codecov settings (but I've never used it)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants