bessagroup / rvesimulator

Automated representative volume element simulator via abaqus for material constitutive law discovery
https://bessagroup.github.io/rvesimulator/
MIT License
14 stars 2 forks source link

Suggestion: use properties for these methods #74

Open mpvanderschelling opened 10 months ago

mpvanderschelling commented 10 months ago

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:

https://github.com/bessagroup/rvesimulator/blob/ea31752a6da3131cfe55027895ac23ddf684f3de/src/rvesimulator/microstructure/shpere_particles.py#L96-L103