qua-platform / py-qua-tools

Tools for enhancing your quantum experiments
BSD 3-Clause "New" or "Revised" License
39 stars 19 forks source link

Feat: DataHandler - allow nested figures and arrays to be saved #215

Closed nulinspiratie closed 4 months ago

nulinspiratie commented 5 months ago

This PR enables the data handler to also save figures and arrays when they are nested within a dict.

Example:

data = {"q1": {"trace": np.array([1, 2, 3]), "fig": plt.figure()}}
data_handler.save_data(data, "my_data")

Afterwards, the data will be stored in: q1.trace.npy and q1.fig.png

github-actions[bot] commented 5 months ago

Unit Test Results

389 tests   385 :heavy_check_mark:  44s :stopwatch:     1 suites      4 :zzz:     1 files        0 :x:

Results for commit 9310577d.

:recycle: This comment has been updated with latest results.