Kratos icon indicating copy to clipboard operation
Kratos copied to clipboard

Include another file in json files

Open pooyan-dadvand opened this issue 4 years ago • 4 comments

There are several cases that we need (or it would be better) to include another json file in our project parameters and materials.

pooyan-dadvand avatar Apr 24 '20 07:04 pooyan-dadvand

@KratosMultiphysics/technical-committee we arrived to the conclusion to use define keywords of inclusion:

  • @include_json
  • @include_csv
  • @include_grf

or similar ones for other formats.

The implementation should be done in a new Jsonfstream which substitutes the included files and give back the complete string to the actual Parameters class.

pooyan-dadvand avatar Apr 24 '20 07:04 pooyan-dadvand

The implementation could be done in different ways

  • As a list of elements "@include_json" : ["file_name1.json", file_name2.json"]
  • Unique element "@include_json" : "file_name.json"

This case is more simple but does not allow to include more than one json file (due to "duplicate key")

AriadnaCortesDanes avatar Jun 27 '22 09:06 AriadnaCortesDanes

I would go for the unique one until we find a use case for the list. @KratosMultiphysics/technical-committee and @KratosMultiphysics/implementation-committee what you think?

pooyan-dadvand avatar Jun 27 '22 15:06 pooyan-dadvand

I would go for the unique one until we find a use case for the list. @KratosMultiphysics/technical-committee and @KratosMultiphysics/implementation-committee what you think?

Agree. Besides, taking into account how we write information in our GUIs, I've the feeling that we'll never need concatenating a list of json files.

rubenzorrilla avatar Jun 28 '22 05:06 rubenzorrilla

Closing, this is implemented in #10004

roigcarlo avatar Feb 28 '23 16:02 roigcarlo