AlgebraicJulia / AlgebraicJulia/ASKEM-demos

Stratification should flatten names after each application instead of using nested tuples

Offen
#34 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement
Vorherrschende Sprache
Jupyter Notebook
Sterne
8
Forks
1
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Currently, multi-level stratification returns state and transition names as nested tuples. This becomes an issue when serializing/deserializing.
- When deserializing, the JSON strings must be converted to tuples of symbols, but calling `flatten` on a tuple of tuples of strings and singleton strings will separate the individual letters of the singleton strings resulting in the incorrect names: e.g.,`Symbol.(flatten((("guns", "n"), "roses")))`.
- Trying to avoid the issue by flattening prior to serialization also does not work because, if `flatten` is called on a tuple of tuples of symbols and singleton symbols, the iterator will not be able to iterate over the singleton symbol:
e.g., `[x for x in flatten(((Symbol(1), Symbol(2)), Symbol(3)))]` will error.

Flattening the names after each hierarchical stratification, s.t. the names are always a non-nested tuple, would avoid the issue. It also makes sense categorically because the product models are defined up to isomorphism, so the associations indicated by the nested-tuple names are not meaningful.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.