Jaakko
12/15/2022, 6:59 PMIan Whalen
12/15/2022, 7:21 PMMatplotlibWriter
in a loop
As far as displaying in kedro viz, I’m not sureDeepyaman Datta
12/16/2022, 2:40 PMJaakko
12/16/2022, 6:17 PMoutput_plot:
type: matplotlib.MatplotlibWriter
filepath: data/08_reporting/output_plot.png
save_args:
format: png
I can't figure out how to modify the yaml in the case where there is a list of plots that we want to save. What should be the filepath argument, for example?Deepyaman Datta
12/16/2022, 6:26 PMdata/08_reporting/output_plot.png/0.png
, data/08_reporting/output_plot.png/1.png
, etc. If you want to control the names, you can return a dictionary instead of a list. Ideally, seeing the filepaths above, you would want to specify a directory-like name (rather than a filename) as the filepath
argument.
Relevant snippet from that link:
if isinstance(data, list):
for index, plot in enumerate(data):
full_key_path = get_filepath_str(
save_path / f"{index}.png", self._protocol
)
self._save_to_fs(full_key_path=full_key_path, plot=plot)
(Of course, it would also be better if this were more clearly documented, and you didn't have to understand the implementation, but just trying to help for now)Jaakko
12/19/2022, 6:37 AMoutput_plot:
type: matplotlib.MatplotlibWriter
filepath: data/08_reporting/output_plots
save_args:
format: png
versioned: true
If I have my pipeline return a single plot everything works fine and I can see the plot in the experiments section in kedro viz. However, if I return a list of plots the plots are still created but I can't see them through kedro viz. Also, I see the following warning displayed in the terminal where kedro viz was started:
'output_plot' with version '2022-12-22T19.00.19.079Z' could not be loaded. Full exception: DataSetError: Failed while loading data from data set experiment_tracking.py:101
MatplotlibWriter(filepath=[my project path]/data/08_reporting/output_plots, protocol=file, save_args={'format': png},
version=Version(load='2022-12-22T19.00.19.079Z', save=None)).
[Errno 21] Is a directory: '[my project path]/data/08_reporting/output_plots/2022-12-22T19.00.19.079Z/output_plots'
Is this as designed? Would be nice to see list of plots displayed by kedro viz as well.Olivia Lihn
12/22/2022, 9:47 PMDeepyaman Datta
12/22/2022, 10:02 PMTynan
12/23/2022, 10:20 AMJaakko
12/23/2022, 12:12 PMTynan
12/23/2022, 12:35 PM