Opened 7 years ago

Closed 7 years ago

#943 closed defect (fixed)

Deep copy error on setting model after data is selected

Reported by: butler Owned by:
Priority: major Milestone: SasView 4.2.0
Component: SasView Keywords:
Cc: Work Package: SasView Bug Fixing

Description

If one starts a fit panel then chooses the model and then sends a data set all is fine, even if on then changes the model many times. However, if one first sends the data to the panel and then chooses the model the following error is thrown:

10:31:00 - ERROR : sas.sasgui.perspectives.fitting.basepage:1559: Traceback (most recent call last):
  File "C:\Users\Paul\git\sasview_new\src\sas\sasgui\perspectives\fitting\basepage.py", line 1557, in _update_paramv_on_fit
    self.save_current_state()
  File "C:\Users\Paul\git\sasview_new\src\sas\sasgui\perspectives\fitting\basepage.py", line 804, in save_current_state
    self.state.model = self.model.clone()
  File "C:\Users\Paul\git\sasmodels\sasmodels\sasview_model.py", line 506, in clone
    return deepcopy(self)
  File "C:\Users\Paul\workspace\SasView\Python27\lib\copy.py", line 190, in deepcopy
    y = _reconstruct(x, rv, 1, memo)
  File "C:\Users\Paul\workspace\SasView\Python27\lib\copy.py", line 334, in _reconstruct
    state = deepcopy(state, memo)
  File "C:\Users\Paul\workspace\SasView\Python27\lib\copy.py", line 163, in deepcopy
    y = copier(x, memo)
  File "C:\Users\Paul\workspace\SasView\Python27\lib\copy.py", line 256, in _deepcopy_dict
    for key, value in x.iteritems():
RuntimeError: dictionary changed size during iteration

Note that this does not seem to prevent the model from loading, does not throw an error on the user's console, or cause the program to misbehave obviously from the user's perspective. It may however have other more pernicious implications (pernicious = untraceable back to this error)?

Change History (3)

comment:1 Changed 7 years ago by lewis

I can't seem to recreate this in the current development version of SasView (at commit bc04647)

comment:2 Changed 7 years ago by smk78

Neither can I in my Win10 local build.

I tried:

Load data > Send to Fitting (FitPage1) > Select Model

Load data > Select Model > Send to Fitting (FitPage1)

Create New Fit Page (FitPage2) > Select Model > Load Data > Send to Fitting (FitPage1*)

Create New Fit Page (FitPage2) > Load Data > Select Model > Send to Fitting (FitPage1*)

Load data > Send to Fitting (FitPage1) > Select Model > Create New Fit Page (FitPage2) > Select Model > Send to Fitting (FitPage2)

*It seems that if there is no data loaded in FitPage1 you cannot populate another FitPage with data first

comment:3 Changed 7 years ago by butler

  • Resolution set to fixed
  • Status changed from new to closed

I agree — have tested 4.01, 4.1 and 4.1.1 as well as current developer build. This was reported on April 9, 2017 which was towards the end of code camp. Thus assume this was not properly tested (i.e. was just due to problems on my local build machine) or more likely was fixed as part of the fix to things breaking of fitting tab 1 was deleted (fixed by Adam Washington I believe?

The problem reported by Steve that you data always populates the first fit page without an associated data set was introduced in 4.1 (4.01 appears to send data to currently active fitpage tab). I think the desired behavior is probably that in 4.01 but should be discussed. The consequence of the current behavior is that one cannot have a theory only page and then load a file to a separate page since the theory page will be considered "empty" and be populated by the data being loaded.

Regardless of the "correct behavior," the current behavior is "accidental" in that it throws an error which I think is due to it finding 2 fitpages without data and thus the "ambiguity" in which should get the data (clearly what it does with the error is that it chooses the lowest number fit page). The error thrown is;

2017-08-05 12:00:03,273 : ERROR : sas.sasgui.guiframe.local_perspectives.plotting.Plotter1D (Plotter1D.pyc:259) :: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
2017-08-05 12:00:03,273 : ERROR : sas.sasgui.guiframe.local_perspectives.plotting.Plotter1D (Plotter1D.pyc:259) :: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

I will close this ticket and open a new one with this information and new title.

Note: See TracTickets for help on using tickets.