Releases: R-CF/CFtime
Releases · R-CF/CFtime
CFtime 1.7.2
Maintenance release
- Time units can use SI decimal multiples or sub-multiples, such as "µs" or "kiloyear".
- Setting bad boundary values generates a warning instead of an error.
CFCalendarand subclasses use active fields for all properties.- CRAN landing page links to github.io documentation.
CFtime 1.7.1
Maintenance release
- Added
lengthfield to classCFTime. - Added
format.CFTime()S3 method. - Added
"[.CFTime"S3 method. - Documentation has been moved from vignettes to a website on github.io.
CFtime 1.7.0
- CFtime is now hosted on Github through the R-CF organization: all things related to the CF Metadata Conventions in R.
- New sequence-like method to create
CFTimeinstances. - New methods
CFTime$copy()andCFTime$subset()to create copies of the entireCFTimeinstance or a subset thereof, including boundary values if they are set. - Fixed error on year 0 timestamps.
CFtime 1.6.1
- Deprecated "gregorian" calendar automatically converted to the equivalent "standard".
CFCalendar$add_day()method added to add a day to adata.frameof date parts, using calendar logic.- API change: Bounds are now always fully specified so logical arguments should no longer be used, except in setting regular, consecutive bounds (
bounds <- TRUE). If bounds have not been set, aNULLvalue is returned. This is to ensure that factorizing to "approximate" time units (such as a month) will give correct results for the bounds. (Old API deprecated by November 2025, removed early 2026.)
CFtime 1.6.0
- New class
CFClimatologyto manage climatological statistics. Method
CFTime$factor()with aneraargument will now have aCFClimatology
instance attached to the attribute "CFTime" of its return value. - New class
CFCalendarNonefor a calendar with no annual cycle. Such a
calendar represents a single instant in time, which may be useful for
experiments on a fixed moment during the year. str()forCFTimeandCFClimatologygives compact information.- Fixed new
CFTimeinstance for factor with a "day" or "dekad" period where
the last factor level is not at the end of the year. CFTime$new()with a single character string offset will generate only the
single corresponding offset.- Test coverage near-complete.
- Fixed inconsistent documentation for functions.
- Minor code fixes.
CFtime 1.5.1
CFTime$slice()can now work with a single or multiple timestamp values.- Test coverage increased.
- Documentation updated, all runnable example code uses
ncdfCFpackage. - Minor code fixes.
CFtime 1.5.0
- Code is updated to align with the CF 1.12 release. Specifically, calendars
utcandtaiare added. standardcalendar now uses mixed Gregorian/Julian calendar as defined in the
CF Metadata Conventions.proleptic_gregorianis now a separate calendar with
its own code base.- Negative offsets from a calendar origin are allowed.
- Code is refactored to R6. R6 class CFTime replaces S4 class CFtime (note the
difference in case). S4 class CFdatum has been replaced by hierarchy of
R6 CFCalendar classes, with various non-exported functions converted into
methods of CFCalendar. The code is now much cleaner and easier to extend, such
as with the two new calendarsutcandtai. - ISO8601 timestamps can use a comma "," as decimal mark to separate a
fractional part from a time element, in addition to the dot ".". - Do not drop degenerate dimension on bounds when only 1 offset is included in
subsetting.
CFtime 1.4.1
- Method
slab()has an additional argumentrightmost.closedto indicate if
the upper extreme value should be included in the result. - Fixed bounds information on CFtime instances returned from methods
indexOf()
andslab(). - Several minor code improvements.
CFtime 1.4.0
- Bounds that define intervals around offsets can be associated with a CFtime
instance and retrieved as raw offset values or as formatted timestamps. - Methods that subset a CF time series (e.g.
CFfactor(),cut(),slab())
now have an attribute "CFtime" (among possible others) that describes the "time"
dimension of the analysis result applying the subset. In other words, if CFtime
instance 'Acf' describes the temporal dimension of data set 'A' and a factor 'Af'
is generated from 'Acf', thenBcf <- attr(Af, "CFtime")describes the temporal
dimension of the result of, say,B <- apply(A, 1:2, tapply, Af, FUN). - New
indexOf()method added that returns the indices of supplied timestamps
in a CFtime instance, optionally with a fractional part. This can be used to
extract specific time steps, or to interpolate between time steps using the
fractional part, from the time dimension of the data set associated with the
CFtime instance. A vector of indices (e.g. referring to slices of the data set)
can also be supplied, in which case valid indices are returned, with the new
CFtime instance. - New
cut()method added to generate a factor, similar tocut.POSIXt()but with
some differences in the arguments. CFfactor()now supports a period "quarter", for calendar quarters.format()method added that generates a character vector of timestamps for the
offsets in a CFtime instance. The format is specified using the flags used in
strptime(), with some limitations. In particular, locale-specific formatting is
limited to month names and no weekday information can be generated. Therange()
method has a new "format" parameter to support the same functionality and timestamps
can also be generated for the extremes of the bounds, if set.as.character()andlength()methods added that return a vector of timestamps
or the number of offsets in a CFtime instance, respectively.- Several functions have been renamed (most notably
CFtimestamp()to
as.timestamp(),CFcomplete()tois_complete(),CFrange()to the standard
generic methodrange(), andCFsubset()toslab()) to be more consistent
with the R universe. The original functions are now flagged as being deprecated.
Some datum functions (deep down where regular mortals do not dwell) have been
deleted. - Time zone designator "UTC" accepted when parsing timestamps to offsets.
- Minor code fixes, see GitHub commits.
- Documentation updated, with description of new functions.
CFtime 1.3.0
Changes since release 1.2.0:
- Two CFtime instances can be added if they have compatible calendars and units.
The earlier origin is preserved in the result and offsets from the later instance
are incremented by the appropriate amount. As before, in the result offsets are
in the order of the specified CFtime instances. - A new function CFsubset() can be used to retrieve a logical vector that indicates
which time steps in a CFtime instance fall between two timestamps. This is useful
to slice data during reading from file or analysis. - Time zone information is managed at the level of the datum. If a vector of character
timestamps is parsed and found to have different time zones, a warning is generated. - Much reduced memory footprint.
- Minor code fixes, see GitHub commits.
- Codecov.io test coverage monitoring added.
- Documentation updated, with description of new functions.