-
Notifications
You must be signed in to change notification settings - Fork 12
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
Simplify the shape.py points setter #741
Comments
@shimwell just to be clear, in the snipset you posted, shouldn't the test for MixedShape points ensure values is a list of list of length 3 (X, Y, connection)? |
Additionnaly, this would require to rewrite the @Property as well: @property
def points(self):
return super().points
@points.setter
def points(self, values_in):
super(RotateMixedShape, self.__class__).points.fset(self, values_in) |
ah yes looks like I got the names mixed up. The general idea is that we could move some checking to other classes which add extra checks to the check in the Shape.py class. These extra checks would be run and then the basic checks from Shape.py are also run via the super call |
I am not sure if this is worth the effort as I think in general it would increase the lines of code but perhaps simplify the code a bit |
Yes some of the checks apply to all parametric shapes (hence why they were in Shape in the first place) |
Currently the setter in the shape.py checks quite a lot of things about the points
paramak/paramak/shape.py
Lines 412 to 471 in 785c3ed
This should be simplified and some of the logica can be moved into parametric shape classes that inherit from shape.
For example this could be added to the RotateStraightShape.py as a new setter that makes use of the existing points setter in Shape.py but also extends it
The text was updated successfully, but these errors were encountered: