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

Xenonpy embeddings #141

Merged
merged 10 commits into from
Jun 3, 2024
Merged

Xenonpy embeddings #141

merged 10 commits into from
Jun 3, 2024

Conversation

AntObi
Copy link
Collaborator

@AntObi AntObi commented May 30, 2024

XenonPy descriptors

Description

This PR adds the 58 element descriptors which are commonly used in works based on the XenonPy package

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

Reviewers

Checklist:

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

Summary by CodeRabbit

  • New Features

    • Added tracking of execution times and feature vector computation in the composition example notebook.
    • Introduced support for loading Crystallm and XenonPy embeddings in the data loading function.
    • Added a new section on XenonPy embeddings in the documentation.
  • Bug Fixes

    • Commented out specific test decorators to resolve issues in the plotting tests.
  • Chores

    • Added "typing-extensions" to the list of dependencies in the setup configuration.

Copy link

coderabbitai bot commented May 30, 2024

Walkthrough

The recent updates across various files introduce new functionalities and enhancements to the elementembeddings project. Key changes include the addition of ExecuteTime metadata in a Jupyter notebook, support for Crystallm and XenonPy embeddings in data loading, updates to configuration files, and a new dependency on typing-extensions. These modifications improve execution tracking, expand embedding capabilities, and ensure compatibility with type extensions.

Changes

Files/Paths Change Summary
examples/composition.ipynb Added ExecuteTime metadata to code cells and a new cell for computing feature vectors.
src/elementembeddings/core.py Enhanced load_data function to support Crystallm and XenonPy embeddings.
.../data/element_representations/README.md Added a section on XenonPy embedding with 58 features.
src/elementembeddings/utils/config.py Updated configuration to include xenonpy entries in dictionaries.
src/elementembeddings/tests/test_plotter.py Commented out @pytest.mark.mpl_image_compare decorators for two test methods.
setup.py Added typing-extensions to the list of dependencies.

Sequence Diagram(s) (Beta)

sequenceDiagram
    participant User
    participant Notebook
    participant Core
    participant Config

    User->>Notebook: Run code cell
    Notebook->>Notebook: Record ExecuteTime metadata
    Notebook->>Core: Request feature vector computation
    Core->>Config: Load embedding configurations
    Config-->>Core: Return embedding settings
    Core-->>Notebook: Provide feature vector
    Notebook-->>User: Display feature vector
Loading

Poem

In a world of code, so bright and clear,
New embeddings we now hold dear.
Crystallm and XenonPy join the fray,
Enhancing features in a brilliant way.
With typing extensions, dependencies align,
Our project evolves, refined and divine.
🐇✨


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: 2

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 9654e09 and cfa197a.

Files ignored due to path filters (1)
  • src/elementembeddings/data/element_representations/xenonpy_element_features.csv is excluded by !**/*.csv
Files selected for processing (4)
  • examples/composition.ipynb (9 hunks)
  • src/elementembeddings/core.py (1 hunks)
  • src/elementembeddings/data/element_representations/README.md (1 hunks)
  • src/elementembeddings/utils/config.py (2 hunks)
Files skipped from review due to trivial changes (1)
  • src/elementembeddings/utils/config.py
Additional context used
LanguageTool
src/elementembeddings/data/element_representations/README.md

[style] ~3-~3: ‘A majority of’ might be wordy. Consider a shorter alternative.
Context: ...urce for which the files were obtained. A majority of these representations have been obtaine...


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

Markdownlint
src/elementembeddings/data/element_representations/README.md

48-48: Expected: 0 or 2; Actual: 1
Trailing spaces


57-57: null
Lists should be surrounded by blank lines


139-139: null
Lists should be surrounded by blank lines


170-170: null
Files should end with a single newline character

Additional comments not posted (3)
examples/composition.ipynb (2)

64-69: The addition of a cell to print individual element feature vectors enhances the notebook's interactivity and educational value.


6-11: Ensure that the execution time metadata is accurate and consistent across all cells.

Also applies to: 39-44, 64-69, 87-92, 111-116, 162-167, 174-188, 192-197, 224-229, 240-245, 270-275

Verification successful

The execution time metadata is present and consistent across multiple cells in the notebook. Each cell has both start_time and end_time fields, and the timestamps appear to be in a logical sequence.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the consistency of execution time metadata across all cells.

# Test: Search for inconsistencies in execution time metadata. Expect: No inconsistencies.
rg --type json $'\"ExecuteTime\":'

Length of output: 33



Script:

#!/bin/bash
# Description: Extract all cells and their metadata from the Jupyter notebook and verify the consistency of "ExecuteTime" metadata.

# Extract all cells and their metadata
jq '.cells[] | {cell_type, metadata}' examples/composition.ipynb > cells_metadata.json

# Verify the consistency of "ExecuteTime" metadata
jq 'select(.metadata.ExecuteTime != null) | .metadata.ExecuteTime' cells_metadata.json

Length of output: 1254

src/elementembeddings/core.py (1)

61-62: The addition of Crystallm and XenonPy to the supported embeddings enhances the flexibility and utility of the load_data function.

Comment on lines 168 to 170
### XenonPy

The XenonPy embedding uses the 58 features which are commonly used in publications that use the [XenonPy package](.
Copy link

Choose a reason for hiding this comment

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

Add a complete URL for the XenonPy package to enhance the documentation.

- The XenonPy embedding uses the 58 features which are commonly used in publications that use the [XenonPy package](.
+ The XenonPy embedding uses the 58 features which are commonly used in publications that use the [XenonPy package](https://example.com/xenonpy).

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.

Suggested change
### XenonPy
The XenonPy embedding uses the 58 features which are commonly used in publications that use the [XenonPy package](.
### XenonPy
The XenonPy embedding uses the 58 features which are commonly used in publications that use the [XenonPy package](https://example.com/xenonpy).


### XenonPy

The XenonPy embedding uses the 58 features which are commonly used in publications that use the [XenonPy package](.
Copy link

Choose a reason for hiding this comment

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

Ensure the file ends with a newline character for consistency and to adhere to POSIX standards.

+ 

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.

Suggested change
The XenonPy embedding uses the 58 features which are commonly used in publications that use the [XenonPy package](.
The XenonPy embedding uses the 58 features which are commonly used in publications that use the [XenonPy package](.

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 cfa197a and 636e33c.

Files ignored due to path filters (4)
  • baseline/test_dimension_2d_plotter_pca.png is excluded by !**/*.png
  • baseline/test_dimension_2d_plotter_tsne.png is excluded by !**/*.png
  • baseline/test_dimension_2d_plotter_tsne_skipspecies.png is excluded by !**/*.png
  • baseline/test_dimension_3d_plotter_tsne_skipspecies.png is excluded by !**/*.png
Files selected for processing (1)
  • src/elementembeddings/tests/test_plotter.py (2 hunks)
Files skipped from review due to trivial changes (1)
  • src/elementembeddings/tests/test_plotter.py

Copy link

codecov bot commented May 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.55%. Comparing base (bf0bdee) to head (f5a0be9).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #141      +/-   ##
==========================================
- Coverage   92.56%   92.55%   -0.02%     
==========================================
  Files          12       12              
  Lines        1049     1047       -2     
==========================================
- Hits          971      969       -2     
  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

Outside diff range and nitpick comments (4)
src/elementembeddings/data/element_representations/README.md (4)

Line range hint 3-3: Consider revising "A majority of" to a more concise alternative like "Most".

- A majority of these representations have been obtained from the following repositories:
+ Most of these representations have been obtained from the following repositories:
Tools
Markdownlint

172-172: Expected: 0 or 2; Actual: 1
Trailing spaces


172-172: null
Lists should be surrounded by blank lines


Line range hint 29-29: Hyphenate "Materials Agnostic" when used as a modifier.

- Materials Agnostic Platform for Informatics and Exploration
+ Materials-Agnostic Platform for Informatics and Exploration
Tools
Markdownlint

172-172: Expected: 0 or 2; Actual: 1
Trailing spaces


172-172: null
Lists should be surrounded by blank lines


Line range hint 48-48: Remove trailing spaces to adhere to Markdown best practices.

- <details>
-     <summary>Click to see the 22 properties</summary>
+ <details>
+     <summary>Click to see the 22 properties</summary>
- * [Representation of materials by kernel mean embedding](https://journals.aps.org/prb/abstract/10.1103/PhysRevB.108.134107) 
+ * [Representation of materials by kernel mean embedding](https://journals.aps.org/prb/abstract/10.1103/PhysRevB.108.134107)

Also applies to: 172-172

Tools
Markdownlint

172-172: Expected: 0 or 2; Actual: 1
Trailing spaces


172-172: null
Lists should be surrounded by blank lines


Line range hint 57-57: Ensure lists are surrounded by blank lines for better readability and to comply with Markdown standards.

- * Number;
+ 
+ * Number;
- * Number
+ 
+ * Number
- * [Representation of materials by kernel mean embedding](https://journals.aps.org/prb/abstract/10.1103/PhysRevB.108.134107) 
+ 
+ * [Representation of materials by kernel mean embedding](https://journals.aps.org/prb/abstract/10.1103/PhysRevB.108.134107)

Also applies to: 139-139, 172-172

Tools
Markdownlint

172-172: Expected: 0 or 2; Actual: 1
Trailing spaces


172-172: null
Lists should be surrounded by blank lines

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 636e33c and 6f8e755.

Files selected for processing (2)
  • src/elementembeddings/data/element_representations/README.md (1 hunks)
  • src/elementembeddings/tests/test_plotter.py (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • src/elementembeddings/tests/test_plotter.py
Additional context used
LanguageTool
src/elementembeddings/data/element_representations/README.md

[style] ~3-~3: ‘A majority of’ might be wordy. Consider a shorter alternative.
Context: ...urce for which the files were obtained. A majority of these representations have been obtaine...


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

Markdownlint
src/elementembeddings/data/element_representations/README.md

48-48: Expected: 0 or 2; Actual: 1
Trailing spaces


172-172: Expected: 0 or 2; Actual: 1
Trailing spaces


57-57: null
Lists should be surrounded by blank lines


139-139: null
Lists should be surrounded by blank lines


172-172: null
Lists should be surrounded by blank lines

Additional comments not posted (1)
src/elementembeddings/data/element_representations/README.md (1)

170-173: The addition of the XenonPy section is well-documented and includes relevant publications. Ensure the URL provided is correct and accessible.

Tools
Markdownlint

172-172: Expected: 0 or 2; Actual: 1
Trailing spaces


172-172: null
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 6f8e755 and f5a0be9.

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

@AntObi AntObi merged commit 4224951 into main Jun 3, 2024
15 checks passed
@AntObi AntObi deleted the xenonpy_embeddings branch June 3, 2024 11:44
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.

1 participant