Skip to content

Commit

Permalink
Interface fix (#2)
Browse files Browse the repository at this point in the history
* Changed interface

* Improved run section check

* Fixed test calls.

* Fixed test calls.
  • Loading branch information
lauri-codes authored May 3, 2024
1 parent 3f77f42 commit b81e76a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions dosnormalizer/normalizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from collections import defaultdict
from typing import Optional

from nomad.datamodel import EntryArchive
from nomad_dos_fingerprints import DOSFingerprint # pylint: disable=import-error
from nomad.normalizing.normalizer import Normalizer

Expand All @@ -36,15 +37,16 @@ class DosNormalizer(Normalizer):

normalizer_level = 1

def normalize(self, logger=None) -> None:
def normalize(self, archive: EntryArchive, logger=None) -> None:
if logger is not None:
self.logger = logger.bind(normalizer=self.__class__.__name__)

# Do nothing if section_run is not present
if self.section_run is None:
if not archive.run:
return
section_run = archive.run[0]

calculations = self.section_run.calculation
calculations = section_run.calculation
if calculations is None:
return

Expand Down

0 comments on commit b81e76a

Please sign in to comment.