Open js850 opened 10 years ago
On the python and cython level we should use keyword arguments rather than required arguments wherever possible. As an example look at https://github.com/pele-python/mcpele/blob/master/mcpele/monte_carlo/_action_cpp.pyx#L18
most of the arguments could have reasonable default values. Besides making things easier to call, it makes it much clearer also:
RecordEnergyHistogram(0, 10, bins=100, eqsteps=1e4)
is much clearer than
RecordEnergyHistogram(0, 10, 100, 1e4)
Where you have to look at the function definition to know what 100 and 1e4 are referring to. Also, we can change the order of the kwargs without worrying about messing anything up.
On the python and cython level we should use keyword arguments rather than required arguments wherever possible. As an example look at https://github.com/pele-python/mcpele/blob/master/mcpele/monte_carlo/_action_cpp.pyx#L18
most of the arguments could have reasonable default values. Besides making things easier to call, it makes it much clearer also:
is much clearer than
Where you have to look at the function definition to know what 100 and 1e4 are referring to. Also, we can change the order of the kwargs without worrying about messing anything up.