Commit affb8137 authored by Lauri Himanen's avatar Lauri Himanen
Browse files

Fixed issue in normalizer order and workflow access.

parent eb51f1cb
Pipeline #93086 passed with stages
in 57 minutes and 52 seconds
...@@ -54,6 +54,6 @@ normalizers: Iterable[Type[Normalizer]] = [ ...@@ -54,6 +54,6 @@ normalizers: Iterable[Type[Normalizer]] = [
# FhiAimsBaseNormalizer, # FhiAimsBaseNormalizer,
DosNormalizer, DosNormalizer,
BandStructureNormalizer, BandStructureNormalizer,
EncyclopediaNormalizer,
WorkflowNormalizer, WorkflowNormalizer,
EncyclopediaNormalizer,
] ]
...@@ -50,7 +50,7 @@ class EncyclopediaNormalizer(Normalizer): ...@@ -50,7 +50,7 @@ class EncyclopediaNormalizer(Normalizer):
# Primarily try to determine the calculation type from workflow # Primarily try to determine the calculation type from workflow
# information # information
try: try:
workflow = self.section_run.section_workflow workflow = self.entry_archive.section_workflow
workflow_map = { workflow_map = {
"molecular_dynamics": calc_enums.molecular_dynamics, "molecular_dynamics": calc_enums.molecular_dynamics,
"geometry_optimization": calc_enums.geometry_optimization, "geometry_optimization": calc_enums.geometry_optimization,
...@@ -58,8 +58,8 @@ class EncyclopediaNormalizer(Normalizer): ...@@ -58,8 +58,8 @@ class EncyclopediaNormalizer(Normalizer):
} }
workflow_enum = workflow_map.get(workflow.workflow_type) workflow_enum = workflow_map.get(workflow.workflow_type)
if workflow_enum is not None: if workflow_enum is not None:
calc.calculation_type = calc_type calc.calculation_type = workflow_enum
return calc_type return workflow_enum
except Exception: except Exception:
pass pass
......
...@@ -95,7 +95,7 @@ class SystemBasedNormalizer(Normalizer, metaclass=ABCMeta): ...@@ -95,7 +95,7 @@ class SystemBasedNormalizer(Normalizer, metaclass=ABCMeta):
# Try to find workflow information and select the representative system # Try to find workflow information and select the representative system
# based on it # based on it
workflow = self.section_run.section_workflow workflow = self.entry_archive.section_workflow
if workflow: if workflow:
try: try:
iscc = workflow.calculation_result_ref iscc = workflow.calculation_result_ref
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment