Changeset 4660990 in sasview


Ignore:
Timestamp:
Sep 14, 2017 2:25:41 PM (7 years ago)
Author:
krzywon
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
e56f335
Parents:
c54c965
Message:

Remove empty dx and dy arrays.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/dataloader/file_reader_base_class.py

    rc54c965 r4660990  
    115115                data.y = np.asarray([data.y[i] for i in ind]).astype(np.float64) 
    116116                if data.dx is not None: 
     117                    if len(data.dx) == 0: 
     118                        data.dx = None 
     119                        continue 
    117120                    data.dx = np.asarray([data.dx[i] for i in ind]).astype(np.float64) 
    118121                if data.dxl is not None: 
     
    121124                    data.dxw = np.asarray([data.dxw[i] for i in ind]).astype(np.float64) 
    122125                if data.dy is not None: 
     126                    if len(data.dy) == 0: 
     127                        data.dy = None 
     128                        continue 
    123129                    data.dy = np.asarray([data.dy[i] for i in ind]).astype(np.float64) 
    124130                if data.lam is not None: 
     
    204210        x = np.zeros(no_lines) 
    205211        y = np.zeros(no_lines) 
    206         self.current_dataset = plottable_1D(x, y) 
     212        dx = np.zeros(no_lines) 
     213        dy = np.zeros(no_lines) 
     214        self.current_dataset = plottable_1D(x, y, dx, dy) 
    207215 
    208216    @staticmethod 
Note: See TracChangeset for help on using the changeset viewer.