Skip to content

Commit

Permalink
Filter reactors without TrackData in DASware5Parser
Browse files Browse the repository at this point in the history
Removes reactors / scoped blocks that do not have TrackData attached.
Sometimes, Setup blocks are provided in the file although the
corresponding reactor does not have data. Fixes #10.
  • Loading branch information
sleweke-bayer committed Aug 30, 2023
1 parent e3db709 commit 317560e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions detl/parsing/dw5.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ def parse(self, filepath: pathlib.Path) -> core.DWData:
filepath (str or pathlib.Path): path pointing to the file of interest
"""
scoped_blocks = common.split_blocks(filepath)
scoped_blocks = {
key: value for (key, value) in scoped_blocks.items() if "TrackData" in list(value)
}
dd = common.transform_to_dwdata(scoped_blocks, BLOCKPARSERS, version=core.DASwareVersion.V5)

for _, reactor in dd.items():
Expand Down

0 comments on commit 317560e

Please sign in to comment.