New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ new interface #6
Conversation
I find it a little cleaner to import the concrete methods/variables in |
LGTM, see those comments! |
Will merge this if you approve @jonasvdd & then I can make first real release! 🚀 Besides documentation, the (afaik) only major TODO is getting rid of the assumption of fixed sampling rate 🤔 |
let mut avg_y: Ty = Ty::default(); | ||
// let mut avg_x: Tx = Tx::default(); | ||
// let mut avg_y: Ty = Ty::default(); | ||
// TODO: check the impact of using f64 (is necessary to avoid overflow) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has this been checked? @jvdd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not yet, but will leave this to another PR (that thoroughly profiles the code)
@@ -93,17 +96,19 @@ pub fn lttb_without_x<Ty: Num>(y: ArrayView1<Ty>, n_out: usize) -> Array1<usize> | |||
|
|||
for i in 0..n_out - 2 { | |||
// Calculate point average for next bucket (containing c). | |||
let mut avg_y: Ty = Ty::default(); | |||
// let mut avg_y: Ty = Ty::default(); | |||
// TODO: check impact of using f64 (is necessary to avoid overflow) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔝
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you just provide me with an answer to the questions? If these are resolved. I think this PR is ready to merge!
Impressive work 💪🏼
@jvdd, I think we can tackle the M2 building in a new PR and merge this one? 🙏🏼 |
Ready to squash and merge 🚀 |
In this PR we transfer from
pandas.Series
as representation for time series to a purelynp.ndarray
based representation(
pandas.Series
its index can at this time not represent most numeric dtypes, e.g. int16)The signature for the downsample methdod is changed to:
Note the following:
x
is optional, allowing the same (memory) efficient runtime as withpd.RangeIndex
x
andy
are both positional arguments (this is in line with how the matplotlib,pyplot.plot signature is)n_out
is a mandatory keyword argumentExample:
Other aspects of this PR
x
andy
datetime64
: view the array asnp.int64
x
andy
timedelta64
: view the array asnp.int64
y
bool: view the array asnp.int8
(under the hood numpy represents a bool as 8 bits)y
int8 & uint8support categorical data=> out of scope for this PR, would mostly be some Python code converting it to an encoding (which is perhaps not the responsibility of this library...) - also not really sure how numpy would represent categorical dataMajor TODOs: