Releases: PredictiveEcology/reproducible
Releases · PredictiveEcology/reproducible
v2.1.0
reproducible 2.1.0
New
- new family of functions that are called inside
postProcessTo
that usesf::gdal_utils
directly. These are still experimental and will only be activated withoptions("reproducible.gdalwarp" = TRUE)
- default for
gdalMask
has changed default for "touches". Now has equivalent forterra::mask(..., touches = TRUE)
, using"-wo CUTLINE_ALL_TOUCHED=TRUE"
gdalProject
now uses 2 threads, setting"-wo NUM_THREADS=2"
; can be changed by user withoptions("reproducible.gdalwarpThreads" = X)
; see?reproducibleOptions
gdal*
functions now addressdatatype
issuesgdal*
defaults toFLT8S
ifdatatype
not passedmakeRelative
,makeAbsolute
and similar have been created to ease many issues encountered inpreProcess
Changes
showSimilar
(e.g.,options(reproducible.showSimilar = 1)
) now preferentially shows the most recent item in cache if there are several with equivalent matching.- overhaul of messaging in
Cache
andprepInputs
families; functions are highlighted with a different colour; indent level reflects nesting of bothCache
andprepInputs
, so it is easier to identify which message goes with which function call. preProcess
is a lot faster now for large numbers of files; usesCHECKSUMS
more effectively and fewer timesretry
now captures itsexpr
so it doesn't need aquote
; is liketry
now.showSimilar
mechanisms now returns the most recent, if there are >1 similar that are equivalently similar- if a user is having troubles with
googledrive
for e.g., large files on spotting connections, instructions for usinggdown
are provided showCache
,clearCache
now have extra argumentsfun
,cacheId
, and...
now can take any arbitrarytag = value
pair. ThecacheId
argument will be very fast if a user is not usinguseDBI()
isFALSE
..wrap
and.unwrap
can now deal withSpatVectorCollection
(aterra
class that does not have awrap
/unwrap
method interra
)- ALTREP digesting when using
spooky
orfastdigest
were not stable forintegers
andfactors
. There is now a work around in.robustDigest
that stabilizes these by expanding them from their ALTREP representation first. Since they will be saved and recovered anyway, this will have little effect. .wrap
and.unwrap
are becoming more mature and can handle many more classes effectively. Methods can still be written, if needed.
Testing
- lots of testing with
cacheSaveFormat = "qs"
, which previously was not reliable especially for environments. With all recent changes to.wrap
and.unwrap
, these appear stable now and should be able to be used forenvironments
.
Bugfixes
switchDataType
can now correctly switch betweengdal
formats andterra
- many messaging fixes that were imprecise or missing
v2.0.12
v2.0.9
reproducible 2.0.9
Enhancements
- new function
isUpdated()
to determine whether a cached object has been updated; makeRelative()
is now exported for use downstream (e.g.,SpaDES.core
);- new functions
getRelative()
andnormPathRel()
for improved symlink handling (#362); - messaging is improved for
Cache
with the function named instead of justcacheId
- messaging for
prepInputs
: minor changes - more edge cases for
Checksums
dealt with, so fewer unneeded downloads wrapSpatRaster
(wrap
for file-backedspatRaster
objects) fixes for more edge casespostProcessTo
can now usesf::gdal_utils
for the case offrom
is a gridded object andto
is a polygon vector. This appears to be between 2x and 10x faster in tests.postProcessTo
does a pre-crop (with buffer) to make theprojectTo
faster. When bothfrom
andto
are vector objects, this pre-crop appears to create slivers in some cases. This step is now skipped for these cases.Cache
can now deal with unnamed functions, e.g.,Cache((function(x) x)(1))
. It will be refered to as "headless".terra
would fail if internet was unavailable, even when internet is not necessary, due to needing to retrieve projection information. Many cases where this happens will now divert to usesf
.Cache
can now skip calculatingobjSize
, which can take a non-trivial amount of time for large, complicated objects; seereproducibleOptions()
Bug fixes
- Filenames for some classes returned ""; now returns NULL so character vectors are only pointers to files
- Cache on a terra object that writes file to disk, when
quick
argument is specified was failing, always creating the same object; fixed with #PR368 useDBI
was incorrectly used if a user had set the option prior to package loading. Now works as expected.- several other minor
preProcess
deals better with more cases of nested paths in archives.- more edge cases corrected for
inputPaths
v2.0.8
v2.0.7
reproducible 2.0.7
Enhancements
- Address change in
round
withR > 4.3.1
; now a primitive, that does method dispatch. Failure was identified with unit tests, by Luke Tierney who was making the change inbase::round
.
Bug fixes
v2.0.5
reproducible 2.0.5
Enhancements
- Updates of
Copy
& new.wrap
,.unwrap
generics and methods to wrap classes that don't save well to disk as is. This uses the name similar toterra::wrap
, but with slight differences internally to allow forSpatRaster
objects who are file-backed and must have their files moved when they are unwrapped. loadFiles
updated for more cases- convert to using
withr
throughout testing for cleaning up - more methods for
Filename
added, including forPath
class Cache(..., useCloud = TRUE)
had many cases that were not working; known cases are now working. Also, now file from file-backed cases are now placed inside thecacheOutputs
folder rather than inside a separate folder (used to be "rasters")
Bugfixes
- several small for edge cases
Dependency changes
- none
v2.0.4
reproducible 2.0.4
Enhancements
reproducible.useFuture
now defaults to"multisession"
- updated tests to deal with
data.table
development branch (#314) - removed all use of
data.table::setattr
to deal with "modified compiler constants" issue that was detected during CRAN checks at https://github.com/kalibera/cran-checks/blob/master/rcnst/results/reproducible/00check.log
Bugfixes
preProcess
failed whengoogledrive
url filename could be found, butdestinationPath
was not"."
normPath
had different behaviour on *nix-alikes and Windows. Now it is the same.- Issue #316 --
SpatRaster
objects if saved to a specific, non relative (togetwd()
) path would not be recovered correctly. - Several other Issues that addressed edge cases for
prepInputs
and family.
Continuous integration
- Improvements with testing on GitHub Actions
v2.0.2
Known issues: https://github.com/PredictiveEcology/reproducible/issues
Version 2.0.2
Enhancements
- new optional backend for
Cache
viaoptions(reproducible.useDBI = FALSE)
is single data files with the samebasename
as the cached object, i.e., with the samecacheId
in the file name. This is a replacement forRSQLite
and will likely become the default in the next release. This approach makes cloud caching easier as all metadata are available in small binary files for each cached object. This is simpler, faster and creates far fewer package dependencies (now 11 recursive; before 27 recursive). If a user has DBI and RSQLite installed, then the backend will default to use these currently, i.e., the previous behaviour. The user can change the backend without loss of Cache data. - moved
raster
andsp
toSuggests
; no more internal functions use these. User can still work withRaster
andsp
class objects as before. preProcess
can now handle google docs files, iftype = ...
is passed.postProcess
now usesterra
andsf
internally (with #253) throughout the family ofpostProcess
functions. The previous*Input
and*Output
functions now redirect to the new*To*
functions. These are faster, more stable, and cover vastly more cases than the previous*Inputs
family. The old backends no longer work as before.- minor functions to assist with transition from
raster
toterra
:maxFn
,minFn
,rasterRead
.dealWithClass
and.dealWithClassOnRecovery
are now exported generics, with several methods here, notably, list, environment, default- other miscellaneous changes to deal with
raster
toterra
transition (e.g.studyAreaName
can deal withSpatVector
) prepInputs
now deals with archives that have sub-folder structure are now dealt with correctly in all examples and tests esp. #181.prepInputs
can now deal with.gdb
files. Though, it is limited tosf
out of the box, so e.g., Raster layers insidegdb
files are not supported (yet?). User can passfun = NA
to not try to load it, but at least have the.gdb
file locally on disk.hardLinkOrCopy
now useslinkOrCopy(symlink = FALSE)
; more cases dealt with especially nested directory structures that do not exist in theto
.- many GitHub issues closed after transition to using
terra
andsf
. preProcess
had multiple changes. The following now work: archives with subfolders, archives with subfolders with identical basenames (different dirnames), gdb files, other files wheretargetFile
is a directory.- ~40 issues were closed with current release.
- code coverage now approaching 85%
- substantial changes to
preProcess
for minor efficiency gains, edge cases, code cleaning - new function
CacheGeo
that weaves togetherprepInputs
andCache
to create a geo-spatial caching. See help and examples. maskTo
now allowstouches
arg forterra::mask
Spatial
class is also "fixed" infixErrorsIn
prepInputs
andpreProcess
now capturedlFun
, so user can pass unquoteddlFun
Copy
method forSpatRaster
, with and without file-backingCache(..., useCloud = TRUE)
reworked so appears to be more robust than previously.maskTo
now works even ifto
is larger thanfrom
netCDF
works withprepInputs
; thanks to user nbsmokee with PR #300.
Dependency changes
- no spatial packages are automatically installed any more; to work with
prepInputs
and family, the user will have to installterra
andsf
at a minimum. terra
,sf
are inSuggests
- removed entirely:
fasterize
,fpCompare
,magrittr
- moved to
Suggests
:raster
,sp
,rlang
- A normal (minimal) install of
reproducible
no longer installsDBI
, nor does it useRSQLite
. All cache repositories database files will be in binary individual files in thecacheOutputs
file. If a user hasDBI
and aSQLite
engine, then the previous behaviour will be used.
Defunct
reproducible.useNewDigestAlgorithm
is not longer an option as the old algorithms do not work reliably.
Defunct and removed
- removed
assessDataTypeGDAL()
,clearStubArtifacts()
, - removed non-exported
digestRasterLayer2()
;evalArgsOnly()
;.getSourceURL()
;.getTargetCRS()
;.checkSums()
,.groupedMessage()
;.checkForAuxililaryFiles()
option("reproducible.polygonShortcut")
removed
Non exported function changes
.basename
renamed tobasename2
Bugfixes
Cache
was incorrectly dealing withenvironment
andenvironment-like
objects. Since some objects, e.g.,Spat*
objects interra
, must be wrapped prior to saving, environments must be scanned for these classes of objects prior to saving. This previously only occurred forlist
objects;- When working with revdep
SpaDES.core
, there were some cases where theCache
was failing as it could not find the module name; - during transition from
postProcess
(usingraster
andsp
) topostProcessTo
, some cases are falling through the cracks; these have being addressed.
v1.2.16
Known issues: https://github.com/PredictiveEcology/reproducible/issues
Version 1.2.16
Dependency changes
- none
Enhancements
Cache
now captures the first argument passed to it without evaluating it, soCache(rnorm(1))
now works as expected.- As a result of previous,
Cache
now works with base pipe |> (with R >= 4.1). - Due to some internal changes in the way arguments are evaluated and digested, there may be some cache entries that will be rerun. However, in simple cases of
FUN
passed toCache
, there should be no problems with previous cache databases being successfully recovered. - Added more unit tests
- Reworked
Cache
internals so that digesting is more accurate, as the correct methods for functions are more accurately found, objects within functions are more precisely evaluated. - Improved documentation:
- Examples were reworked, replaced, improved;
- All user-facing exported functions and methods now have complete documentation;
- Added
()
in DESCRIPTION for functions; - Added
\value
in.Rd
files for exported methods (structure, the class, the output meaning); - Remove commented code in examples.
Bug fixes
postProcess
now also checks resolution when assessing whether to projectprepInputs
has an internalCache
call for loading the object into memory; this was incorrectly evaluating all files if there were more than one file downloaded and extracted. This resulted in cases, e.g. shapefiles, being considered identical if they had the identical geometries, even if their data were different. This is fixed now as it uses the digest of all files extracted.
Deprecated and defunct
- remove defunct argument
digestPathContent
fromCache
options("reproducible.useGDAL")
is now deprecated; the package is moving towardsterra
.