FAIRmat-NFDI / nomad-perovskite-solar-cells-database

A NOMAD plugin containing the schema for the Perovskite Solar Cell Database.
https://fairmat-nfdi.github.io/nomad-perovskite-solar-cells-database/
Apache License 2.0
4 stars 1 forks source link

Extending plugin to tandem solar cells #31

Open fabianschoeppach opened 2 weeks ago

fabianschoeppach commented 2 weeks ago

PR to track work on issue #8 - extending plugin to tandem solar cells.

Tasks:

sourcery-ai[bot] commented 2 weeks ago

Reviewer's Guide by Sourcery

This PR extends the existing plugin to support tandem solar cells by introducing new schema definitions and parsers. The implementation follows a modular approach, defining separate schema packages for different components of tandem solar cells (layers, measurements, references) and a parser to handle Excel-based data input. The schema is designed to capture detailed information about tandem solar cell architectures, including layer stacks, material compositions, and synthesis processes.

Class diagram for Tandem Solar Cell Schema

classDiagram
    class PerovskiteTandemSolarCell {
        +General general
        +Reference reference
        +Layer[] layer_stack
    }

    class General {
        +String architecture
        +int number_of_terminals
        +int number_of_junctions
        +int number_of_cells
        +String[] photoabsorber
        +float[] photoabsorber_bandgaps
        +float area
        +float area_measured
        +bool flexibility
        +bool semitransparent
        +bool contains_textured_layers
        +bool contains_antireflectie_coating
        +SubCell[] subcell
    }

    class Reference {
        +int ID_temp
        +int ID
        +String free_text_comment
        +String name_of_person_entering_the_data
        +bool data_entered_by_author
    }

    class Layer {
        +String name
        +String functionality
        +float thickness
        +float area
        +float surface_roughness
        +String origin
        +String supplier
        +String supplier_brand
        +Cleaning cleaning
        +Synthesis synthesis
        +Storage storage
        +Substance[] additives
    }

    class SubCell {
        +float area
        +bool module
        +bool commercial_unit
        +String supplier
    }

    class Synthesis {
        +SynthesisStep[] steps
    }

    class Cleaning {
        +CleaningStep[] steps
    }

    class Storage {
        +String atmosphere
        +float humidity_relative
        +float time_until_next_step
    }

    class Substance {
        +String name
        +String supplier
        +String purity
        +String concentration
        +float volume
        +float age
        +float temperature
    }

    PerovskiteTandemSolarCell --> General
    PerovskiteTandemSolarCell --> Reference
    PerovskiteTandemSolarCell --> Layer
    General --> SubCell
    Layer --> Cleaning
    Layer --> Synthesis
    Layer --> Storage
    Layer --> Substance

Class diagram for Tandem Parser

classDiagram
    class TandemParser {
        +parse(String mainfile, EntryArchive archive, BoundLogger logger, dict child_archives)
    }

    class EntryArchive {
        +data
    }

    TandemParser --> EntryArchive
    TandemParser : +parse()
    TandemParser : -cleanup_dataframe()
    TandemParser : -split_data()
    TandemParser : -convert_value()
    TandemParser : -partial_get()
    TandemParser : -exact_get()
    TandemParser : -extract_cleaning()
    TandemParser : -extract_additives()
    TandemParser : -extract_solvents()
    TandemParser : -extract_reactants()
    TandemParser : -extract_quenching_solvents()
    TandemParser : -extract_perovskite_composition()
    TandemParser : -extract_chalcopyrite_composition()
    TandemParser : -extract_alkali_doping()
    TandemParser : -extract_annealing()
    TandemParser : -extract_storage()
    TandemParser : -extract_reference()
    TandemParser : -extract_general()
    TandemParser : -extract_layer_stack()

File-Level Changes

Change Details Files
Added new schema package for tandem solar cells
  • Created base schema class PerovskiteTandemSolarCell with general information, reference, and layer stack sections
  • Defined comprehensive layer hierarchy (Layer, NonAbsorbingLayer, PhotoAbsorber, etc.)
  • Implemented material-specific layer classes (PerovskiteLayer, SiliconLayer, ChalcopyriteLayer)
  • Added support for composition tracking (ions, dopants, additives)
src/perovskite_tandem_database/schema_packages/schema.py
src/perovskite_tandem_database/schema_packages/tandem.py
Implemented Excel parser for tandem solar cell data
  • Created TandemParser class to handle Excel file parsing
  • Added support for extracting layer stack information
  • Implemented parsing of synthesis steps and cleaning procedures
  • Added utilities for data cleaning and value conversion
src/perovskite_tandem_database/parsers/tandemparser.py
src/perovskite_tandem_database/parsers/utils.py
Set up plugin entry points and package structure
  • Added parser entry point for Excel files
  • Created schema package entry point for tandem solar cells
  • Updated pyproject.toml with new entry points
pyproject.toml
src/perovskite_tandem_database/parsers/__init__.py
src/perovskite_tandem_database/schema_packages/__init__.py

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](https://app.sourcery.ai) 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 - [Contact our support team](mailto:support@sourcery.ai) for questions or feedback. - Visit our [documentation](https://docs.sourcery.ai) for detailed guides and information. - Keep in touch with the Sourcery team by following us on [X/Twitter](https://x.com/SourceryAI), [LinkedIn](https://www.linkedin.com/company/sourcery-ai/) or [GitHub](https://github.com/sourcery-ai).