Battery-Intelligence-Lab / galv

An open-source platform for automated storage of battery data with advanced metadata support
https://battery-intelligence-lab.github.io/galv/
Other
33 stars 8 forks source link

Interoperability between Galvanalyser and Battery Archive #12

Open pghege opened 2 years ago

pghege commented 2 years ago

Is your feature request related to a problem? Please describe. In the hopes of reducing redundant work, I would like to improve interoperability between Galvanalyser and Battery Archive. In particular if there is data that is Battery Archive bound, it would be great if the end to end process of extracting data from a cycler, loading it into an analysis tool and publishing it was made easy.

Describe the solution you'd like My first thought is that there would be 1 schema for all battery data supported on both Battery Archive and Galvanalyser, but that could get messy. Alternatively, if there were multiple schemas, there would need to be a well-defined method to translate between schemas, otherwise it could lead to redundant processing work done by both projects. What would be the natural way for Battery Archive to integrate with Galvanalyser? Should Battery Archive leverage Galvanalyser's APIs? or should the database be shared?

Additional context In addition to "The Battery Archive", there is also the battery-archive-sandbox project which is functionally equivalent to The Battery Archive but allows people to load battery data and analyze it locally even before publishing. The harvesting function of the Galvanalyser sounds like a natural front-end for the battery-archive-sandbox local analysis tool.

Please let me know what you think. Happy to discuss further

martinjrobins commented 2 years ago

Hi @pghege. I think the best point of interaction between galvanalyser and battery archive is the REST API that galvanalyser exposes. I have written an openapi spec for this, and auto-generated a python client that uses the api to download battery data and metadata. The python client is pip installable and the code is hosted here: https://github.com/martinjrobins/battery-api

If you run galvanalyser and use the frontend to create a harvester and upload some datasets, you can select any of the datasets and see some example python code to download that dataset and its metadata. I'm hopefuly that you can use this client to transfer datasets between galvanalyser and battery archive, what do you think?

martinjrobins commented 2 years ago

The plan (at this stage) is to add a button to the galvanalyser frontend that will initiate (on the battery archive side) a data transfer between galvanalyser and battery archive, using the existing galvanalyser api calls.

I'll use this issue to track progress on this prototype interaction

martinjrobins commented 2 years ago

api definition of publish and status call on battery archive side are here: https://github.com/valerio93105/battery-archive-sandbox/blob/a21f2a3a67059618bda9bbb42a68c59e8b50db89/api/api.yaml#L31

martinjrobins commented 2 years ago

e.g. calls would look like:

To launch a new upload will look like this http://XXXX/ga/publish/3 which outputs a tracker id i.e. 387f5a59-049e-4f3e-86a9-29896afa833a

To check the status of the job will look like http://XXXX/ga/publish/status/387f5a59-049e-4f3e-86a9-29896afa833a this will output the status, i.e. STARTED

martinjrobins commented 1 year ago

@pghege are there any updates on this?