Skip to content

Commit

Permalink
Fixes entry_type
Browse files Browse the repository at this point in the history
  • Loading branch information
sherjeelshabih committed Nov 28, 2024
1 parent ca4221c commit 489e22c
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/perovskite_solar_cell_database/llm_extraction_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,18 +515,16 @@ class LLMExtractedPerovskiteSolarCell(PublicationReference, SectionRevision, Sch

# normalizer that reorderes the layers according to the layer_order
def normalize(self, archive, logger):
if not self.layer_order:
return
if self.layer_order:
layer_dict = {layer.name: layer for layer in self.layers}
ordered_names = [name.strip() for name in self.layer_order.split(',')]

layer_dict = {layer.name: layer for layer in self.layers}
ordered_names = [name.strip() for name in self.layer_order.split(',')]
if set(ordered_names) != set(layer_dict.keys()):
logger.warn('The names in layer_order does not match available layers')
return

if set(ordered_names) != set(layer_dict.keys()):
logger.warn('The names in layer_order does not match available layers')
return

# Reorder in single pass
self.layers = [layer_dict[name] for name in ordered_names]
# Reorder in single pass
self.layers = [layer_dict[name] for name in ordered_names]
super().normalize(archive, logger)


Expand Down

0 comments on commit 489e22c

Please sign in to comment.