-
-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
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
Feature/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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the two #ifdef
blocks here are identical; is the intention for these to be newDateVector
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops.
private: | ||
|
||
void setClass() { | ||
Rf_setAttrib(*this, R_ClassSymbol, Rf_mkString("Date")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. I'll assign to Shield<SEXP>
first, then call Rf_setAttrib()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will make those changes, thanks!
// this will not be on by default | ||
#if defined(RCPP_NEW_DATE_DATETIME_VECTORS) | ||
|
||
typedef oldDateVector DateVector; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops.
private: | ||
|
||
void setClass() { | ||
Rf_setAttrib(*this, R_ClassSymbol, Rf_mkString("Date")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.h
which regroups all#include
for Date/Datetime and their vector variants.For now, we
typedef
the 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.