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

Cache rewrite #405

Open
wants to merge 217 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
217 commits
Select commit Hold shift + click to select a range
29ee23c
testing with chatGPT writing
Sep 19, 2024
50539c4
memoise & message
Sep 19, 2024
e8cbbc1
more
Sep 19, 2024
c8dd235
minor test fix
Sep 19, 2024
f1aa7f4
Merge branch 'development' into AI
Sep 19, 2024
bf72bfd
more2
Sep 19, 2024
22a6188
Bugfix - Cache if FUN has an arg `object` conflicts w `.prepareOutputs`
Sep 19, 2024
e4a4d48
more2
Sep 19, 2024
fa2edc2
Bugfix - Cache if FUN has an arg `object` conflicts w `.prepareOutputs`
Sep 19, 2024
43df61f
Merge branch 'prepareOutputObjectArg' into AI
Sep 19, 2024
37be785
minor
Sep 19, 2024
42b222a
attr(outputToSave, ".Cache")$newCache & .wrap
Sep 19, 2024
8394404
cleaning
Sep 20, 2024
bad28d5
.functionName, .cacheExtra
Sep 20, 2024
18a6c14
cleaner start
Sep 20, 2024
51f32ab
mods
Sep 25, 2024
7969229
working through more
Sep 25, 2024
dceb2a9
more
Sep 26, 2024
5e17f8b
test for dir.exists first
Sep 26, 2024
dca46f6
Merge branch 'prepareOutputObjectArg' into AI
Sep 26, 2024
9d720e0
more
Sep 26, 2024
ee36390
more
Sep 26, 2024
07370a0
cleaning up messaging
Sep 26, 2024
3f8ebf4
showCacheFast update
Sep 26, 2024
7452a71
Merge branch 'prepareOutputObjectArg' into AI
Sep 26, 2024
cb974dd
more
Sep 27, 2024
5ab99df
inherit nested userTags
Oct 1, 2024
2ccb06b
test-cache
Oct 1, 2024
85eb964
rm testGPT
Oct 1, 2024
1f7ead2
begin useCache
Oct 1, 2024
8bd8d4f
clean messages - overwrite
Oct 1, 2024
044a81f
clean metadataDT creation; clearCache for memoise bugfix
Oct 1, 2024
3ff4ef7
Merge branch 'prepareOutputObjectArg' into AI
Oct 1, 2024
2330089
messaging updates
Oct 3, 2024
6f0b53e
cacheExtra, omitArgs
Oct 3, 2024
4ff4f8b
cleaning
Oct 4, 2024
740d602
more
Oct 4, 2024
993adb1
nesting
Oct 4, 2024
a23e96e
showSimilar
Oct 7, 2024
04b47f4
test-cacheHelpers
Oct 7, 2024
d38812f
clean up -- a lot
Oct 8, 2024
aed2502
cleaning
Oct 8, 2024
5caa8d2
defunct args
Oct 9, 2024
98c3344
defunct args -- tweak
Oct 9, 2024
ee6e186
message
Oct 9, 2024
c2cc04d
useCloud & devMode
Oct 11, 2024
51f036a
useCloud
Oct 11, 2024
2bab3ec
useCloud; multipleCachePaths; test-missingFileExtensions
Oct 12, 2024
32074a5
reproducibleVerbose
Oct 12, 2024
8f37e00
rm browser
Oct 15, 2024
b80fe73
messaging
Oct 15, 2024
ce9b340
debugging
Oct 15, 2024
2056804
messaging
Oct 15, 2024
ee041b8
Merge branch 'AI2' into AI
Oct 15, 2024
403a000
minor
Oct 15, 2024
2c95ca2
on.exit
Oct 15, 2024
d45b435
clean up ... passing all tests ?
Oct 15, 2024
23bb240
quieter test-preProcessDoesntWork
Oct 15, 2024
d041a9b
finalizing
Oct 21, 2024
cb0b273
less verbose during tests
Oct 26, 2024
18298f0
test-cache
Oct 28, 2024
907ccec
add useDBI to cache2 --> and convert to Cache (Cache --> Cache2)
Oct 28, 2024
5cc53cb
bugfix for fun = sf::st_read
Oct 30, 2024
a1bdeab
Merge branch 'prepInputsFunAsColon' into AI
Oct 30, 2024
8de3072
cloud testing;
Oct 30, 2024
8db91eb
test tweaks
Oct 30, 2024
2e85a60
updated test for updated sf 1.0.18: changed error message
Oct 30, 2024
c597002
minor
Oct 30, 2024
1054706
updated test for updated sf 1.0.18: changed error message
Oct 30, 2024
f5d95dc
Merge branch 'prepInputsFunAsColon' into AI
Oct 30, 2024
8c47f5c
dbDisconnect 2x fix
Oct 30, 2024
6456bbc
quieter examples
Oct 30, 2024
89bd40f
cropTo when needBuffer = TRUE --> abandon if can't add buffer
Oct 30, 2024
d34a6c8
fix postProcess test in example
Oct 30, 2024
76ffde1
test-cloud uncomment
Oct 30, 2024
37126e7
cloudDownload call needed drv = drv, conn = conn
Oct 30, 2024
d1d7e68
postProcess example fix; part 2
Oct 30, 2024
9bdcc65
bugfix for prev
eliotmcintire Oct 30, 2024
e6a0c07
postProcess example fix; part 2
Oct 30, 2024
a8bf73d
prepInputs -- tell user to install archive if tooBig
Oct 30, 2024
052217f
bugfix "and adding to memoise"
Oct 30, 2024
4e40b0c
use withr::local_options in tests
Oct 30, 2024
e506103
use `require` instead of `library` in parallel tests
Oct 30, 2024
4dcff67
messageColored -- fix extra spacing
Oct 31, 2024
80b056a
test-prepInputs -- use capture.output once in each block
Oct 31, 2024
9c99530
download directories more
Nov 1, 2024
8717de5
use .callingEnv in prepInputs and family
Nov 1, 2024
2cf33d5
makeRelativePath fix
Nov 1, 2024
9d52309
prepInputs -- bugfix loading file that is in a sub-directory
Nov 1, 2024
71581ce
guessedFile bugfix
Nov 1, 2024
efe4b01
test tweaks
Nov 1, 2024
811713f
Merge remote-tracking branch 'origin/AI' into AI
Nov 1, 2024
4dd95c9
more test tweaks
Nov 1, 2024
a044542
Finalizing
Nov 1, 2024
46ac2dc
cacheId is same as calculated
Nov 3, 2024
4fbc412
expect_match2 -- in tests -- allows for \n in a grep
Nov 3, 2024
15cd3c1
with prev
Nov 3, 2024
fd45548
redoc; messageStripColor
Nov 4, 2024
bb83643
R CMD checking
Nov 4, 2024
6df4ea2
R CMD check
Nov 4, 2024
216646d
R CMD check for R 4.1.3
Nov 4, 2024
577797a
R CMD checking -- covr detected
Nov 4, 2024
9256810
Add call to check_and_get_cached_copy
Nov 4, 2024
f9201ca
reverse identical2(.returnNothing -- so it doesn't take method
Nov 4, 2024
0ccf57a
keep revert to Cache
Nov 4, 2024
7fa723b
aaaa
Nov 4, 2024
19ab15f
add .addChangedAttr
Nov 4, 2024
daa2250
showSimilar updates
Nov 4, 2024
6182625
naming args
Nov 4, 2024
cc87b85
evalTheFun needs all args specified b/c of ...
Nov 4, 2024
ef3c892
option -- set useDBI FALSE for now
Nov 4, 2024
57afc46
deal with case when objectSize is NA
Nov 5, 2024
558a1ef
missing verbose in dlGeneric
Nov 5, 2024
bcd725b
suppressWarningSpecific for package:stats Rstudio bug
Nov 6, 2024
62f6d3d
cloud bugfix
Nov 6, 2024
c8d1c01
downloadRemote -- with Directory -- update finding filenames
Nov 6, 2024
0e6c3eb
allow cloudFolderID to be full URL
Nov 6, 2024
8f29dcf
useCloud and cloudFolderID can be specified with options
Nov 6, 2024
60e768b
bugfixes for args in doSaveToCache
eliotmcintire Nov 6, 2024
8a46baa
minor within-function renaming
Nov 6, 2024
08c1f0a
Merge remote-tracking branch 'origin/AI' into AI
Nov 6, 2024
b8593be
unsilence drive_get
eliotmcintire Nov 6, 2024
7d2ebc3
Merge branch 'AI' of github.com:PredictiveEcology/reproducible into AI
eliotmcintire Nov 6, 2024
d025a50
merge
Nov 6, 2024
096e272
bugfix knownAtts -- ptr was missing
Nov 6, 2024
23f3088
rm aaaa
eliotmcintire Nov 6, 2024
941eaa3
Cache breaking change -- list needs a digest
Nov 6, 2024
e221c8f
Correct tags for lists
Nov 6, 2024
f73a20b
bugfix clearCache of filebacked SpatRasters
Nov 6, 2024
7f9bb68
bugfix when Cache(fun ... when fun = a:::b
Nov 7, 2024
f2e743b
showSimilar bugfix -- userTags may have :
Nov 7, 2024
e35d154
Cache -- drv default was wrong
Nov 7, 2024
b0f2918
showSimilar more updates
Nov 7, 2024
c2ab365
cloudWrite and cloudRead -- grep first letter
Nov 7, 2024
11835ec
dlRemote for google folder
Nov 9, 2024
893822c
minor
Nov 9, 2024
79375d7
process -- don't use terra/raster if-block if it is a `call`
Nov 9, 2024
82619dd
messaging; as.vector for multiple alsoExtract
Nov 9, 2024
2f054a2
add ._list for 'list' Method
eliotmcintire Nov 9, 2024
79297cc
showSimilar updates
eliotmcintire Nov 9, 2024
2567334
start adding httr2 and create 2x pass through httr2
Dec 3, 2024
30a92d7
Merge branch 'dlGenericWhttr2' into AI
Dec 3, 2024
c7ac383
tests for prepInputs with a directory
Dec 3, 2024
1a3cec2
Merge branch 'dlGenericWhttr2' into AI
Dec 4, 2024
ce76f25
Merge branch 'development' into AI
Dec 5, 2024
9b30874
merging
Dec 5, 2024
bf65d4a
Merge branch 'messageCli' into AI
Dec 5, 2024
d6578b2
Merge branch 'messageCli' into AI
Dec 5, 2024
6b2f5da
Merge branch 'messageCli' into AI
Dec 5, 2024
f46c33c
fix merge
Dec 5, 2024
e89cbe3
Merge branch 'messageCli' into AI
Dec 5, 2024
39a648f
More prepInputs on googledrive folders
Dec 6, 2024
3f1e72d
Merge branch 'development' into AI
Dec 6, 2024
98bae32
Merge branch 'isDirectory' into AI
Dec 7, 2024
b56faf8
.gitignore cache
Dec 7, 2024
d474491
Merge branch 'isDirectory' into AI
Dec 8, 2024
af61917
Merge branch 'isDirectory' into AI
Dec 8, 2024
a5cecea
Merge branch 'isDirectory' into AI
Dec 9, 2024
5e6497c
use with::defered_run
Dec 9, 2024
c4714be
Merge branch 'isDirectory' into AI
Dec 10, 2024
91864f4
several commits
eliotmcintire Dec 16, 2024
1817238
Merge branch 'AI' into AI2
Dec 16, 2024
acee1f3
Merge branch 'AI2' into AI
Dec 16, 2024
11b4291
move getMethodAll into recursiveEvalNamesOnly
Dec 17, 2024
1ae363a
begin to add userTags to metadata_define_postEval
eliotmcintire Dec 17, 2024
715f19d
Merge branch 'AI' of github.com:PredictiveEcology/reproducible into AI
eliotmcintire Dec 17, 2024
e2e0cc0
getMethodAll -- if the signature is a call; skip, show generic
Dec 17, 2024
f492333
Merge branch 'AI' of github.com:PredictiveEcology/reproducible into AI
eliotmcintire Dec 17, 2024
800b2c6
userTags fixes; corrupt file recovery; other
eliotmcintire Dec 18, 2024
a098b5e
bump version
Dec 18, 2024
d78a051
.callingEnv
Dec 20, 2024
acbbec1
Merge branch 'callingEnv' into AI
Dec 20, 2024
91890b3
minor bugfix; message rm single tick
eliotmcintire Dec 20, 2024
53cb033
Merge branch 'AI' of github.com:PredictiveEcology/reproducible into AI
eliotmcintire Dec 20, 2024
7d705b0
.functionName new way for edge case
eliotmcintire Dec 20, 2024
7e789df
add cacheId to suffix of file-backed objs
Jan 9, 2025
2b7b811
Merge branch 'development' into AI
Jan 9, 2025
2e35cf5
cacheId function for extracting
Jan 9, 2025
b0f5aed
better maintaining of unique file-backed files
Jan 9, 2025
97a7f96
need getDrv in one extra spot
Jan 9, 2025
d4ffe6c
better maintaining of unique file-backed files
Jan 9, 2025
7329d0f
more wrap and unwrap
Jan 9, 2025
1ad3337
dbDisconnectAll; deal with drv and conn fails
Jan 9, 2025
1748e34
test-cache updates
Jan 9, 2025
8d2e404
bump
Jan 9, 2025
112699f
Merge branch 'development' into AI
Jan 9, 2025
e06f1d5
test-cache updates
Jan 9, 2025
dd888f9
cacheId and prefixCacheId fixes
Jan 9, 2025
33636cb
add cacheId: tag to wrapSpatRaster
Jan 9, 2025
8730162
add cacheId to tagValue fixes
Jan 9, 2025
85913a4
less "invisible" with showCache (when empty)
Jan 9, 2025
8043360
mergeCache tweak to allow cacheId tag
Jan 9, 2025
fac3e84
Merge branch 'uniqueFileBackedFiles' into AI
Jan 9, 2025
0a63b95
Merge remote-tracking branch 'origin/AI' into AI
Jan 9, 2025
8e7aadf
bump
Jan 9, 2025
e3110f9
merge
eliotmcintire Jan 9, 2025
13a439b
remove merge characters
eliotmcintire Jan 9, 2025
dd0c6cb
update useCloud to deal with new cacheId in File-backing
Jan 10, 2025
8b0085c
CacheStoredFile returns the extra files now; adjust several places
Jan 10, 2025
922853f
fs > 10000 error; attempted fix
Jan 10, 2025
fb50d4c
minor bugfixes
eliotmcintire Jan 10, 2025
5bde23f
Merge branch 'AI' of github.com:PredictiveEcology/reproducible into AI
eliotmcintire Jan 10, 2025
b42bf33
bugfix clearCache for memoised objs
eliotmcintire Jan 10, 2025
05f337f
cloud fixes
Jan 10, 2025
65343b6
Merge remote-tracking branch 'origin/AI' into AI
Jan 10, 2025
0d57aca
CacheStoredFile -- bugfix
Jan 10, 2025
e254c18
when useMemoise is occuring; need copy files after
eliotmcintire Jan 11, 2025
14215e1
bump 2.1.2.9003
Jan 11, 2025
4278a77
test-cloud updates
Jan 11, 2025
019c19b
cache - rm ._list -- just digest the list with the names
Jan 14, 2025
54567b2
CacheDigest - just use `.robustDigest` for the list
Jan 14, 2025
8f41c0e
.objects updates
Jan 14, 2025
3e49968
updates to tests
Jan 14, 2025
5006a18
News and bump
Jan 14, 2025
9b2ba7a
news
Jan 14, 2025
b979381
downloading directories -- tests updates
Jan 14, 2025
cfeb5cc
objSize -- obj_size "bad binding access" fails
eliotmcintire Jan 15, 2025
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
1 change: 1 addition & 0 deletions CHECKSUMS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"file" "checksum" "filesize" "algorithm"
7 changes: 4 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ SystemRequirements: 'unrar' (Linux/macOS) or '7-Zip' (Windows) to work with '.ra
URL:
https://reproducible.predictiveecology.org,
https://github.com/PredictiveEcology/reproducible
Date: 2024-12-11
Version: 2.1.2
Date: 2025-01-13
Version: 2.1.2.9004
Authors@R:
c(person(given = "Eliot J B",
family = "McIntire",
Expand Down Expand Up @@ -97,6 +97,8 @@ Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2
Collate:
'DBI.R'
'messages.R'
'GPT2.R'
'cache-helpers.R'
'cache-internals.R'
'robustDigest.R'
Expand All @@ -107,7 +109,6 @@ Collate:
'convertPaths.R'
'copy.R'
'download.R'
'messages.R'
'exportedMethods.R'
'gis.R'
'helpers.R'
Expand Down
4 changes: 4 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export(.tagsByClass)
export(.unwrap)
export(.wrap)
export(Cache)
export(Cache2)
export(CacheDBFile)
export(CacheDBTableName)
export(CacheDigest)
Expand All @@ -61,6 +62,7 @@ export(Filenames)
export(asPath)
export(assessDataType)
export(basename2)
export(cacheId)
export(cc)
export(checkAndMakeCloudFolderID)
export(checkPath)
Expand Down Expand Up @@ -165,9 +167,11 @@ importFrom(data.table,rbindlist)
importFrom(data.table,set)
importFrom(data.table,setDF)
importFrom(data.table,setDT)
importFrom(data.table,setcolorder)
importFrom(data.table,setindex)
importFrom(data.table,setkeyv)
importFrom(data.table,setnames)
importFrom(data.table,setorderv)
importFrom(digest,digest)
importFrom(fpCompare,"%==%")
importFrom(fs,is_absolute_path)
Expand Down
25 changes: 25 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
# reproducible 3.0.0

* many edge cases were found that were not correctly Cached. This resulted in 2 major changes:
rewrite and simplification of `Cache`
and modified `digest` of the arguments. These changes are not backwards compatible. Details next.
* near complete rewrite of `Cache` so it is simpler and more robust.
The main function is now 130 lines, instead of almost 700.
* In addition to full rewrites, numerous simplifications throughout code that is still being used;
* Fixes to several ongoing "edge cases" that were difficult to address, mostly focused around deeply nested objects
that are file-backed with pointers, such `terra::SpatRaster` class;
* `digest` changes include the following fixes:
- lists would be digested without their top-level names; thus two lists with
exactly the same elements but with and without names would have the same digest
- file-backed objects were not correctly unique in the cache as they did not have
the `cacheId` in the filename; now they will have the
`cacheId` prefixed on the file (so they sort alongside the main cache file). This
`cacheId` prefix is removed on recovery from the cache, overwriting
any files with the same name.
- extracting the functionName from a function had several edge cases did not work; these now work
* `useMemoise` would work with file-backed objects, but only if the file-backed object
did not change after the caching (the pointer to the file was intact, but the file changed).
Now, memoising will copy file-backed information from disk
each time it "retrieves a file-backed object from memeory". This will result in slower
memoising than previously. However, it will be robust to downstream changes to the file.

# reproducible 2.1.2

* remove `PackedStatExtent` class, releasing it for `terra`; `reproducible`
Expand Down
Loading
Loading