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

Add cgnf embeddings #145

Merged
merged 3 commits into from
Jun 24, 2024
Merged

Add cgnf embeddings #145

merged 3 commits into from
Jun 24, 2024

Conversation

aronwalsh
Copy link
Member

@aronwalsh aronwalsh commented Jun 23, 2024

Pull Request Template

Description

  • Added cgnf embeddings
  • Included description in README for how to add an embedding scheme

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • [x ] New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Self-test (no new functions)

Reviewers

@AntObi

Checklist:

  • [ x] My code follows the style guidelines of this project
  • [ x] I have performed a self-review of my own code
  • [ x] I have commented my code, particularly in hard-to-understand areas
  • [ x] I have made corresponding changes to the documentation
  • [ x] My changes generate no new warnings
  • [ x] I have added tests that prove my fix is effective or that my feature works
  • [ x] New and existing unit tests pass locally with my changes
  • [ x] Any dependent changes have been merged and published in downstream modules
  • [ x] I have checked my code and corrected any misspellings

Summary by CodeRabbit

  • Documentation

    • Added instructions for adding a new embedding scheme in the README.md.
    • Updated descriptions for various elemental representation schemes in reference.md.
  • Bug Fixes

    • Corrected capitalization issues in core.py.
  • Chores

    • Updated requirements.txt and setup.py to restrict numpy version to below 2.

Copy link

coderabbitai bot commented Jun 23, 2024

Walkthrough

The changes introduce a new representation scheme to the project, outlining detailed steps for adding necessary files, updating documentation, and modifying configurations. Additionally, they correct entity names and apply version constraints to the numpy package to ensure compatibility.

Changes

Files Change Summaries
README.md Added detailed steps for adding a new representation scheme.
docs/reference.md Updated descriptions and sources for various elemental representation schemes.
src/elementembeddings/core.py Corrected capitalization for entity names and added "Cgnf".
src/elementembeddings/utils/config.py Added "cgnf" entry to the file paths and citations dictionaries.
requirements.txt, setup.py Added upper bound constraint for numpy package version.

Poem

In the realm of code so fine,
New schemes and steps entwine,
With capital fixed and paths replete,
Elemental cha-cha, so sweet!
Bound by numpy’s gentle reign,
Innovations flourish, free from pain.


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

@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: 1

Outside diff range and nitpick comments (3)
docs/reference.md (2)

Line range hint 55-55: Markdown formatting issue: Trailing spaces

Please remove the trailing spaces at the end of the line to adhere to Markdown best practices.

- <details>
+ <details>
Tools
LanguageTool

[uncategorized] ~3-~3: This verb does not appear to agree with the subject. Consider using a different form. (AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)
Context: ... The data contained in this repository are a collection of various elemental repre...


Line range hint 64-64: Markdown formatting issue: Lists should be surrounded by blank lines

Ensure that lists are surrounded by blank lines to adhere to Markdown best practices and improve readability.

- <details>
+ 
+ <details>
+ 

Also applies to: 144-144

Tools
LanguageTool

[uncategorized] ~3-~3: This verb does not appear to agree with the subject. Consider using a different form. (AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)
Context: ... The data contained in this repository are a collection of various elemental repre...

src/elementembeddings/core.py (1)

Line range hint 252-252: Recommendation to add stacklevel in warning

It is a good practice to specify the stacklevel when issuing warnings to help users understand where exactly in their code the issue originates.

