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

Suggestion: use properties for these methods #74

Open
mpvanderschelling opened this issue Dec 6, 2023 · 0 comments
Open

Suggestion: use properties for these methods #74

mpvanderschelling opened this issue Dec 6, 2023 · 0 comments

Comments

@mpvanderschelling
Copy link

Problem

These methods are currently implemented as individual statements, but they could be implemented as the result of a function. This allows them to be documented better. Instead of functions, these would allow the user to access the values as if they were attributes, which is more pythonic.

Proposed solution

change

self.len_start = -1 * self.radius_mu

to

@property
def len_start(self):
    return -1 * self.radius_mu

Assignees:
Labels:

# initial coordinate for position of fibre
self.len_start = -1 * self.radius_mu
self.len_end = self.length + self.radius_mu
self.wid_start = -1 * self.radius_mu
self.wid_end = self.width + self.radius_mu
self.hei_start = -1 * self.radius_mu
self.hei_end = self.height + self.radius_mu

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