Ignore:
Timestamp:
Mar 26, 2017 11:33:16 PM (7 years ago)
Author:
andyfaff
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, costrafo411, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
ed2276f
Parents:
9146ed9
Message:

MAINT: import numpy as np

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/plottools/plottables.py

    ra9f579c r9a5097c  
    4343# Support for ancient python versions 
    4444import copy 
    45 import numpy 
     45import numpy as np 
    4646import sys 
    4747import logging 
     
    706706                self.dy = None 
    707707            if not has_err_x: 
    708                 dx = numpy.zeros(len(x)) 
     708                dx = np.zeros(len(x)) 
    709709            if not has_err_y: 
    710                 dy = numpy.zeros(len(y)) 
     710                dy = np.zeros(len(y)) 
    711711            for i in range(len(x)): 
    712712                try: 
     
    796796        tempdy = [] 
    797797        if self.dx == None: 
    798             self.dx = numpy.zeros(len(self.x)) 
     798            self.dx = np.zeros(len(self.x)) 
    799799        if self.dy == None: 
    800             self.dy = numpy.zeros(len(self.y)) 
     800            self.dy = np.zeros(len(self.y)) 
    801801        if self.xLabel == "log10(x)": 
    802802            for i in range(len(self.x)): 
     
    826826        tempdy = [] 
    827827        if self.dx == None: 
    828             self.dx = numpy.zeros(len(self.x)) 
     828            self.dx = np.zeros(len(self.x)) 
    829829        if self.dy == None: 
    830             self.dy = numpy.zeros(len(self.y)) 
     830            self.dy = np.zeros(len(self.y)) 
    831831        if self.yLabel == "log10(y)": 
    832832            for i in range(len(self.x)): 
     
    859859        tempdy = [] 
    860860        if self.dx == None: 
    861             self.dx = numpy.zeros(len(self.x)) 
     861            self.dx = np.zeros(len(self.x)) 
    862862        if self.dy == None: 
    863             self.dy = numpy.zeros(len(self.y)) 
     863            self.dy = np.zeros(len(self.y)) 
    864864        if xmin != None and xmax != None: 
    865865            for i in range(len(self.x)): 
     
    12281228 
    12291229def sample_graph(): 
    1230     import numpy as nx 
     1230    import numpy as np 
    12311231 
    12321232    # Construct a simple graph 
    12331233    if False: 
    1234         x = nx.array([1, 2, 3, 4, 5, 6], 'd') 
    1235         y = nx.array([4, 5, 6, 5, 4, 5], 'd') 
    1236         dy = nx.array([0.2, 0.3, 0.1, 0.2, 0.9, 0.3]) 
     1234        x = np.array([1, 2, 3, 4, 5, 6], 'd') 
     1235        y = np.array([4, 5, 6, 5, 4, 5], 'd') 
     1236        dy = np.array([0.2, 0.3, 0.1, 0.2, 0.9, 0.3]) 
    12371237    else: 
    1238         x = nx.linspace(0, 1., 10000) 
    1239         y = nx.sin(2 * nx.pi * x * 2.8) 
    1240         dy = nx.sqrt(100 * nx.abs(y)) / 100 
     1238        x = np.linspace(0, 1., 10000) 
     1239        y = np.sin(2 * np.pi * x * 2.8) 
     1240        dy = np.sqrt(100 * np.abs(y)) / 100 
    12411241    data = Data1D(x, y, dy=dy) 
    12421242    data.xaxis('distance', 'm') 
Note: See TracChangeset for help on using the changeset viewer.