Skip to content

Commit

Permalink
Merge pull request #131 from stroutm/dev
Browse files Browse the repository at this point in the history
Added statement to check if symbolic_name already exists in shared_en…
  • Loading branch information
bemcdonnell committed Apr 12, 2024
2 parents e2e25c3 + b92a146 commit f044107
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions swmm-toolkit/src/swmm/toolkit/output_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,10 @@ def _build_pollut_metadata(self, output_handle):
# Create dictionary keys
for i in range(1, n):
symbolic_name = 'POLLUT_CONC_' + str(i)
extend_enum(shared_enum.SubcatchAttribute, symbolic_name, 8 + i)
extend_enum(shared_enum.NodeAttribute, symbolic_name, 6 + i)
extend_enum(shared_enum.LinkAttribute, symbolic_name, 5 + i)
if symbolic_name not in shared_enum.SubcatchAttribute._member_names_:
extend_enum(shared_enum.SubcatchAttribute, symbolic_name, 8 + i)
extend_enum(shared_enum.NodeAttribute, symbolic_name, 6 + i)
extend_enum(shared_enum.LinkAttribute, symbolic_name, 5 + i)

# Update metadata dictionary with pollutant metadata
for i, attr in enumerate(islice(shared_enum.SubcatchAttribute, 8, None)):
Expand Down

0 comments on commit f044107

Please sign in to comment.