SNEWS2 / snewpdag

SNEWS2 alert calculations
BSD 3-Clause "New" or "Revised" License
2 stars 13 forks source link

Histogram rendering changes #91

Closed tsengj10 closed 1 year ago

tsengj10 commented 1 year ago

Added MultiPlot, intended for rendering several plots in the same graph.

Added some divide-by-zero protection to Hist1D value, and added some printout to Hist1D renderer so plots can be recreated from the logfile output.

Also updated gitignore for log files.

tsengj10 commented 1 year ago

Added a feature to Hist1D and MultiPlot renderers by which if you specify "scriptname" then they'll write python scripts to regenerate the plots and show them on the screen.

tsengj10 commented 1 year ago

Replaced pyplot with mathplotlib (not multiplot!) backend, since pyplot tends to run out of memory, even if you were to close each figure when you're done with them. See https://stackoverflow.com/questions/16334588/create-a-figure-that-is-reference-counted/16337909#16337909

Also added environment variable substitution into parsing the csv file argument field, so now one doesn't have to create lots of slightly different versions of the same script to test different parameters.

tsengj10 commented 1 year ago

Also removed the slightly bothersome situation that running MC trials occurs entirely within the except clause of a try-except construct. I turned the most obvious situation into a conditional instead.