Closed jzuhone closed 3 years ago
I don't see crashes anymore, but I want @Gregg140 to confirm.
The good news is that I could not make it crash.
I detected a couple of issues in my tests:
1) When I clicked on "Show Limits" for both the main data v time plot and the histogram I never saw the limit lines. Example:
2) After doing some fitting, I asked for the histogram to be re-drawn and I got the following picture.
The issue is that on the right hand plot I can't tell if the data continues higher than ~13 or it I'm seeing the precise top of the data. A little padding would be good so that I'm sure I'm seeing the top of the histogram.
Example of tests performed:
xija_gui_fit dpa_model_spec.json --days 365 --stop 2021:079:00:00:00.00 &
1) Delete dpa0 solar heat plot
2) Add 1dpamzt resid_time plot
3) Clicked on show limits - Limits did not appear on the model v data plot
4) Click Histogram
5) Histogram plot: Show limits
**- Limits did not appear on left hand plot**
6) Mask FMT1
7) Mask Radzones
8) Redraw Histo
9) Histo limits off
10) Mask FMT1 off
11) Mask Radzones off
12) fit tau, ampl, bias
13) Mask FMT1, radzones, show limits
14) Unmask FMT!, radzones, show limits
15) Redraw
16) Annotate line
17) Click on main plot to change annotation values
18) Redraw histo
19) Close histo
20) Open histo
21) Redraw histo
22) add resid_data plot
23) Fit P's
24) Redraw Histo
**Need to pad the +y axis**
@Gregg140 this should be fixed now.
Crashed when running through the tests I listed. But I winnowed it down to this:
1) fit tau, ampl, bias
2) Click on histogram
Traceback (most recent call last): File "/data/acis/ska_pkg/xija/xija/gui_fit/app.py", line 932, in make_histogram self.hist_window = HistogramWindow(self.model, self.hist_msids) File "/data/acis/ska_pkg/xija/xija/gui_fit/plots.py", line 275, in init self.make_plots() File "/data/acis/ska_pkg/xija/xija/gui_fit/plots.py", line 336, in make_plots self.update_plots() File "/data/acis/ska_pkg/xija/xija/gui_fit/plots.py", line 416, in update_plots self.ax2.set_ylim(0.0, hist.max()+1) File "/data/acis/miniconda3/envs/ska-dev/lib/python3.8/site-packages/matplotlib/axes/_base.py", line 3578, in set_ylim top = self._validate_converted_limits(top, self.convert_yunits) File "/data/acis/miniconda3/envs/ska-dev/lib/python3.8/site-packages/matplotlib/axes/_base.py", line 3101, in _validate_converted_limits raise ValueError("Axis limits cannot be NaN or Inf") ValueError: Axis limits cannot be NaN or Inf
Thanks for catching that--fixed now.
@taldcroft I added your suggestions also.
@taldcroft this is ready to go.
Description
This PR resolves an issue where
xija_gui_fit
would seemingly randomly crash on Linux when manipulating plots. The exact reason is unknown, because I could never seem to produce a traceback of any kind, but many of the plot objects (such asFigure
andAxes
were being re-created every time the data itself needed an update due to a new model fit, etc. This PR implements the changing of the data on the plot itself (for several plot types) instead of re-creating the plot objects with every update, which appears to fix the problem.This PR also does the following:
CxoTime
instead ofChandra.Time
annotate_limits
has been moved from being a method of theXijaModel
class to being a function in thexija_gui_fit
app, since this is the only place it's usedChandra.taco
which is a ska2 remnantTesting
Fixes issue #105.