Skip to content

Check curve parameters too, gets partial matching as side benefit - #205

Merged
eddelbuettel merged 1 commit into
masterfrom
fix/issue201
Jul 26, 2026
Merged

Check curve parameters too, gets partial matching as side benefit#205
eddelbuettel merged 1 commit into
masterfrom
fix/issue201

Conversation

@eddelbuettel

Copy link
Copy Markdown
Owner

Thanks for posting such a nice and concise 'minimally complete and verifiable example' in #201, @m-muecke. With this small change of also dispatching to match.arg for curveparams, we actually get partial matching in a controlled way. And the example just works:

edd@paul:~/git/rquantlib(fix/issue201)$ Rscript misc/issue201.R | head
$table
           date zeroRates discount
1    2026-07-27 0.0143806 1.000000
2    2026-07-28 0.0143926 0.999961
3    2026-07-29 0.0144000 0.999921
4    2026-07-30 0.0144073 0.999882
5    2026-07-31 0.0144145 0.999842
6    2026-08-01 0.0144217 0.999802
7    2026-08-02 0.0144290 0.999763
8    2026-08-03 0.0144362 0.999723
Error in print.default(m, ..., quote = quote, right = right, max = max) : 
  ignoring SIGPIPE signal
Calls: <Anonymous> ... <Anonymous> -> print.data.frame -> print -> print.default
Execution halted
edd@paul:~/git/rquantlib(fix/issue201)$ 

Piped into head which gets us the SIGPIPE noise. If I add a str() around the result instead things are nicer:

edd@paul:~/git/rquantlib(fix/issue201)$ Rscript misc/issue201.R 
List of 1
 $ table:'data.frame':  3651 obs. of  3 variables:
  ..$ date     : Date[1:3651], format: "2026-07-27" "2026-07-28" "2026-07-29" "2026-07-30" ...
  ..$ zeroRates: num [1:3651] 0.0144 0.0144 0.0144 0.0144 0.0144 ...
  ..$ discount : num [1:3651] 1 1 1 1 1 ...
 - attr(*, "class")= chr "DiscountCurve"
edd@paul:~/git/rquantlib(fix/issue201)$ 

@eddelbuettel

Copy link
Copy Markdown
Owner Author

Also: I generally avoid making 'whitespace only' changes but this is a fairly old file and some lines just weren't indented right. At GitHub use 'hide whitespace' in diff settings i.e.

image

@eddelbuettel
eddelbuettel merged commit c0e00e8 into master Jul 26, 2026
5 of 6 checks passed
@eddelbuettel
eddelbuettel deleted the fix/issue201 branch July 26, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant