Skip to content

Commit

Permalink
Adress first review
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianschoeppach committed Nov 22, 2024
1 parent a011afe commit 0201a26
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 17 deletions.
11 changes: 6 additions & 5 deletions src/perovskite_tandem_database/parsers/tandemparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def parse(
# Process each column/device/publication separately
for col in data_frame.columns:
logger.info(f'Processing column: {col}')
entry_archive = EntryArchive()

# Clean the data frame
# Set proper Boolean values and remove rows with all NaN values
Expand All @@ -74,15 +75,13 @@ def parse(
stack = extract_layer_stack(column_data)
general = extract_general(column_data)
reference = extract_reference(column_data)
reference.normalize(archive, logger)
# reference.normalize(entry_archive, logger)

tandem = PerovskiteTandemSolarCell(
general=general, reference=reference, layer_stack=stack
)

entry_archive = EntryArchive(data=tandem)

print('parsing with tandem parser')
entry_archive.data = tandem

create_archive(
entry_archive.m_to_dict(),
Expand Down Expand Up @@ -649,7 +648,9 @@ def extract_layer_stack(data_frame):

# Filter out layers
filtered_df = data_frame[data_frame.index.str.contains('Exist')]
layer_labels = [idx.split('Exist')[0] for idx in filtered_df.index]
layer_labels = [
idx.split('Exist')[0].strip() for idx, val in filtered_df.items() if val
]

for label in layer_labels:
# Filter dataframes by label
Expand Down
21 changes: 13 additions & 8 deletions src/perovskite_tandem_database/schema_packages/measurements.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,49 +121,49 @@ class Scan(ExperimentStep):
description='Direction of the scan.',
)

jsc = Quantity(
short_circuit_current_density = Quantity(
type=float,
description='Short-circuit current density.',
unit='mA/cm^2',
)

Voc = Quantity(
open_circuit_voltage = Quantity(
type=float,
description='Open-circuit voltage.',
unit='V',
)

FF = Quantity(
fill_factor = Quantity(
type=float,
description='Fill factor.',
unit='dimensionless',
)

PCE = Quantity(
power_conversion_efficiency = Quantity(
type=float,
description='Power conversion efficiency.',
unit='dimensionless',
)

Vmp = Quantity(
maximum_power_point_voltage = Quantity(
type=float,
description='Voltage at maximum power.',
unit='V',
)

jmp = Quantity(
maximum_power_point_current = Quantity(
type=float,
description='Current at maximum power.',
unit='mA/cm^2',
)

Rs = Quantity(
restiance_series = Quantity(
type=float,
description='Series resistance.',
unit='Ohm cm^2',
)

Rsh = Quantity(
resistance_shunt = Quantity(
type=float,
description='Shunt resistance.',
unit='Ohm cm^2',
Expand All @@ -175,6 +175,11 @@ class JV(Experiment):
JV measurement.
"""

target = Quantity(
type=str,
description='Target of the measurement.',
)

illumination = SubSection(
section_def=Illumination,
description='Illumination conditions of the measurement.',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ class Reference(PublicationReference):

def normalize(self, archive, logger):
"""Normalize the reference section."""
super(PublicationReference, self).normalize(archive, logger)
super().normalize(archive, logger)
2 changes: 1 addition & 1 deletion src/perovskite_tandem_database/schema_packages/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
Substrate,
)

from .ref import Reference
from .reference import Reference
from .tandem import (
General,
Layer,
Expand Down
2 changes: 1 addition & 1 deletion src/perovskite_tandem_database/schema_packages/tandem.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from nomad.metainfo.util import MEnum

# from perovskite_solar_cell_database.schema_sections.ions.ion import Ion
from .ref import Reference
from .reference import Reference

# Chemicals and materials and their treatment

Expand Down
5 changes: 4 additions & 1 deletion tests/test_tandem_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ def test_schema():
normalize_all(entry_archive)

# test reference
assert entry_archive.data.reference.DOI_number == '10.1002/advs.201700675'
assert (
entry_archive.data.reference.DOI_number
== 'https://doi.org/10.1002/advs.201700675'
)
assert entry_archive.data.reference.data_entered_by_author is False

# test general
Expand Down

0 comments on commit 0201a26

Please sign in to comment.