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

Adding a new search app with specific filter for the Perovskite Database entries #41

Merged
merged 17 commits into from
Dec 13, 2024

Conversation

Pepe-Marquez
Copy link
Contributor

@Pepe-Marquez Pepe-Marquez commented Dec 4, 2024

Summary by Sourcery

Add a new search application for the Perovskite Solar Cell Database with specific filtering capabilities, update the schema for better data handling, and ensure the application is correctly integrated and tested.

New Features:

  • Introduce a new search application for the Perovskite Solar Cell Database, allowing users to search and filter database entries with specific criteria.

Enhancements:

  • Change the data type of the 'band_gap_graded' field from string to boolean in the Perovskite schema to improve data accuracy and consistency.

Build:

  • Add a new entry point for the Perovskite Solar Cell Database application in the project's configuration file.

Tests:

  • Add a test to ensure the new Perovskite Solar Cell Database application can be imported without errors, verifying the integrity of the pydantic model validation.

@Pepe-Marquez Pepe-Marquez linked an issue Dec 4, 2024 that may be closed by this pull request
5 tasks
Copy link

sourcery-ai bot commented Dec 4, 2024

Reviewer's Guide by Sourcery

This PR adds a new search application specifically for the Perovskite Database entries. The implementation includes a comprehensive UI configuration with various search filters, visualization options, and data columns. Additionally, it includes a minor schema update to change the band_gap_graded field from string to boolean type.

ER diagram for the Perovskite schema update

erDiagram
    Perovskite {
        bool band_gap_graded
        string band_gap_estimation_basis
    }
Loading

Class diagram for the new Perovskite Database App

classDiagram
    class App {
        +String label
        +String path
        +String category
        +String description
        +SearchQuantities search_quantities
        +List~Column~ columns
        +Menu menu
        +Dashboard dashboard
        +Map~String, List~String~ filters_locked
    }
    class Column {
        +String quantity
        +Boolean selected
        +String label
        +Map~String, Object~ format
        +String unit
    }
    class Menu {
        +List~MenuItem~ items
    }
    class Dashboard {
        +Object widgets
    }
    class SearchQuantities {
        +List~String~ include
    }
    class MenuItem {
        +String title
        +MenuSizeEnum size
        +List~MenuItem~ items
    }
    class MenuItemTerms {
        +String search_quantity
        +Boolean show_input
        +Integer width
        +Integer options
        +String title
    }
    class MenuItemHistogram {
        +Axis x
        +AxisScale y
        +String title
        +Integer width
        +Boolean show_input
        +Integer nbins
    }
    class Axis {
        +String search_quantity
        +String title
        +String scale
        +String unit
    }
    class AxisScale {
        +ScaleEnum scale
    }
    App --> SearchQuantities
    App --> Column
    App --> Menu
    App --> Dashboard
    Menu --> MenuItem
    MenuItem <|-- MenuItemTerms
    MenuItem <|-- MenuItemHistogram
    MenuItemHistogram --> Axis
    MenuItemHistogram --> AxisScale
Loading

File-Level Changes

Change Details Files
Added a new search application for Perovskite Database entries
  • Created a new app entry point with specific description and configuration
  • Added extensive menu configuration with filters for publication, material properties, fabrication, device architecture, transport layers, and solar cell performance
  • Configured dashboard with periodic table widget
  • Set up detailed column definitions for search results display
src/perovskite_solar_cell_database/apps/__init__.py
src/perovskite_solar_cell_database/apps/perovskite_solar_cell_database_app.py
pyproject.toml
Modified the band_gap_graded field type in the schema
  • Changed field type from string to boolean
  • Updated component from EnumEditQuantity to BoolEditQuantity
  • Updated example data to use boolean value instead of string
src/perovskite_solar_cell_database/schema_sections/perovskite.py
tests/data/example.archive.json
Added test coverage for the new app
  • Created basic import test to verify app configuration validity
tests/apps/test_solar_perovskite_solar_cell_database_app.py

Possibly linked issues


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: 1 issue found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟡 Complexity: 1 issue found
  • 🟢 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 Pepe-Marquez self-assigned this Dec 5, 2024
@Pepe-Marquez
Copy link
Contributor Author

Pepe-Marquez commented Dec 5, 2024

@lauri-codes: this PR adds a new search page for the perovskite database with custom filters. I might add an additional section later, but I believe it's ready for you to start reviewing from your perspective. It should work with the current solar cell entries.

The PR also includes a search page for the ions database that we’ve compiled. To test the ions entries, you can drop the .xlsx file into the test/data folder. Additionally, I’ve updated the category of the apps.

Regarding the possibility of having the plots in the left panel: for instance, in the Publication section, we could have a plot of efficiency vs. publication date, with other topical plots in subsequent sections. This way, users would have pre-configured plots under different categories that they could push to the main dashboard with the plus button, serving as both a functional feature and a source of inspiration. However, I’m completely fine with it if you think this approach isn’t ideal.

After the first deployment, I could ask people from Eva's group to give feedback on the database.

Copy link
Collaborator

@lauri-codes lauri-codes left a comment

Choose a reason for hiding this comment

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

Few small comments, also played around with the apps a bit.

In "The Perovskite Solar Cell Database" you are loading 4 scatter plots into the dashboard: this takes a while, maybe test a bit to see that the initial loading time is reasonable.

In general, I see that you are using the menus more as an extension of the dashboard: maybe we should see if that is in general a direction where we want to go.

@Pepe-Marquez
Copy link
Contributor Author

@lauri-codes, I think it would be good to see how the 4 plots behave in production. I think if you agree we can try to deploy this and see. If not, I can try to reduce it to one or two plots in te dashboard. Would it be ok if we merge and try to deploy? @hampusnasstrom, is it also ok with you to dump the ions database in staging?

@hampusnasstrom
Copy link
Collaborator

I made a few small fixes in the llm-extraction-branch so I will pull those here as well.

@lauri-codes
Copy link
Collaborator

Yes, you can just deploy this and see how the scatter plots behave themselves in the oasis distro.

@hampusnasstrom hampusnasstrom merged commit 1fa1930 into main Dec 13, 2024
7 checks passed
@hampusnasstrom hampusnasstrom deleted the 18-new-search-apps branch December 13, 2024 16:34
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.

New search apps
3 participants