Comments (5)
I'm intrigued by your serialization use case. If you can, and when you feel ready, I'd like to hear more about it.
from petaca.
Hello Thierry, Can you explain in more detail what you would like to be able to do. It's not quite clear to me.
from petaca.
Hello Neal. If I have 2 parameter_list(s), let's say read from JSONs, I am looking to add a type bound procedure to be able to do:
type(parameter_list) :: p, p1, p2
call parameter_list_from_json_stream(json_1_unit, p1)
call parameter_list_from_json_stream(json_2_unit, p2)
call p%set ('json 1', p1)
call p%set ('json 2', p2)
Should be relatively easy using recursion and the iterators already in library (?) I will try to give it a go.
from petaca.
I think you should be able to do something like that already:
type(parameter_list) :: p
type(parameter_list), pointer :: p1, p2
p1 => p%sublist('json 1')
p2 => p%sublist('json 2')
call parameters_from_json_stream(json1_unit, p1)
call parameters_from_json_stream(json2_unit, p2)
Note the use of parameters_from_json_stream
instead of parameter_list_from_json_stream
. The latter takes a pointer as an argument which it allocates and fills internally. The former takes a preexisting parameter list and adds to it.
That said, if one had an existing parameter list pointer p1, it would be very useful to be able to make it a new sublist of a parameter list p. So something like this:
call parameter_list_from_json_stream(json1_unit, p1)
...
call p%set_sublist('json 1', p1)
I've wanted this myself on several occasions. It's not always convenient or possible to create the empty sublist first and then fill it. Is this what you are looking for? This would be very easy to add.
from petaca.
Yes, creating a sublist and subsequently filling it would be a workaround. The use case I was thinking of is a hierarchy of list which mirrors that of class composition. A class would have a constructor using a plist as a unique argument, and a "to_plist()" serialization. I can easily modify "to_plist" to take a pre-allocated plist as additional argument. Thank you very much!
from petaca.
Related Issues (20)
- Is timer_tree::stop error return needed?
- User-specified kinds when creating parameter lists from JSON text
- JSON input of arrays of parameter lists
- gfortran 8.3.1 fails any_matrix_type test HOT 10
- gfortran 8.3.1 fails parameter_list_type test HOT 3
- Compiling with the flang compiler HOT 1
- Use JSONPath style syntax for parameter list names HOT 2
- Parameter list methods return allocated 0-length errmsg when stat==0
- Intel 19 regression HOT 1
- Intel 19.1 regression HOT 1
- Test failures on Mac w/NAG HOT 1
- GCC 9+ loses dynamic type for non-scalar parameters in parameter list HOT 1
- Error message is not returned correctly by gfortran 9+ HOT 10
- version tag HOT 2
- ICE when compiling with Intel ifx HOT 1
- Unit tests for parameter_list_json HOT 1
- TYPE_IS inquiry methods for parameter list
- Report INTEL_BUG20140921 HOT 1
- Replace CALL EXIT with standard STOP
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from petaca.