Changeset 40a87fa in sasmodels for sasmodels/data.py


Ignore:
Timestamp:
Aug 8, 2016 9:24:11 AM (8 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
2472141
Parents:
2d65d51
Message:

lint and latex cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/data.py

    r56b2687 r40a87fa  
    155155 
    156156class SesansData(Data1D): 
     157    """ 
     158    SESANS data object. 
     159 
     160    This is just :class:`Data1D` with a wavelength parameter. 
     161 
     162    *x* is spin echo length and *y* is polarization (P/P0). 
     163    """ 
    157164    def __init__(self, **kw): 
    158165        Data1D.__init__(self, **kw) 
     
    213220        self._zaxis, self._zunit = "z", "" 
    214221        self.x_bins, self.y_bins = None, None 
     222        self.filename = None 
    215223 
    216224    def xaxis(self, label, unit): 
     
    377385 
    378386 
    379 def protect(fn): 
     387def protect(func): 
    380388    # type: (Callable) -> Callable 
    381389    """ 
     
    388396        """ 
    389397        try: 
    390             return fn(*args, **kw) 
     398            return func(*args, **kw) 
    391399        except Exception: 
    392400            traceback.print_exc() 
     
    410418    use_calc = use_theory and Iq_calc is not None 
    411419    num_plots = (use_data or use_theory) + use_calc + use_resid 
    412     non_positive_x = (data.x<=0.0).any() 
     420    non_positive_x = (data.x <= 0.0).any() 
    413421 
    414422    scale = data.x**4 if view == 'q4' else 1.0 
     
    456464        plt.subplot(1, num_plots, 2) 
    457465        qx, qy, Iqxy = Iq_calc 
    458         plt.pcolormesh(qx, qy[qy>0], np.log10(Iqxy[qy>0,:])) 
     466        plt.pcolormesh(qx, qy[qy > 0], np.log10(Iqxy[qy > 0, :])) 
    459467        plt.xlabel("$q_x$/A$^{-1}$") 
    460468        plt.xlabel("$q_y$/A$^{-1}$") 
     
    508516        plt.xlabel('spin echo length ({})'.format(data._xunit)) 
    509517        if is_tof: 
    510             plt.ylabel('(Log (P/P$_0$))/$\lambda^2$') 
     518            plt.ylabel(r'(Log (P/P$_0$))/$\lambda^2$') 
    511519        else: 
    512520            plt.ylabel('polarization (P/P0)') 
Note: See TracChangeset for help on using the changeset viewer.