Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent treatment of x and y in class _AbstractStructure #11

Open
marcelhohn opened this issue Nov 4, 2020 · 0 comments
Open

Inconsistent treatment of x and y in class _AbstractStructure #11

marcelhohn opened this issue Nov 4, 2020 · 0 comments

Comments

@marcelhohn
Copy link

  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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant