Skip to content
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/temporal types #58

Merged
merged 32 commits into from
Mar 23, 2020
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
d790071
added new temporal types 'nanoival', 'period' and 'duration'
lsilvest Nov 27, 2019
85a46a0
use GitHub version of RcppCCTZ for Travis CI test
eddelbuettel Nov 28, 2019
2cc5a9e
update ChangeLog
eddelbuettel Nov 28, 2019
5827b14
roll minor version, add tail to NAMESPACE
eddelbuettel Nov 30, 2019
76f1563
use 'Collate' in DESCRIPTION for controlled loading of R files; corre…
lsilvest Dec 5, 2019
17043a4
generate warning on 'nanoival' overflow
lsilvest Dec 8, 2019
e96a21e
fix warnings by moving ops with 'duration' and 'period' to their resp…
lsilvest Dec 8, 2019
3616963
check vector lengths on binary operations
lsilvest Dec 17, 2019
965c03c
rename 'period'->'nanoperiod' and 'duration'->'nanoduration'
lsilvest Jan 3, 2020
0d97e77
fix 'nanoduration' negative numbers
lsilvest Feb 16, 2020
af76ea9
S3/S4 type conversions; closes #47
lsilvest Feb 19, 2020
6f1696d
comparison with POSIXct; closes #57
lsilvest Feb 19, 2020
85a3076
check 'data.table' in the same way as 'data.frame': the constructors …
lsilvest Feb 20, 2020
225c057
short printout; closes #51
lsilvest Feb 24, 2020
abb91a0
make test file conditional on data.table present, and load if needed
eddelbuettel Feb 24, 2020
57f856a
'seq' functions for all types where it makes sense; correct handling …
lsilvest Mar 1, 2020
612c11e
documention; only only strange warning for 'integer64' left
lsilvest Mar 5, 2020
f506e8c
fix last documentation warning
lsilvest Mar 5, 2020
af82ca9
better documentation; fix unary '-', '+' for 'nanoperiod'
lsilvest Mar 10, 2020
8474c76
provide 'nanotime,nanotime' set operations
lsilvest Mar 10, 2020
0ff0acf
remove the slow 'push_back' statements in 'interval.cpp' for set ops;…
lsilvest Mar 10, 2020
e4ce29d
comment mod to reflect new implementation; component accessors (e.g…
lsilvest Mar 15, 2020
18bc559
small update to src/Makevars, roll version
eddelbuettel Mar 15, 2020
f1f1de9
quieter compilation without four type-punning messages, add cleanup
eddelbuettel Mar 15, 2020
108ea4f
minor Rcpp tweaks
eddelbuettel Mar 19, 2020
cd2be6b
work in progress first third of interval.cpp converted
eddelbuettel Mar 19, 2020
0aa3def
refactored rest of src/interval.cpp and corresponding R callers
eddelbuettel Mar 20, 2020
b3e1e27
refactored src/ and corresponding R callers
eddelbuettel Mar 21, 2020
d50ebb0
add #nocov tags in currently unused alternate nanoival_sort_impl2
eddelbuettel Mar 21, 2020
f084935
parse format ending with 'Z' as 'UTC' for data.table 'fread' and 'fwr…
lsilvest Mar 22, 2020
a7f20de
fix vectorized 'plus'/'minus' ops for 'nanoperiod'
lsilvest Mar 22, 2020
4158607
updated 'README.md'
lsilvest Mar 23, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ before_install:

install:
- ./run.sh install_aptget r-cran-rcppcctz r-cran-bit64 r-cran-zoo r-cran-data.table r-cran-xts r-cran-tinytest
# we currently need the development version of RcppCCTZ
- ./run.sh install_github eddelbuettel/rcppcctz

script:
- ./run.sh run_tests
Expand Down
41 changes: 41 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,44 @@
2020-03-15 Dirk Eddelbuettel <edd@debian.org>

* DESCRIPTION (Version, Date): Roll minor version

* src/Makevars (PKG_CXXFLAGS): Minor edits

2020-03-14 Leonardo Silvestri <lsilvestri@ztsdb.org>

[ The following reflects a fairly substantial set of changes made
over a longer period and are just summarized here ]
* DESCRIPTION: Add versioned Depends on RcppCCTZ
* NAMESPACE: Load dynamic library
* R/duration.R: Add new nanoival, duration, and period
* R/nanoival.R: Idem
* R/nanotime.R: Idem
* R/period.R: Idem
* inst/include/date.h: Idem
* inst/include/duration.hpp: Idem
* inst/include/globals.hpp: Idem
* inst/include/interval.hpp: Idem
* inst/include/period.hpp: Idem
* inst/include/pseudovector.hpp: Idem
* inst/include/utilities.hpp: Idem
* inst/tinytest/test_data.frame.R: Idem
* inst/tinytest/test_duration.R: Idem
* inst/tinytest/test_nanoival.R: Idem
* inst/tinytest/test_nanotime.R: Idem
* inst/tinytest/test_ops.R: Idem
* inst/tinytest/test_period.R: Idem
* man/duration.Rd: Idem
* man/nanoival.Rd: Idem
* man/nanotime.Rd: Idem
* man/period.Rd: Idem
* src/Makevars: Idem
* src/duration.cpp: Idem
* src/interval.cpp: Idem
* src/nanotime.cpp: Idem
* src/period.cpp: Idem

* .travis.yml: For now load development version of RcppCCTZ from GitHub

2019-11-21 Dirk Eddelbuettel <edd@debian.org>

* DESCRIPTION (Version, Date): New minor version
Expand Down
14 changes: 10 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
Package: nanotime
Type: Package
Title: Nanosecond-Resolution Time for R
Version: 0.2.4.2
Date: 2019-11-21
Version: 0.2.4.3.2
Date: 2020-03-15
Author: Dirk Eddelbuettel and Leonardo Silvestri
Maintainer: Dirk Eddelbuettel <edd@debian.org>
Description: Full 64-bit resolution date and time support with resolution up
to nanosecond granularity is provided, with easy transition to and from the
standard 'POSIXct' type.
Imports: methods, bit64, RcppCCTZ (>= 0.2.3), zoo
Imports: methods, bit64, RcppCCTZ (>= 0.2.6.3), zoo
Suggests: tinytest, data.table, xts
LinkingTo: Rcpp, RcppCCTZ
License: GPL (>= 2)
RoxygenNote: 7.0.0
RoxygenNote: 7.0.2
Collate:
eddelbuettel marked this conversation as resolved.
Show resolved Hide resolved
'nanotime.R'
'nanoival.R'
'nanoduration.R'
'nanoperiod.R'
76 changes: 73 additions & 3 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
useDynLib(nanotime)
import("methods")
import("bit64")
importFrom("RcppCCTZ", "parseDouble", "formatDouble")
importFrom("zoo", "index2char")
importFrom("utils", "head")
importFrom("utils", "head", "tail")

S3method(as.Date,nanotime)
S3method(as.POSIXct,nanotime)
Expand All @@ -13,8 +14,11 @@ S3method(format,nanotime)
S3method(index2char,nanotime)
S3method(c,nanotime)

export(as.integer64)
export(nanotime, as.integer64)
export(NA_nanotime_)
export(NA_nanoduration_)
export(NA_nanoival_)
export(NA_nanoperiod_)
export(as.nanotime)
export(nanotime.matrix)
exportClasses(nanotime)
exportMethods("+")
Expand All @@ -32,8 +36,74 @@ exportMethods(Summary)
exportMethods(max)
exportMethods(min)
exportMethods(nanotime)
exportMethods(as.nanotime)
exportMethods(print)
exportMethods(range)
exportMethods(show)
exportMethods("names<-")
exportMethods(is.na)
exportMethods(as.nanoduration)
exportMethods(show)
exportMethods(print)
exportMethods(plus)
exportMethods(minus)


exportMethods(intersect.idx)
exportMethods(intersect)
exportMethods(union)
exportMethods(setdiff.idx)
exportMethods(setdiff)
exportMethods(as.nanoival)
exportClasses(nanoival)
export(nanoival)
exportMethods(nanoival.start)
exportMethods(nanoival.end)
exportMethods(nanoival.sopen)
exportMethods(nanoival.eopen)
exportMethods(print)
exportMethods(show)
exportMethods(names)
exportMethods("names<-")
exportMethods("<")
exportMethods("<=")
exportMethods(">")
exportMethods(">=")
exportMethods("[")
exportMethods("[<-")
exportMethods("is.na")
exportMethods("is.na<-")
S3method(c, nanoival)
exportMethods(t)
exportMethods(is.unsorted)
exportMethods(sort)
S3method(seq, nanotime)
exportMethods(seq)
exportMethods(all.equal)
S3method(all.equal, nanotime)

exportClasses(nanoperiod)
export(nanoperiod)
exportMethods(as.nanoperiod)
exportMethods(nanoperiod.month)
exportMethods(nanoperiod.day)
exportMethods(nanoperiod.nanoduration)
S3method(c, nanoperiod)

exportClasses(nanoduration)
export(nanoduration)
S3method(as.integer64,nanoduration)
exportMethods(as.nanoduration)
S3method(c, nanoduration)
S3method(as.data.frame,nanoduration)

S3method(seq, nanoduration)

S3method(format,nanoival)
S3method(format,nanoduration)
S3method(format,nanoperiod)

exportMethods(nano_wday)
exportMethods(nano_mday)
exportMethods(nano_month)
exportMethods(nano_year)
Loading