modesolverpy icon indicating copy to clipboard operation
modesolverpy copied to clipboard

Inconsistent treatment of x and y in class _AbstractStructure

Open marcelhohn opened this issue 3 years ago • 0 comments

  1. The following property definitions are inconsistent with one another:

@property def x(self): ''' np.array: The grid points in x. ''' if None not in (self.x_min, self.x_max, self.x_step) and
self.x_min != self.x_max: x = np.arange(self.x_min, self.x_max+self.x_step-self.y_step*0.1, self.x_step) else: x = np.array([]) return x

@property
def y(self):
    '''
    np.array: The grid points in y.
    '''
    if None not in (self.y_min, self.y_max, self.y_step) and \
            self.y_min != self.y_max:
        y = np.arange(self.y_min, self.y_max-self.y_step*0.1, self.y_step)
    else:
        y = np.array([])
    return y

In the definition for x, x_max will be included in the grid. For y, it won't. Is this intended?

  1. There is a typo in the line " x = np.arange(self.x_min, self.x_max+self.x_step-self.y_step0.1, self.x_step)". You are substracting self.y_step0.1, but it should be self.x_step*0.1. Probably hasn't been seen yet because I guess most people use uniform grid spacing and then it doesn't matter

marcelhohn avatar Nov 04 '20 19:11 marcelhohn