Skip to content

Commit

Permalink
Bugfix for linking petrinets
Browse files Browse the repository at this point in the history
  • Loading branch information
enoriega committed Mar 27, 2024
1 parent 066bee4 commit 626bc2c
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions skema/metal/model_linker/skema_model_linker/linkers/petrinet.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,19 @@ class PetriNetLinker(AMRLinker):
def _generate_linking_sources(self, elements: Iterable[JsonNode]) -> Dict[str, List[Any]]:
ret = defaultdict(list)
for name, val, ix in elements:
if (name == "states") or (name == "parameters" and 'name' in val):
key = val['name'].strip()
lower_case_key = key.lower()
if val is not None:
if (name == "states") or (name == "parameters" and 'name' in val):
key = val['name'].strip()
lower_case_key = key.lower()

if "description" in val:
ret[f"{key}: {val['description']}"] = val
else:
if lower_case_key in heuristics:
descs = heuristics[lower_case_key]
for desc in descs:
ret[f"{key}: {desc}"] = val
ret[key] = val
if "description" in val:
ret[f"{key}: {val['description']}"] = val
else:
if lower_case_key in heuristics:
descs = heuristics[lower_case_key]
for desc in descs:
ret[f"{key}: {desc}"] = val
ret[key] = val
# elif name == "transitions":
# if "description" in val:
# ret[f"{val['id'].strip()}: {val['description']}"] = val
Expand Down

0 comments on commit 626bc2c

Please sign in to comment.