Open dylanhross opened 9 months ago
Something else to think about: I already have an amount of code that uses these functions as they currently exist. Making this change outright would break those applications. Maybe an incremental change would work better. For instance, add an optional kwarg like pack
(default to False) which would make the functions return the packed tuples row-wise instead of column-wise as they currently are. This is like the inverse of the unpack
option in numpy.genfromtxt
. This change would make the new behavior opt-in at the beginning, then in later releases the default value could be changed to True making the old behavior opt-in instead, and finally maybe even completely deprecate the old behavior later on down the line.
I want to be able to do something like
but instead it just returns separate arrays for each of the fitted parameters (x, ht, wt) so that you have to use
zip
to iterate peak by peak. I feel that iterating peak by peak (withoutzip
, as in the example above) is a much more rational use case so these functions should return a list split by peaks rather than lists split by peak parameters.Also a possible improvement would be to make them into generators that yield one peak at a time.