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

Custom configuration format(s) used by CSE #334

Closed
markaren opened this issue Aug 26, 2019 · 7 comments · Fixed by #333
Closed

Custom configuration format(s) used by CSE #334

markaren opened this issue Aug 26, 2019 · 7 comments · Fixed by #333
Labels
discussion needed Let's have a discussion about this

Comments

@markaren
Copy link
Contributor

markaren commented Aug 26, 2019

Discussion about the configuration format that is/should be used by CSE for:

  • msmi
  • scenarios
  • orchestration
  • other?
@markaren markaren added the discussion needed Let's have a discussion about this label Aug 26, 2019
@ljamt
Copy link
Member

ljamt commented Aug 27, 2019

As the msmi files and the co-simulation configuration are related, these should be in the same format. The scenario files will probably be handmade and should be in a format that is easy to work with for humans.

As the other workpackages are about to start using the MSMI files proposed in PR #333 and implemented in the msmi-validator and cse-configurator we should settle it sooner rather than later.

xml

  • pros
    • schema validation
    • FMI, SSP and DCP are based on xml
    • widely supported, excellent tooling
  • cons
    • verbose
    • less human readable than json/yaml

json

  • pros
    • schema validation
    • widely supported, excellent tooling
  • cons
    • Nan/Inf not supported
    • comments are unsupported

yaml

  • pros
    • schema validation
    • can parse json
    • anchors are well suited for scenarios
    • more "human friendly" than json and xml
  • cons
    • less supported than xml and json (but still very good support in C++/Java)
    • some people dislike the python like indentation

@markaren markaren changed the title Custom serialization format(s) used by CSE Custom configuration format(s) used by CSE Aug 27, 2019
@markaren
Copy link
Contributor Author

markaren commented Aug 28, 2019

My recommendation:
Use YAML for files that humans will interact with (scenarios). This option also allows JSON to be used, since YAML is JSON. Users can decide for themselves which they use.

For other files use XML in combination with .xsd files.

@lassebje
Copy link

Humans may interact with scenarios today, but will also be handled by tools most likely.
I think we should choose one format for everything in that respect so that every format can be specified in the same schema language, be it xsd, json schema or YAML schema. Any of the suggested formats seem appropriate and they are "interchangeable" seen from the computer. I have no strong opinion other that we choose the same for all.

@mrindar
Copy link
Contributor

mrindar commented Aug 30, 2019

My two cents:

  1. All input files will be handled by computers - both read and write. I think this should make us lean more towards the format which has the best schema support, and the best availability of parsers/generators across 'all' languages
  2. Having the same file format across 'everything' is appealing

@ljamt
Copy link
Member

ljamt commented Sep 5, 2019

After discussion in "mob session" and taking in all your arguments, we conclude using xml for the msmi-file and the co-simulation configuration. As the scenario files often will be written by humans, these files should be json or yaml.

Let me know if you strongly disagree :)

@markaren
Copy link
Contributor Author

markaren commented Sep 5, 2019

Sounds good to me. XML is pretty decent coupled with xsd since you get on the fly input validation in IntelliJ/CLion and for Java you get superb code generation through JAXB.

Regarding json and yaml: Remember that they are not mutually exclusive. Choosing yaml means json is also supported :). There are proabably some cavecats, but I think the two main yaml parsers for C++ and Java can handle both.

@lassebje
Copy link

lassebje commented Sep 9, 2019

Fine by me. IF human interaction is important in the scenario file, you should choose yaml.

@ljamt ljamt closed this as completed in #333 Oct 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion needed Let's have a discussion about this
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants