Skip to content

fix: restore numeric vector outputs#63

Merged
serkor1 merged 2 commits into
serkor1:develfrom
nvphungdev:fix/one-dimensional-return-class
May 17, 2026
Merged

fix: restore numeric vector outputs#63
serkor1 merged 2 commits into
serkor1:develfrom
nvphungdev:fix/one-dimensional-return-class

Conversation

@nvphungdev
Copy link
Copy Markdown
Contributor

Summary

  • normalize one-column numeric indicator outputs back to double vectors
  • update the generated numeric templates so future wrappers keep the same behavior
  • tighten generated numeric tests to reject one-column matrix results while preserving multi-column matrix outputs

Validation

  • bash -n codegen/generate_unit-tests.sh
  • git diff --check
  • rg "is.null\(dim\(x\)\)|numeric methods returns <matrix>" R codegen tests -n (no matches)
  • Not run: R/testthat suite; R/Rscript are unavailable in this environment.

Fixes #61

Signed-off-by: nvphungdev <283886185+nvphungdev@users.noreply.github.com>
@serkor1 serkor1 added the bug Something isn't working label May 17, 2026
Copy link
Copy Markdown
Owner

@serkor1 serkor1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @nvphungdev ,

Thank you so much for taking the time to submit a (almost mergable) PR. This is highly appreciated.
I have added a few comments that needs to be resolved before it can merged, but they are really minor.

Generally the lookback attribute is meant for the charting API, what is the rationale for adding the attribute in the numeric method? Have I missed something here?

Best,

Comment thread codegen/templates/moving_average_template.R.in
Comment thread codegen/templates/numeric_template.R.in
Comment thread R/utils.R
Signed-off-by: nvphungdev <283886185+nvphungdev@users.noreply.github.com>
@nvphungdev
Copy link
Copy Markdown
Contributor Author

Hi @serkor1
Thanks, simplified this as suggested. I removed the helper abstraction and inlined the one-column matrix conversion in the numeric templates/generated methods. I also removed the lookback preservation from the numeric output path.

@serkor1
Copy link
Copy Markdown
Owner

serkor1 commented May 17, 2026

Awesome! Great work, thank you so much. I will merge the branch ASAP.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 17, 2026

Codecov Report

❌ Patch coverage is 96.55172% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 96.67%. Comparing base (3abdfd2) to head (6c15f8c).

Files with missing lines Patch % Lines
R/ta_VOLUME.R 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            devel      #63      +/-   ##
==========================================
+ Coverage   96.58%   96.67%   +0.09%     
==========================================
  Files         280      280              
  Lines       21012    21012              
==========================================
+ Hits        20294    20314      +20     
+ Misses        718      698      -20     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@serkor1 serkor1 merged commit 4e6ce9e into serkor1:devel May 17, 2026
9 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 Broken contract in 1D numeric methods

2 participants