Skip to content

Commit

Permalink
Add extract_storage function to parse storage conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianschoeppach committed Nov 7, 2024
1 parent 5f90559 commit 1fa2b5e
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/perovskite_tandem_database/parsers/tandemparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
Reference,
SiliconLayer,
Solvent,
Storage,
Substance,
Substrate,
)
Expand Down Expand Up @@ -503,6 +504,25 @@ def extract_alkali_doping(data_frame):
return alkali_doping


def extract_storage(data_frame):
"""
Extracts the storage condition from the dataframe.
"""

df_temp = data_frame[data_frame.index.str.contains('Storage. ')]
if df_temp.empty:
return None
else:
storage_conditions = {
'time_until_next_step': partial_get(
df_temp, 'Time until', default_unit='h'
),
'atmosphere': partial_get(df_temp, 'Atmosphere'),
'humidity_relative': partial_get(df_temp, 'Relative humidity'),
}
return Storage(**storage_conditions)


def extract_reference(data_frame):
"""
Extracts the reference from the data subframe.
Expand Down Expand Up @@ -613,7 +633,7 @@ def extract_layer_stack(data_frame):

# Annealing etc!
# Storage conditions
storage = None
storage = extract_storage(df_sublayer)

# Differentiate between type of layers
if 'NAlayer' in label:
Expand Down

0 comments on commit 1fa2b5e

Please sign in to comment.