PaNOSC-ViNYL / ViNYL-project

This repository keeps track of tasks, milestones, deliverables of workpackage 5 in panosc.
Apache License 2.0
5 stars 5 forks source link

libpyvinyl next steps #70

Closed CFGrote closed 2 years ago

CFGrote commented 2 years ago

Extend/edit libpyvinyl such that it accomodates the needs of

I wanted to apply it to Shadow and my first trial was very complex. The main reason is that I had to copy all the calculator parameters in the new rigid structure. I forked the libpyvinyl repository and made some test (limited only to shadow3 sources): https://github.com/srio/libpyvinyl/blob/master/tests/Shadow3Calculator.py

Then, I made another experiment. I believe that we should incorporate the native parameters in our parameters, in a very generic way, and avoid copying all the items. I propose to define only a very few basic base/abstract classes with the list of the mandatory methods to be implemented, and then make another top layer to implement the particular calculator. My proposition to the generic classes is:

https://github.com/srio/libpyvinyl/blob/master/libpyvinyl/VyBase.py

My implementation of the shadow3 binding to vinyl is: https://github.com/srio/libpyvinyl/blob/master/libpyvinyl/VyShadow3.py

you see that the binding inheritates the 3 main classes and it interfaces them to the shadow3 methods and objects, but does not create a duplicated list of parameters. The code is simple. Creating scripts with Vinyl-shadow3 is as simple as in the native format (you can see it in the example included). The main work is then concentrate in adequate the i/o (json, nexus, h5 etc) to be made at the level of the binding. However, we can provide basic tools at the level of the abstract classes (e.g., dict to {json,h5} and viceversa).

I believe that most of Manuel's suggestions are already present but maybe lack proper documentation and/or usage examples.

shervin86 commented 2 years ago

I would remove this issue. It is a collected duplicate of: