Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upFeature/new date and datetime vector classes (closes #34) #557
Conversation
new DateVector & DatetimeVector
tests passed, need to figure out pre-release how to phase this in will run at least one full rev.dep check with this on
|
@kevinushey @thirdwing @jjallaire : If you could have a look at this one which in essence |
default is empty string == not set which implies local timezone that is what we had before, and what R does
|
Running a full rev.dep now with the 'new' classes turned on. All good so far, not a single new failure. Currently at 130 out of 801 with 128 good and two (know, repeat) offenders. Will report back this evening. Paging @kevinushey @thirdwing @jjallaire for a look at this. Also: full-blown one-year deprecation, or is this more of a 'same API internal representation change' that we could release as is? Thoughts? |
|
Passed with flying colours; 794 ok, 7 fails of which 4 happened before, 1 happens with release version of Rcpp, 1 lacked an external (web resource) and 1 was spurious (package upgraded while test ran). |
|
So I plan to merge to merge this in short little while. @kevinushey : comments now or after the fact :) |
| // this will not be on by default | ||
| #if defined(RCPP_NEW_DATE_DATETIME_VECTORS) | ||
|
|
||
| typedef oldDateVector DateVector; |
kevinushey
Oct 18, 2016
•
Contributor
It looks like the two #ifdef blocks here are identical; is the intention for these to be newDateVector?
It looks like the two #ifdef blocks here are identical; is the intention for these to be newDateVector?
eddelbuettel
Oct 18, 2016
Author
Member
Oops.
Oops.
| private: | ||
|
|
||
| void setClass() { | ||
| Rf_setAttrib(*this, R_ClassSymbol, Rf_mkString("Date")); |
kevinushey
Oct 18, 2016
Contributor
Although it might not be a problem here, Rf_mkString() should be protected before being passed to Rf_setAttrib() (otherwise if Rf_setAttrib() did any R allocation that "Date" SEXP could be collected)
Although it might not be a problem here, Rf_mkString() should be protected before being passed to Rf_setAttrib() (otherwise if Rf_setAttrib() did any R allocation that "Date" SEXP could be collected)
eddelbuettel
Oct 18, 2016
Author
Member
Sure. I'll assign to Shield<SEXP> first, then call Rf_setAttrib().
Sure. I'll assign to Shield<SEXP> first, then call Rf_setAttrib().
|
Will make those changes, thanks! |
| // this will not be on by default | ||
| #if defined(RCPP_NEW_DATE_DATETIME_VECTORS) | ||
|
|
||
| typedef oldDateVector DateVector; |
eddelbuettel
Oct 18, 2016
Author
Member
Oops.
Oops.
| private: | ||
|
|
||
| void setClass() { | ||
| Rf_setAttrib(*this, R_ClassSymbol, Rf_mkString("Date")); |
eddelbuettel
Oct 18, 2016
Author
Member
Sure. I'll assign to Shield<SEXP> first, then call Rf_setAttrib().
Sure. I'll assign to Shield<SEXP> first, then call Rf_setAttrib().
with thanks to @kevinushey
|
Currently more than 50% done on a second rev.dep run with these changes. |
roll Version, Date
|
Just committed the summary to rcpp-logs: five new build failures. Three of which get fixed with a one-line addition I already made (providing So I will merge the PR later today unless somebody screams real loud and real soon . |
This PR is, in aggregate, not changing anything because the 'new' part is not (yet) activated.
The switch is in the (new) header file
inst/include/Rcpp/date_datetime/date_datetime.hwhich regroups all#includefor Date/Datetime and their vector variants.For now, we
typedefthe old and existing code in. I think this can be merged as it allows for more testing. We can allow for the usual one-year deprecation (or accelerate it if we feel the change was so trivial).I use these in my packages RQuantLib, Rblpapi, and anytime -- and want the new and better
DatetimeVector(a reclassed `NumericVector) there. T he rev.dep checks I will do may tell me a bit more about other packages using this.