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

43 add example notebooks #46

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

Conversation

Pepe-Marquez
Copy link
Contributor

@Pepe-Marquez Pepe-Marquez commented Jan 13, 2025

Summary by Sourcery

Add example notebooks demonstrating how to use the perovskite database and predict bandgap using CrabNet.

New Features:

  • Add example Jupyter notebooks for perovskite database usage and bandgap prediction with CrabNet.

Tests:

  • Added interactive prediction widget for testing different chemical formulas and comparing with dataset values.

@Pepe-Marquez Pepe-Marquez linked an issue Jan 13, 2025 that may be closed by this pull request
3 tasks
Copy link

sourcery-ai bot commented Jan 13, 2025

Reviewer's Guide by Sourcery

This pull request adds example notebooks demonstrating how to use the perovskite solar cell database. It includes a notebook for predicting the band gap of perovskites using CrabNet and data from the Perovskite Database in NOMAD. The notebook covers data retrieval, cleaning, model building, evaluation, and prediction. It also adds example uploads for the ions database.

Flow diagram of the CrabNet perovskite bandgap prediction workflow

graph TD
    A[Data Retrieval] -->|NOMAD API| B[Data Processing]
    B --> C[Data Cleaning]
    C --> D[Split Data]
    D -->|80%| E[Training Set]
    D -->|10%| F[Validation Set]
    D -->|10%| G[Test Set]
    E --> H[Train CrabNet Model]
    F --> I[Validate Model]
    G --> J[Test Model]
    H --> K[Final Model]
    K --> L[Predict Individual Formulas]

    subgraph Data Cleaning
    M[Remove NaNs] --> N[Group Repeated Formulas]
    N --> O[Check Element Prevalence]
    end
Loading

File-Level Changes

Change Details Files
Added example notebook for perovskite band gap prediction using CrabNet.
  • Fetched data from NOMAD API.
  • Cleaned and preprocessed the data.
  • Built and trained a CrabNet model.
  • Evaluated the model performance.
  • Added functionality for predicting band gap from individual formulas.
src/perovskite_solar_cell_database/example_uploads/perovskite_database/crabnet-perovskite-bandgap-prediction.ipynb
Added example uploads for the ions database.
  • Added entry point for ions database examples.
  • Included example XYZ files for ions.
src/perovskite_solar_cell_database/example_uploads/__init__.py
src/perovskite_solar_cell_database/example_uploads/ions_database/C2NH7S.xyz
src/perovskite_solar_cell_database/example_uploads/ions_database/CNH6.xyz

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @Pepe-Marquez - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@Pepe-Marquez
Copy link
Contributor Author

Pepe-Marquez commented Jan 13, 2025

@hampusnasstrom, the first two notebooks are going in. @siamakn was doing some cleaning of the perovskite database, so let's make sure we include him as a contributor in the PR. The pipelines are not passing at the moment because there are empty notebooks.

@hampusnasstrom
Copy link
Collaborator

@Pepe-Marquez ideally you would have added siamak as a co-author of the commit where you added the notebook but I can try to add him to the PR itself later. Just don't forget it before me merge.

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.

Add example notebooks
2 participants