-
Notifications
You must be signed in to change notification settings - Fork 1
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
Llm extraction schema #32
base: main
Are you sure you want to change the base?
Conversation
Reviewer's Guide by SourceryThis PR introduces a new schema package for LLM (Large Language Model) extraction of perovskite solar cell data. The changes include modifications to the composition handling, addition of new schema classes for various solar cell components, and integration of a new app for exploring LLM-extracted data. Class diagram for LLM Extraction SchemaclassDiagram
class LLMSchemaExtractionPackageEntryPoint {
+load()
}
class PerovskiteIonComponent {
+coefficient: str
}
class Impurity {
+concentration: float
+a_eln: ELNAnnotation
}
class LLMExtractedPerovskiteSolarCell {
+DOI_number: str
+perovskite_composition: PerovskiteComposition
+device_architecture: MEnum
+pce: float
+jsc: float
+voc: float
+ff: float
+active_area: float
+number_devices: int
+averaged_quantities: bool
+light_source: LightSource
+bandgap: float
+encapsulated: bool
+stability: Stability
+layers: Layer
+layer_order: str
+normalize(archive, logger)
}
class PerovskiteComposition {
+abbreviation: str
+coefficient: str
}
class LightSource {
+type: MEnum
+description: str
+light_intensity: float
+lamp: str
}
class Stability {
+time: float
+light_intensity: float
+humidity: float
+temperature: float
+PCE_T80: float
+PCE_at_start: float
+PCE_after_1000_hours: float
+PCE_at_end: float
+potential_bias: MEnum
}
class Layer {
+name: str
+thickness: float
+functionality: MEnum
+deposition: ProcessingStep
+additional_treatment: str
}
class ProcessingStep {
+step_name: str
+method: str
+atmosphere: MEnum
+temperature: float
+duration: float
+gas_quenching: bool
+antisolvent_quenching: bool
+solution: ReactionSolution
+additional_parameters: JSON
}
class ReactionSolution {
+solutes: Solute
+volume: float
+temperature: float
+solvents: Solvent
}
class Solute {
+name: str
+concentration: float
+concentration_unit: MEnum
}
class Solvent {
+name: str
+ratio: float
}
LLMSchemaExtractionPackageEntryPoint --> PerovskiteIonComponent
LLMSchemaExtractionPackageEntryPoint --> Impurity
LLMSchemaExtractionPackageEntryPoint --> LLMExtractedPerovskiteSolarCell
LLMExtractedPerovskiteSolarCell --> PerovskiteComposition
LLMExtractedPerovskiteSolarCell --> LightSource
LLMExtractedPerovskiteSolarCell --> Stability
LLMExtractedPerovskiteSolarCell --> Layer
Layer --> ProcessingStep
ProcessingStep --> ReactionSolution
ReactionSolution --> Solute
ReactionSolution --> Solvent
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @sherjeelshabih - 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: 1 issue found
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
@@ -831,12 +831,10 @@ def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None: | |||
self.short_form += ion.abbreviation | |||
if ion.coefficient is None: | |||
continue | |||
if ion.coefficient == 1: | |||
if ion.coefficient == '1': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (code-quality): We've found these issues:
- Replace if statement with if expression (
assign-if-exp
) - Simplify conditional into switch-like form [×2] (
switch
)
if TYPE_CHECKING: | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (code-quality): Remove redundant conditional (remove-redundant-if
)
* feat: update schema to new LLM version * Added review base section which needs to be included in every section. * add additional field descriptions * Fixed typos and some other things --------- Co-authored-by: Pepe Marquez <[email protected]>
Co-authored-by: Hampus Näsström <[email protected]>
2ac210a
to
d144f3f
Compare
I got most of the suggestions implemented.
@hampusnasstrom antisolvent quenching is something you should give feedback on. Jesper's suggestion:
Summary by Sourcery
Introduce a new schema package and application for LLM extraction in the perovskite solar cell database, enhancing data extraction and user interaction capabilities. Update data types and units for existing fields to improve flexibility and accuracy.
New Features:
Enhancements: