Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains some modifications to make interactive plotting in a notebook work.
The main change is the transfer of code writing information to the
run_infoattribute of the sourcespec output object, from thewrite_outputfunction inssp_output.pyto a dedicated_update_run_infofunction. This function is then called at the end of thessp_runfunction insource_spec.pyrather than inwrite_output.I also considered writing the
end_of_runandend_of_run_tzinfo torun_infoinstead ofconfig, but this would require additional changes inssp_plot_spectra.py,ssp_plot_stacked_spectra.py,ssp_plot_stations.pyandssp_html_report.py, where this information is used in functions creating subelements of the plot/output. Instead of relying on the globalconfigobject, therun_infoobject should be passed to these functions. I'm not sure if you would want to do that.With these changes, it is possible to plot figures interactively in a notebook, by setting:
This works for traces, spectra, stacked spectra and the boxplot.
I had to make some modifications in
ssp_plot_stationsto make it work for the station plots as well. This is partly due to the older versions of pyproj and matplotlib that I use. With these changes,plot_stationsworks without errors, but there may still be a problem: I obtain 4 plots, 1 with stations colored by magnitude, and 3 identical plots without stations. According to the code I would expect 2 plots, the second one with stations colored by fc. Could you test this too?Another idea could be to add an option to
plot_stationsto choose between coloring by magnitude, fc or both?Let me know what you think.