francescorandi / optics

GNU General Public License v3.0
2 stars 0 forks source link

About parameters #52

Closed ivergara closed 8 years ago

ivergara commented 8 years ago

As it stands now, the parameter management for the oscillators is very primitive. This means that a lot of code is repeated within and across all the oscillators. It works, but a better solution should be found.

One option is to do some abstraction and promote it to a parameter class (the package lmfit implements something like that I believe). This might seem like complicating things, but would reduce errors, make things clearer and follow the DRY principle. Or maybe some metaprogramming with exra decorators.

An interesting view http://kitchingroup.cheme.cmu.edu/blog/2016/04/30/Another-approach-to-docstrings-and-validation-of-args-and-kwargs-in-Python/

ivergara commented 8 years ago

An answer is to use descriptors.

Some useful and interesting resources towards this goal: