Skip to content

Commit f15e78f

Browse files
committed
Commit for release 1.7.0
1 parent 1509a23 commit f15e78f

26 files changed

Lines changed: 271 additions & 127 deletions

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
^cran-comments\.md$
88
^CRAN-SUBMISSION$
99
^revdep$
10+
^LocalStuff$

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ TODO
77
inst/doc
88
.quarto
99
revdep/
10+
LocalStuff/

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Imports:
2121
Suggests:
2222
knitr,
2323
rmarkdown,
24-
ncdfCF,
24+
ncdfCF (<= 0.6.1),
2525
testthat (>= 3.0.0),
2626
stringr
2727
URL: https://github.com/R-CF/CFtime

NAMESPACE

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,10 @@ S3method(str,CFTime)
1010
export("bounds<-")
1111
export(CFClimatology)
1212
export(CFTime)
13-
export(CFcomplete)
1413
export(CFfactor)
1514
export(CFfactor_coverage)
1615
export(CFfactor_units)
17-
export(CFmonth_days)
18-
export(CFparse)
19-
export(CFsubset)
2016
export(CFtime)
21-
export(CFtimestamp)
2217
export(as_timestamp)
2318
export(bounds)
2419
export(calendar)

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# CFtime (development version)
22

33
* CFtime is now hosted on Github through the R-CF organization: all things related to the CF Metadata Conventions in R.
4+
* New sequence-like method to create `CFTime` instances.
5+
* New methods `CFTime$copy()` and `CFTime$subset()` to create copies of the entire `CFTime` instance or a subset thereof, including boundary values if they are set.
6+
* Fixed error on year 0 timestamps.
47

58
# CFtime 1.6.2
69

R/CFCalendar360.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ CFCalendar360 <- R6::R6Class("CFCalendar360",
2929
#' with `TRUE` for valid days and `FALSE` for invalid days, or `NA` where
3030
#' the row in argument `ymd` has `NA` values.
3131
valid_days = function(ymd) {
32-
ymd$year & ymd$month >= 1L & ymd$month <= 12L & ymd$day >= 1L & ymd$day <= 30L
32+
!is.na(ymd$year) & ymd$month >= 1L & ymd$month <= 12L & ymd$day >= 1L & ymd$day <= 30L
3333
},
3434

3535
#' @description Determine the number of days in the month of the calendar.

R/CFCalendar365.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ CFCalendar365 <- R6::R6Class("CFCalendar365",
3434
#' with `TRUE` for valid days and `FALSE` for invalid days, or `NA` where
3535
#' the row in argument `ymd` has `NA` values.
3636
valid_days = function(ymd) {
37-
ymd$year & ymd$month >= 1L & ymd$month <= 12L & ymd$day >= 1L &
37+
!is.na(ymd$year) & ymd$month >= 1L & ymd$month <= 12L & ymd$day >= 1L &
3838
ymd$day <= c(31L, 28L, 31L, 30L, 31L, 30L, 31L, 31L, 30L, 31L, 30L, 31L)[ymd$month]
3939
},
4040

R/CFCalendar366.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ CFCalendar366 <- R6::R6Class("CFCalendar366",
3434
#' with `TRUE` for valid days and `FALSE` for invalid days, or `NA` where
3535
#' the row in argument `ymd` has `NA` values.
3636
valid_days = function(ymd) {
37-
ymd$year & ymd$month >= 1L & ymd$month <= 12L & ymd$day >= 1L &
37+
!is.na(ymd$year) & ymd$month >= 1L & ymd$month <= 12L & ymd$day >= 1L &
3838
ymd$day <= c(31L, 29L, 31L, 30L, 31L, 30L, 31L, 31L, 30L, 31L, 30L, 31L)[ymd$month]
3939
},
4040

R/CFCalendarNone.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ CFCalendarNone <- R6::R6Class("CFCalendarNone",
3030
valid_days = function(ymd) {
3131
if (!nrow(self$origin)) TRUE
3232
else
33-
ymd$year &
3433
ymd$year == self$origin$year &
3534
ymd$month == self$origin$month &
3635
ymd$day == self$origin$day

R/CFCalendarProleptic.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ CFCalendarProleptic <- R6::R6Class("CFCalendarProleptic",
3939
#' with `TRUE` for valid days and `FALSE` for invalid days, or `NA` where
4040
#' the row in argument `ymd` has `NA` values.
4141
valid_days = function(ymd) {
42-
ymd$year & ymd$month >= 1L & ymd$month <= 12L & ymd$day >= 1L &
42+
!is.na(ymd$year) & ymd$month >= 1L & ymd$month <= 12L & ymd$day >= 1L &
4343
ifelse(self$leap_year(ymd$year),
4444
ymd$day <= c(31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)[ymd$month],
4545
ymd$day <= c(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)[ymd$month])

0 commit comments

Comments
 (0)