waltsims / k-wave-python

A Python interface to k-Wave GPU accelerated binaries
https://k-wave-python.readthedocs.io/en/latest/
GNU General Public License v3.0
100 stars 29 forks source link

Create a results object to encapsulate simulation results and logic #303

Open waltsims opened 6 months ago

waltsims commented 6 months ago

Is your feature request related to a problem? Please describe. kWaveFirstOrder returns a variety of values depending on the simulation configuration. The logic of which values are returned, how they should be displayed, and their meaning could be better managed. Currently, they are returned as a dictionary of values, which can be difficult for users to interpret.

Describe the solution you'd like One possible solution is to use xarray.Datasets() to save the solution results and wrap all plotting and processing logic.

Describe alternatives you've considered We've considered making custom classes internally.

Additional context @djps came up with this suggestion

faridyagubbayli commented 6 months ago

We should also consider how typing is supported in the xarray.

djps commented 6 months ago

It may be useful to see how this has been done for with Feltor and look at this presentation here

This is implemented in open_pyfus

Other possible options, more focused on plotting, include:

Other potential options which deal with unstructured grids, such as those which can be handled with meshio for example, are probably out of scope as the results are on grids.