-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
Move index attributes to index object #245
Comments
This is required before #190 can be completed. |
Mark `indexTZ()` and `indexTZ<-` as deprecated, if only to make their usage easier to find during testing and reverse dependency checks. Remove their S3 methods and call their respective "tzone" function instead. Replace calls to indexTZ() with calls to tzone(). Remove all uses of 'xts_IndexTZSymbol' in C code, including the macros 'GET_xtsIndexTZ' and 'SET_xtsIndexTZ'. Opportunistically remove .indexTZ and tzone attributes from objects created using prior versions of xts. Also remove "TZ" name attribute from `tzone<-.xts`. Rename R/indexTZ.R to R/tzone.R, and man/indexTZ.Rd to man/tzone.Rd. See #245.
Mark `indexClass()` and `indexClass<-` as deprecated, if only to make their usage easier to find during testing and reverse dependency checks. Remove their S3 methods and call their respective "tclass" function instead. Replace calls to indexClass() with calls to tclass(). Remove all uses of 'xts_IndexClassSymbol' in C code, including the macros 'GET_xtsIndexClass' and 'SET_xtsIndexClass'. Opportunistically remove .indexCLASS and tclass attributes from objects created using prior versions of xts. Rename R/indexClass.R to R/tclass.R and man/indexClass.Rd to man/tclass.Rd. See #245.
Mark `indexTZ()` and `indexTZ<-` as deprecated, if only to make their usage easier to find during testing and reverse dependency checks. Remove their S3 methods and call their respective "tzone" function instead. Replace calls to indexTZ() with calls to tzone(). Remove all uses of 'xts_IndexTZSymbol' in C code, including the macros 'GET_xtsIndexTZ' and 'SET_xtsIndexTZ'. Opportunistically remove .indexTZ and tzone attributes from objects created using prior versions of xts. Also remove "TZ" name attribute from `tzone<-.xts`. Rename R/indexTZ.R to R/tzone.R, and man/indexTZ.Rd to man/tzone.Rd. See #245.
Mark `indexClass()` and `indexClass<-` as deprecated, if only to make their usage easier to find during testing and reverse dependency checks. Remove their S3 methods and call their respective "tclass" function instead. Replace calls to indexClass() with calls to tclass(). Remove all uses of 'xts_IndexClassSymbol' in C code, including the macros 'GET_xtsIndexClass' and 'SET_xtsIndexClass'. Opportunistically remove .indexCLASS and tclass attributes from objects created using prior versions of xts. Rename R/indexClass.R to R/tclass.R and man/indexClass.Rd to man/tclass.Rd. See #245.
Mark `indexFormat()` and `indexFormat<-` as deprecated, if only to make their usage easier to find during testing and reverse dependency checks. Remove their S3 methods and call their respective "tformat" functions instead. Replace calls to indexFormat() with calls to tformat(). Remove all uses of 'xts_IndexFormatSymbol' in C code, including the macros 'GET_xtsIndexFormat' and 'SET_xtsIndexFormat'. Opportunistically remove .indexFORMAT attribute from objects created using prior versions of xts. Rename R/indexFormat.R to R/tformat.R. See #245.
Index attributes will no longer be attached to the xts object itself, so warn the user if they pass deprecated arguments to the xts constructor. See #245.
Reverse-dependency checks indicate issues in the following packages: geoSpectral, PRISM.forecast, and RcppXts. geoSpectralAt least one example fails:
And at least one test fails for what looks like a similar reason:
PRISM.forecastExample fails:
RcppXtsTest fails:
|
The RcppXts bug is in the xts C function X <- xts(1:4, order.by=Sys.time()+0:3)
rbx <- function(..., dup = FALSE, deparse.level = 1) {
.External("rbindXts", dup = dup, ..., PACKAGE = "xts")
}
rbx(X, X, dup = TRUE) The PRISM.forecast bug can be replicated with: data(sample_matrix)
x <- as.xts(sample_matrix)
drop(x[,1])-coredata(x[,1:2]) The geoSpectral bug requires debugging S4, which I'm not particularly good at. |
Calling lengthgets() creates a new object, which will not have the same attributes as the original object. Wait to copy the original index attributes to the new index until after lengthgets() is potentially called. See #245.
Mark `indexTZ()` and `indexTZ<-` as deprecated, if only to make their usage easier to find during testing and reverse dependency checks. Remove their S3 methods and call their respective "tzone" function instead. Replace calls to indexTZ() with calls to tzone(). Remove all uses of 'xts_IndexTZSymbol' in C code, including the macros 'GET_xtsIndexTZ' and 'SET_xtsIndexTZ'. Opportunistically remove .indexTZ and tzone attributes from objects created using prior versions of xts. Also remove "TZ" name attribute from `tzone<-.xts`. Rename R/indexTZ.R to R/tzone.R, and man/indexTZ.Rd to man/tzone.Rd. See #245.
Mark `indexClass()` and `indexClass<-` as deprecated, if only to make their usage easier to find during testing and reverse dependency checks. Remove their S3 methods and call their respective "tclass" function instead. Replace calls to indexClass() with calls to tclass(). Remove all uses of 'xts_IndexClassSymbol' in C code, including the macros 'GET_xtsIndexClass' and 'SET_xtsIndexClass'. Opportunistically remove .indexCLASS and tclass attributes from objects created using prior versions of xts. Rename R/indexClass.R to R/tclass.R and man/indexClass.Rd to man/tclass.Rd. See #245.
Mark `indexFormat()` and `indexFormat<-` as deprecated, if only to make their usage easier to find during testing and reverse dependency checks. Remove their S3 methods and call their respective "tformat" functions instead. Replace calls to indexFormat() with calls to tformat(). Remove all uses of 'xts_IndexFormatSymbol' in C code, including the macros 'GET_xtsIndexFormat' and 'SET_xtsIndexFormat'. Opportunistically remove .indexFORMAT attribute from objects created using prior versions of xts. Rename R/indexFormat.R to R/tformat.R. See #245.
Index attributes will no longer be attached to the xts object itself, so warn the user if they pass deprecated arguments to the xts constructor. See #245.
Calling lengthgets() creates a new object, which will not have the same attributes as the original object. Wait to copy the original index attributes to the new index until after lengthgets() is potentially called. See #245.
It looks like the PRISM.forecast error is due to malformed xts objects being created in the |
We need an all.equal.xts() method to handle the case where all.equal() is called with one xts object that has index attributes on the object and one that only has them on the index. This can cause unit test failures, and did in the "argo" package. The function only removes the index attributes from either (or both) objects before calling NextMethod(). I avoided the urge to check the attributes attached to the object and index for consistency, and chose what seemed to be a simpler approach. See #245.
Silly bug. Add tests for tclass(), tformat(), and tzone(). See #245.
Check for .indexFORMAT and tformat passed to the constructor via '...'. Warn that .indexFORMAT is deprecated, but still use it. We will raise this to an error in a later version. This means the special handling for Ops.xts() is now handled as part of the more general case. It's also not strictly needed, because Ops.xts() no longer passes .indexFORMAT to the constructor. Remove these two elements from '...' before attaching the remaining elements to the result (as user attributes). See #245.
Check for .indexCLASS and tclass passed to the constructor via '...'. Warn that .indexCLASS is deprecated, but still use it. We will raise this to an error in a later version. Also warn if the tclass attribute on the index is not the same as the tclass argument default value ("POSIXct", "POSIXt"). Current behavior over-rides the index tclass attribute with the default argument value. This seems like a bug, but it may break existing code, so warn before changing or converting to an error. Remove these two elements from '...' before attaching the remaining elements to the result (as user attributes). Remove the indexClass() call from the checkXtsClass() test function, since indexClass() is deprecated. See #245.
Check for .indexTZ and tzone passed to the constructor via '...'. Warn that .indexTZ is deprecated and will be ignored. This is consistent with current behavior, but differs from the other two attributes that can be over-ridden via arguments passed via '...'. Remove these two elements from '...' before attaching the remaining elements to the result (as user attributes). Remove the indexTZ() call from the checkXtsTz() test function, since indexTZ() is deprecated. See #245.
We need to drop any index attributes (i.e deprecated .index* and tformat) passed via '...', but retain any user attributes and standard attributes like dim, dimnames, etc. Note that tclass and tzone are not included in the dropped attributes because they are formal arguments to the constructor, and therefore do not appear in '...'. See #245.
The current behavior ignores the tclass attribute on the index passed to .xts(). This is a bug, but throwing a warning breaks existing packages and causes errors in their CRAN checks. Reinstate the warning after fixing dependencies. See #245.
Missed this change while working on #245. Thanks to Claymore Marshall for catching it!
When e1 and e2 do not have identical indexes, we overwrite them with the result of merge(..., retclass = FALSE). That means they no longer have a 'class' attribute, but they still have their 'index' attribute. Next, we calculate 'e' using the Ops method for 'matrix' objects, which means 'e' won't have an index attribute. Also add default methods for `tclass` and `tclass<-`. These were missed during the updates for #245. Fixes #322.
indexClass() was deprecated when all index attributes were moved from the xts object directly to the index. See #245.
The xts class was originally implemented with the index class and index timezone attributes attached to the xts object itself. That means the xts class needs to know about all possible index classes, which makes it difficult to extend xts to use a new index class.
Jeff started to move the index-specific attributes from the xts object to the index object. See the commit message for e4edc53.
Most places currently set attributes on both objects, because it's not clear which components of xts depend on the index-specific attributes being attached to either object (xts or index).
We would first need to ensure that all attempts to access the index class or timezone are getting and returning values from the index object (note that this applies to R and C code). Then we would need to remove all attempts to set attributes on the xts object... and see what breaks.
The text was updated successfully, but these errors were encountered: