lewisfogden / heavylight

A lightweight actuarial modelling framework for Python
https://lewisfogden.github.io/heavylight/
MIT License
5 stars 2 forks source link

Methods are sorted alphabetically when cached, change to sort by order defined #44

Closed lewisfogden closed 2 weeks ago

lewisfogden commented 1 month ago

Users would like methods to appear in .df results according to the order they are defined (so similar functions are grouped together), currently the use of getmembers to get all the methods in the class means they are sorted alphabetically., per https://docs.python.org/3/library/inspect.html#inspect.getmembers

Using a vars or accessing the underlying class __dict__ would avoid this issue.

lewisfogden commented 1 month ago

Fix in: https://github.com/lewisfogden/heavylight/tree/dev_func_sort_order