We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Given the current API (v0.3.1) there does not seem to be a straightforward way to do a unary operation.
Suppose one wishes to negate a boolean valued signal. One option is:
import traces x = traces.TimeSeries([(0, False), (1, True)]) x.operation(x, lambda val, _: not val)
but this seems somewhat clunky.
Better might be
import traces x = traces.TimeSeries([(0, True), (1, False)]) x.map(lambda val: not val)
Which could be syntatic sugar for:
traces.TimeSeries((t, not val) for (t, v) in x))
The text was updated successfully, but these errors were encountered:
You're right, this would be a nice addition!
Sorry, something went wrong.
@vlsd I've actually written a library inspired by traces that supports this operation:
https://github.com/mvcisback/DiscreteSignals
No branches or pull requests
Given the current API (v0.3.1) there does not seem to be a straightforward way to do a unary operation.
Suppose one wishes to negate a boolean valued signal. One option is:
but this seems somewhat clunky.
Better might be
Which could be syntatic sugar for:
The text was updated successfully, but these errors were encountered: