feat(bindings): tnumber unary functions (abs, derivative, degrees, radians)#30
Closed
estebanzimanyi wants to merge 1 commit into
Closed
feat(bindings): tnumber unary functions (abs, derivative, degrees, radians)#30estebanzimanyi wants to merge 1 commit into
estebanzimanyi wants to merge 1 commit into
Conversation
…dians) Adds 6 ScalarFunction registrations for unary tnumber functions: abs(tint) -> tint (MEOS: tnumber_abs) abs(tfloat) -> tfloat (MEOS: tnumber_abs) derivative(tfloat) -> tfloat (MEOS: temporal_derivative) degrees(tfloat) -> tfloat (MEOS: tfloat_degrees, normalize=false) degrees(tfloat, BOOL) -> tfloat (MEOS: tfloat_degrees, normalize=arg) radians(tfloat) -> tfloat (MEOS: tfloat_radians) Implementation reuses the templated wrapper helpers from PR #27. Temporal_derivative was already declared and implemented in src/temporal/temporal_functions.cpp (Math functions block) but was never registered; this PR registers it without duplicating the body. Smoke test: SELECT abs(tint '[-1@2000-01-01, 2@2000-01-02]'); -> [1@2000-01-01 00:00:00+00, 2@2000-01-02 00:00:00+00] SELECT derivative(tfloat '[1@2000-01-01, 4@2000-01-04]'); -> Interp=Step;[1.157e-05@..., 1.157e-05@...] SELECT degrees(tfloat '[0@2000-01-01, 3.14159@2000-01-02]'); -> [0@..., 179.9998479605043@...] SELECT radians(tfloat '[0@2000-01-01, 180@2000-01-02]'); -> linear-radians value sequence Stacked on PR #29 (tnumber arithmetic). Full suite passes (747 assertions, 13 test cases).
This was referenced Apr 25, 2026
Member
Author
|
Consolidated into #43 (tnumber numeric functions — arithmetic + unary + distance). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds 6 ScalarFunction registrations for unary tnumber functions:
abs(tint) -> tinttnumber_absabs(tfloat) -> tfloattnumber_absderivative(tfloat) -> tfloattemporal_derivativedegrees(tfloat) -> tfloattfloat_degrees(t, false)degrees(tfloat, BOOL) -> tfloattfloat_degrees(t, normalize)radians(tfloat) -> tfloattfloat_radiansTemporal_derivativewas already declared and implemented insrc/temporal/temporal_functions.cppbut was never registered; this PR registers it without duplicating the body.Implementation reuses the templated wrapper helpers from PR #27 (
TemporalUnary/TemporalBinaryV<bool>).Smoke test
Test plan
make releasethenTZ=UTC ./build/release/test/unittest "<proj>/test/*"— full suite passes.026_tnumber_mathfuncs.testskip block fully unwraps.Dependencies
Stacked on PR #29 (tnumber arithmetic). Merge order: #27 → #29 → this.