thodson-usgs / ratingcurve

A Python library for fitting streamflow rating curves.
https://thodson-usgs.github.io/ratingcurve/
Other
18 stars 4 forks source link

Coerce rating input data #28

Open thodson-usgs opened 1 year ago

thodson-usgs commented 1 year ago

A rating will often be initialized using a dataframe as in many of the examples

powerrating = PowerLawRating(q=df['q'],
                             h=df['stage'], 
                             q_sigma=df['q_sigma'],
                             segments=segments,
                             prior={'distribution':'uniform'})

However, q, h, etc. are pd.Series and may not behave the same as when powerrating is initialized with arrays. As part of __init__ these should be coerced to a specific data type so that methods don't have to guess their data type.