- warnings.warn(
+ warnings.warn("Embedding is already standardised. Returning None and not changing the embedding.", stacklevel=2)
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between b4f5182 and ef5807d.

Files selected for processing (4)
  • README.md (1 hunks)
  • docs/reference.md (5 hunks)
  • src/elementembeddings/core.py (1 hunks)
  • src/elementembeddings/utils/config.py (2 hunks)
Additional context used
LanguageTool
docs/reference.md

[uncategorized] ~3-~3: This verb does not appear to agree with the subject. Consider using a different form. (AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)
Context: ... The data contained in this repository are a collection of various elemental repre...


[uncategorized] ~36-~36: When ‘Materials-Agnostic’ is used as a modifier, it is usually spelled with a hyphen. (SPECIFIC_HYPHEN)
Context: ...wing paper describes the details of the Materials Agnostic Platform for Informatics and Exploratio...

README.md

[uncategorized] ~24-~24: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ... these involve the use of deep learning techniques where the representation of the element...


[uncategorized] ~34-~34: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...mbeddings's main feature, the Embedding class is accessible by importing the class. ...


[uncategorized] ~140-~140: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...ing through the embedding and stats arguments respectively. ```python from elementem...

Markdownlint
docs/reference.md

55-55: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces


64-64: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines


144-144: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines

README.md

172-172: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines

Ruff
src/elementembeddings/core.py

252-252: No explicit stacklevel keyword argument found (B028)

Additional comments not posted (5)
src/elementembeddings/utils/config.py (2)

16-16: Addition of new embedding entry is correct

The addition of the "cgnf": "cgnf.json" entry to DEFAULT_ELEMENT_EMBEDDINGS correctly follows the existing pattern for embedding paths and aligns with the PR's objective to introduce cgnf embeddings.


150-159: Correct addition of citation details for 'cgnf'

The citation details for the newly added 'cgnf' embedding have been correctly added to the CITATIONS dictionary. The format adheres to the existing citation style and provides comprehensive reference information.

docs/reference.md (1)

27-33: New section for 'cgnf' correctly added

The addition of a new section for 'cgnf' in the vector representations is well-documented. The references and data source links are correctly formatted and provide useful information for users wanting to understand or utilize the 'cgnf' embedding.

README.md (1)

169-176: Clear instructions for adding an embedding scheme

The steps provided for adding a new embedding scheme are clear and comprehensive. This documentation will assist users in contributing new embedding schemes to the project effectively.

Tools
Markdownlint

172-172: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines

src/elementembeddings/core.py (1)

63-63: Proper addition of 'Cgnf' to embedding options

The addition of 'Cgnf' to the list of available embeddings in the load_data method is correctly implemented. This change allows users to easily load the 'Cgnf' data using the established interface.

### Add an embedding scheme

The steps required to add a new representation scheme are:
1. Add data file to [data/element_representations](src/elementembeddings/data/element_representations).
Copy link

Choose a reason for hiding this comment

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

Markdown formatting issue: Lists should be surrounded by blank lines

Ensure that lists are surrounded by blank lines to adhere to Markdown best practices and improve readability.

- 1. Add data file to [data/element_representations](src/elementembeddings/data/element_representations).
+ 
+ 1. Add data file to [data/element_representations](src/elementembeddings/data/element_representations).
+ 
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
1. Add data file to [data/element_representations](src/elementembeddings/data/element_representations).
1. Add data file to [data/element_representations](src/elementembeddings/data/element_representations).
Tools
Markdownlint

172-172: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between ef5807d and 2aca91f.

Files selected for processing (1)
  • src/elementembeddings/utils/config.py (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • src/elementembeddings/utils/config.py

Copy link

codecov bot commented Jun 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.55%. Comparing base (c5e0608) to head (4a83614).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #145   +/-   ##
=======================================
  Coverage   92.55%   92.55%           
=======================================
  Files          12       12           
  Lines        1047     1047           
=======================================
  Hits          969      969           
  Misses         78       78           

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

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 2aca91f and 4a83614.

Files selected for processing (2)
  • requirements.txt (1 hunks)
  • setup.py (1 hunks)
Files skipped from review due to trivial changes (2)
  • requirements.txt
  • setup.py

@AntObi AntObi merged commit 6a91582 into main Jun 24, 2024
15 checks passed
@AntObi AntObi deleted the cgnf branch June 24, 2024 09:47
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