Skip to content
Snippets Groups Projects
Commit 70f0eeae authored by Florian Spreckelsen's avatar Florian Spreckelsen
Browse files

FIX: Fix reading in of caustom constants dictionary

parent 6276fc49
No related branches found
No related tags found
No related merge requests found
......@@ -355,6 +355,7 @@ EXTRACTORS = use_custom_names({
"Longitude start": extract_lng_start,
"Longitude stop": extract_lng_stop,
"PDFReport": extract_pdf_id,
"PI": extract_person,
"Sampling method": default_find,
"Sphere": extract_sphere,
"Start date": extract_start_date,
......
......@@ -11,7 +11,12 @@ with open(os.path.join(Path(__file__).parent, "default_constants.yml")) as yaml_
if os.path.isfile(os.path.join(Path(__file__).parent, "constants.yml")):
with open(os.path.join(Path(__file__).parent, "constants.yml")) as custom_yaml_file:
CONSTANTS.update(yaml.safe_load(custom_yaml_file))
tmp_dict = yaml.safe_load(custom_yaml_file)
for key, value in tmp_dict.items():
if isinstance(value, dict):
CONSTANTS[key].update(value)
else:
CONSTANTS[key] = value
def get_entity_name(name: str):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment