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

BaseData class #77

Closed JunCEEE closed 2 years ago

JunCEEE commented 2 years ago

It's added here.

BaseData: https://github.com/PaNOSC-ViNYL/libpyvinyl/blob/dataAPI/libpyvinyl/BaseData.py

DiffractionData example: https://github.com/PaNOSC-ViNYL/libpyvinyl/blob/dataAPI/libpyvinyl/DiffractionData/DiffractionData.py Usage: https://github.com/PaNOSC-ViNYL/libpyvinyl/blob/dataAPI/libpyvinyl/DiffractionData/testDiffractionData.py

Todos after the first pseudo-code review.

Todos after the schematic discussion.

shervin86 commented 2 years ago

I'm thinking about which class should be responsible for the output in openPMD format and it is not yet clear to me. In openPMD there are several things that need to be written:

To me, it makes more sense to have a separate library taking care of the I/O taking in input the different information and the DataClass and taking care of putting in openPMD the things in the right place. If then there is a change in the openPMD standard things have to be touched in a single place and not in a multitude of classes

JunCEEE commented 2 years ago

In my mind, the DataClass takes care of the native output and input of the backengine and write/read them in openPMD (or other) format with an openPMD API. I guess the openPMD API is what you mean by the "separate library"? @shervin86

shervin86 commented 2 years ago

I was thinking that it would be better to have the API to take the data class and write them. The data class should know nothing about the output format. I would make a package, that depends on the openPMD API and the libpyvinyl and performs the I/O. If I understood correctly you are suggesting to add the openPMD API as a dependency to the libpyvinyl. I don't think this is good idea.

So I would do:

JunCEEE commented 2 years ago

Oh, I'm sorry that I might not be clear enough. The openPMD API I mentioned was just a general idea for "An API to write in openPMD format" instead of the exact "openPMD API". It is exactly what you mean that "a package, that depends on the openPMD API and the libpyvinyl and performs the I/O".

The example I made here:

In this way, we just need to implement your raytracing I/O package in an "openPMDFormat" class and it will be wrapped by an "raytacing data class".

shervin86 commented 2 years ago

Great, then I totally misunderstood the meaning of the classes. I will look into it more carefully tomorrow.

JunCEEE commented 2 years ago

Todos after the first pseudo-code review.