Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Add custom attributes for serialization #493

Open
TonyXiang8787 opened this issue Feb 13, 2024 · 2 comments
Open

[FEATURE] Add custom attributes for serialization #493

TonyXiang8787 opened this issue Feb 13, 2024 · 2 comments
Labels
feature New feature or request

Comments

@TonyXiang8787
Copy link
Member

TonyXiang8787 commented Feb 13, 2024

Background

Currently the (de-)serialization only supports attributes which are defined by PGM self. Users wish to add custom attributes to the (de-)serialization format and parser. Following attribute types are desired.

  • Attributes per element
  • Aggregated attributes along all elements for a given type and scenario
  • Aggregated attributes along all scenarios for a given type and element
  • Global attributes for a given type

Approach

To be continued

@TonyXiang8787 TonyXiang8787 added the feature New feature or request label Feb 13, 2024
@IrenaDk
Copy link

IrenaDk commented Feb 13, 2024

This would be very useful for our product because we do a lot of manipulations on the initial PGM network that we use and it would be useful to (de)serialize it with the additional attributes. Such output can be used as input in the next steps of our workflow, final output, and has the additional benefit of making debugging easier.

@mgovers
Copy link
Member

mgovers commented Feb 14, 2024

Initial thoughts: we could go a number of ways:

  1. always aggregate. the results would end up in the meta data of the output. this marks a compatible change tot the serialization schema. the difficult decision here is whether it should be ignored or checked for strict=true when deserializing. It wouldn't be possible to make these fields "custom" (as mentioned in the feature request)
  2. add optional flags to aggregate across multiple dimensions and output to a user-defined custom identifier. I don't like this because it prevents us from just adding new fields with good names because there could be name clashes
  3. similarly to the extra_info attribute to the PgmJsonConverter: make this optional and output "all the rest" as an new string of the same data type as the input. This would not break current functionality and with the visitor pattern, it should be relatively straight forward to produce, but i do not think this enables all of the above requested features, but it ties better into the "custom" part of the feature request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
Status: No status
Development

No branches or pull requests

3 participants