pyroll-project / pyroll-core

PyRoll rolling simulation framework - core library.
https://pyroll.readthedocs.io
BSD 3-Clause "New" or "Revised" License
12 stars 7 forks source link

Add Explicit Hook Functions #79

Closed axtimhaus closed 1 year ago

axtimhaus commented 1 year ago

To allow giving lambda functions as explicit hook value. Only on explicit hook values callability will be checked. Allowed are parameterless functions and functions with one parameter (self). So for example:

Profile.round(
    diameter=10e-3,
    density=lambda self: 7.85 / (1 + 3 * 1e-5 * self.temperature),
)