dandeliion-team / dandeliion-client-api-feedback

This private repository is dedicated to collecting feedback, bug reports, and feature requests for dandeliion-client, aiming to track issues, gather user suggestions, and discuss improvements.
0 stars 0 forks source link

Extend functionality of `dandeliion.Solution` #3

Open ejfdickinson opened 3 months ago

ejfdickinson commented 3 months ago

Some general musings on useful next direction:

jschewts commented 3 months ago

This is a dict-like class so it would be natural for it to expose dict-like methods, such as keys(), items(), contains(), etc.

no problem. done and will be released in the next rc3.

Can we add some basic, direct file serialisation such as a to_csv(fp)

not sure what you mean by this. What would you like to serialize? The results? They are already serialized (i.e. stored in csv files and bundled in a zipped archive i.e. same result data that can be fetched from the web server) and are only deserialized for the solution instance. I can give you direct access to the underlying raw data, if that is what you want/need. That's no problem.

Would it be a good idea for this object embed a metadata reference to the parameter set and model conditions that generated it?

The results data contains a complete copy of the dandeliion parameter file passed on to the simulator. I could expose this in the interface as well.

ejfdickinson commented 3 months ago

@jschewts Thanks for the feedback on serialisation.

I didn't realise that there was comprehensive results data available on the web server. So is the Solution object just a view into the web-hosted data?

I was using this issue largely to log some general ideas on use cases and forward path rather than make specific requests, so let's pause on the matter of serialisation (and bundling the submitted parameter file) until you've had a chance to fill in some documentation and we can understand better what data can be accessed. Then we can think about local vs remote storage and access.

Thanks for adding the additional standard and dunder methods to Solution!

jschewts commented 3 months ago

So is the Solution object just a view into the web-hosted data

yes. It fetches all result data and then extracts the parts you request from it.

until you've had a chance to fill in some documentation and we can understand better what data can be accessed

you can access any of the data that you can also download from your run on the server (i.e. by either using the 'data.zip' link on your sim's detail page of our webserver interface or directly via webhook https://sim.dandeliion.com/results/<sim run id> (requires http session with active login)). There is a bit of documentation as part of an annotated jupyter notebook example of our original (non-pybamm-ish) python client. I will add our example folder to the next rc release, so that you should find this particular one at examples/example.ipynb within the distributed package. It's a rather simple pythonification of the results in there, but if you tell us what exactly you need, we can look into wrapping/post-processing and documenting it accordingly.

jschewts commented 3 months ago

@ejfdickinson rc3 is now released on testpypi. You should be able to find the example folder in the data path of your installation.

ejfdickinson commented 3 months ago

@jschewts Thank you! I'll pass on to the team to test this week.

Is there any further API documentation available yet?

jschewts commented 3 months ago

@ejfdickinson The exposed pybamm-style API is fully documented and you can find the docs at https://sim.dandeliion.com/api/docs/ . If there is anything that you think needs to be added or extended, please let us know.

ejfdickinson commented 3 months ago

Thanks @jschewts, that's extremely helpful! If we have any specific items to add / extend, we'll log issues for them.