Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 12 additions & 1 deletion main.gms
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,18 @@ parameter
cm_permittradescen = 1; !! def = 1 !! regexp = [1-3]
*' * (1): full permit trade (no restrictions)
*' * (2): no permit trade (only domestic mitigation)
*' * (3): limited trade (certain percentage of GDP)
*' * (3): limited trade (certain percentage of permits)
*'
parameter
cm_permitTradeFinalYr "[TradingOnRef] Year until permit trading is allowed"
;
cm_permitTradeFinalYr = 2100; !! def = 2100
*'

parameter
cm_permitTradeRatio "[TradingOnRef] Share of emissions allowed for permit trading between 0 and 1"
;
cm_permitTradeRatio = 0.2; !! def = 0.2
*'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find the existing names of "permit trades scenarios" a little confusing, in the sense that we would always need to refer to the main.gms to understand what they mean. The big undertaking of reactivating permit trade is possibly a good opportunity to simplify that. Two suggestions (either/or):

  1. simpler one: rename the "no permit trade" to cm_permittradescen = 0
  2. nicer one: remove cm_permittradescen, because it is redundant with cm_pemittraderatio (0% for no trade, 100% for full trade, and whatever in-between for limited trade)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, I agree! The switch cm_permittradescen was already there and is used in other 41 realizations like PerCapitaConvergence and AbilityToPay. Changing this would require some refactoring there, and currently I don't fully understand the other realizations.

For not having to look into the main.gms I copied it also into the realization

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah understood thanks! Would this still make sense to ignore to ignore cm_permittradescen in your new realisation?

Also the new switch names will probably need to be changed in the other realisations too?

parameter
cm_rentdiscoil "[grades2poly] discount factor for the oil rent"
Expand Down
2 changes: 2 additions & 0 deletions modules/41_emicapregi/AbilityToPay/not_used.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ pm_gdp_gdx, parameter, ???
pm_budgetCO2eq, parameter, ???
vm_co2eqGlob,input,questionnaire
cm_emiscen,input,questionnaire
cm_permitTradeFinalYr, input, ???
cm_permitTradeRatio, input, ???
2 changes: 2 additions & 0 deletions modules/41_emicapregi/CandC/not_used.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ pm_budgetCO2eq, parameter, ???
pm_shPPPMER,input,questionnaire
pm_gdp,input,questionnaire
cm_permittradescen,input,questionnaire
cm_permitTradeFinalYr, input, ???
cm_permitTradeRatio, input, ???
2 changes: 2 additions & 0 deletions modules/41_emicapregi/GDPint/not_used.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ pm_budgetCO2eq, parameter, ???
pm_shPPPMER,input,questionnaire
pm_gdp,input,questionnaire
cm_permittradescen,input,questionnaire
cm_permitTradeFinalYr, input, ???
cm_permitTradeRatio, input, ???
2 changes: 2 additions & 0 deletions modules/41_emicapregi/POPint/not_used.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ vm_Mport,input,questionnaire
pm_shPPPMER,input,questionnaire
pm_gdp,input,questionnaire
cm_permittradescen,input,questionnaire
cm_permitTradeFinalYr, input, ???
cm_permitTradeRatio, input, ???
2 changes: 2 additions & 0 deletions modules/41_emicapregi/PerCapitaConvergence/not_used.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ vm_co2eqGlob,input,questionnaire
pm_shPPPMER,input,questionnaire
pm_gdp,input,questionnaire
cm_emiscen,input,questionnaire
cm_permitTradeFinalYr, input, ???
cm_permitTradeRatio, input, ???
25 changes: 25 additions & 0 deletions modules/41_emicapregi/TradingOnRef/bounds.gms
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
*** | (C) 2006-2024 Potsdam Institute for Climate Impact Research (PIK)
*** | authors, and contributors see CITATION.cff file. This file is part
*** | of REMIND and licensed under AGPL-3.0-or-later. Under Section 7 of
*** | AGPL-3.0, you are granted additional permissions described in the
*** | REMIND License Exception, version 1.0 (see LICENSE file).
*** | Contact: remind@pik-potsdam.de
*** SOF ./modules/41_emicapregi/TradingOnRef/bounds.gms
*** calculate emission cap in absolute terms
vm_perm.fx(t,regi) = p41_co2eq(t,regi);

display vm_perm.up;

*** deactivate permit trade
if(cm_permittradescen eq 2,
vm_Xport.fx(t,regi,"perm") = 0;
vm_Mport.fx(t,regi,"perm") = 0;
);
*** limited permit trade: limit in terms of share of allocated permits
if(cm_permittradescen eq 3,
vm_Xport.fx(t,regi,"perm") = 0;
vm_Xport.up(t,regi,"perm") $ (t.val > 2025 and t.val <= cm_permitTradeFinalYr) = cm_permitTradeRatio * abs(p41_co2eq(t,regi));
vm_Mport.fx(t,regi,"perm") = 0;
vm_Mport.up(t,regi,"perm") $ (t.val > 2025 and t.val <= cm_permitTradeFinalYr) = cm_permitTradeRatio * abs(p41_co2eq(t,regi));
);
*** EOF ./modules/41_emicapregi/TradingOnRef/bounds.gms
22 changes: 22 additions & 0 deletions modules/41_emicapregi/TradingOnRef/datainput.gms
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
*** | (C) 2006-2024 Potsdam Institute for Climate Impact Research (PIK)
*** | authors, and contributors see CITATION.cff file. This file is part
*** | of REMIND and licensed under AGPL-3.0-or-later. Under Section 7 of
*** | AGPL-3.0, you are granted additional permissions described in the
*** | REMIND License Exception, version 1.0 (see LICENSE file).
*** | Contact: remind@pik-potsdam.de
*** SOF ./modules/41_emicapregi/TradingOnRef/datainput.gms


*** read in data of cost-optimal reference climate policy run
*' load CO2 emissions from reference run to assing the allocates permits

Execute_Loadpoint "input_ref" p41_co2eq_in = vm_emiAll.l;
p41_co2eq(t, regi) = p41_co2eq_in(t,regi,"co2");

Comment on lines +14 to +15

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it used anywhere or come from the copy paste from AbilityToPay?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I first load the entire emission as intermediate step p41_co2eq_in = vm_emiAll.l and in a second step only use the CO2 emissions to allocate the permits: p41_co2eq(t, regi) = p41_co2eq_in(t,regi,"co2");


*** initialization of pm_shPermit
pm_emicapglob(t) = sum(regi, p41_co2eq(t,regi));
pm_shPerm(t,regi) = p41_co2eq(t,regi) / pm_emicapglob(t);


*** EOF ./modules/41_emicapregi/TradingOnRef/datainput.gms
20 changes: 20 additions & 0 deletions modules/41_emicapregi/TradingOnRef/declarations.gms
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
*** | (C) 2006-2024 Potsdam Institute for Climate Impact Research (PIK)
*** | authors, and contributors see CITATION.cff file. This file is part
*** | of REMIND and licensed under AGPL-3.0-or-later. Under Section 7 of
*** | AGPL-3.0, you are granted additional permissions described in the
*** | REMIND License Exception, version 1.0 (see LICENSE file).
*** | Contact: remind@pik-potsdam.de
*** SOF ./modules/41_emicapregi/TradingOnRef/declarations.gms

variables
vm_perm(ttot,all_regi) "emission allowances [GtCeq]"
;

parameter
pm_shPerm(tall, all_regi) "emission permit shares [share]"
pm_emicapglob(tall) "global emission cap [GtC]"
p41_co2eq_in(ttot,all_regi,all_enty) "emissions from cost-optimal reference run"
p41_co2eq(ttot,all_regi) "emissions from cost-optimal reference run"
;

*** EOF ./modules/41_emicapregi/TradingOnRef/declarations.gms
18 changes: 18 additions & 0 deletions modules/41_emicapregi/TradingOnRef/not_used.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# | (C) 2006-2024 Potsdam Institute for Climate Impact Research (PIK)
# | authors, and contributors see CITATION.cff file. This file is part
# | of REMIND and licensed under AGPL-3.0-or-later. Under Section 7 of
# | AGPL-3.0, you are granted additional permissions described in the
# | REMIND License Exception, version 1.0 (see LICENSE file).
# | Contact: remind@pik-potsdam.de
name, type, reason
sm_budgetCO2eqGlob, parameter, ???
pm_gdp_gdx, parameter, ???
pm_budgetCO2eq, parameter, ???
vm_co2eqGlob,input,questionnaire
cm_emiscen,input,questionnaire
p41_precorrection_reduction, parameter, ???
p41_correct_factor, parameter, ???
pm_shPPPMER,input,questionnaire
pm_pop, parameter, ???
pm_gdp,input,questionnaire
p41_co2eq_bau, parameter, ???
24 changes: 24 additions & 0 deletions modules/41_emicapregi/TradingOnRef/realization.gms
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
*** | (C) 2006-2024 Potsdam Institute for Climate Impact Research (PIK)
*** | authors, and contributors see CITATION.cff file. This file is part
*** | of REMIND and licensed under AGPL-3.0-or-later. Under Section 7 of
*** | AGPL-3.0, you are granted additional permissions described in the
*** | REMIND License Exception, version 1.0 (see LICENSE file).
*** | Contact: remind@pik-potsdam.de
*** SOF ./modules/41_emicapregi/TradingOnRef/realization.gms

*' @description: Emission caps/permits are allocated according to a reference run
*' There are three different trade patterns currently available.
*' cm_permittradescen = 1; !! def = 1 !! regexp = [1-3]
*' * (1): full permit trade (no restrictions)
*' * (2): no permit trade (only domestic mitigation)
*' * (3): limited trade (certain percentage of regional allowances)
*' for limited trade use cm_pemittradefinalyr to set the final year until permit trading is allowed
*' with cm_pemittraderatio set the percentage of allowed trade
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here the switch names that have been updated in main.gms could be updated as well (and everywhere else where they appear =))



*####################### R SECTION START (PHASES) ##############################
$Ifi "%phase%" == "declarations" $include "./modules/41_emicapregi/TradingOnRef/declarations.gms"
$Ifi "%phase%" == "datainput" $include "./modules/41_emicapregi/TradingOnRef/datainput.gms"
$Ifi "%phase%" == "bounds" $include "./modules/41_emicapregi/TradingOnRef/bounds.gms"
*######################## R SECTION END (PHASES) ###############################
*** EOF ./modules/41_emicapregi/TradingOnRef/realization.gms
2 changes: 2 additions & 0 deletions modules/41_emicapregi/exog/not_used.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ cm_emiscen, switch, ???
pm_shPPPMER,input,questionnair
pm_gdp,input,questionnaire
cm_permittradescen,input,questionnaire
cm_permitTradeFinalYr, input, ???
cm_permitTradeRatio, input, ???
1 change: 1 addition & 0 deletions modules/41_emicapregi/module.gms
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ $Ifi "%emicapregi%" == "CandC" $include "./modules/41_emicapregi/CandC/realizati
$Ifi "%emicapregi%" == "GDPint" $include "./modules/41_emicapregi/GDPint/realization.gms"
$Ifi "%emicapregi%" == "POPint" $include "./modules/41_emicapregi/POPint/realization.gms"
$Ifi "%emicapregi%" == "PerCapitaConvergence" $include "./modules/41_emicapregi/PerCapitaConvergence/realization.gms"
$Ifi "%emicapregi%" == "TradingOnRef" $include "./modules/41_emicapregi/TradingOnRef/realization.gms"
$Ifi "%emicapregi%" == "exog" $include "./modules/41_emicapregi/exog/realization.gms"
$Ifi "%emicapregi%" == "none" $include "./modules/41_emicapregi/none/realization.gms"
*###################### R SECTION END (MODULETYPES) ############################
Expand Down
2 changes: 2 additions & 0 deletions modules/41_emicapregi/none/not_used.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ cm_emiscen, switch, ???
pm_shPPPMER,input,questionnaire
pm_gdp,input,questionnaire
cm_permittradescen,input,questionnaire
cm_permitTradeFinalYr, input, ???
cm_permitTradeRatio, input, ???
6 changes: 3 additions & 3 deletions modules/80_optimization/nash/datainput.gms
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ cm_iteration_max = 100;
***convergences thresholds - very coarse
p80_surplusMaxTolerance(tradePe) = 2* 1.5 * sm_EJ_2_TWa; !! convert EJ/yr into internal unit TWa
p80_surplusMaxTolerance("good") = 2* 100/1000; !! in internal unit, trillion Dollar
p80_surplusMaxTolerance("perm") = 2* 300 * 12/44 / 1000; !! convert MtCO2eq into internal unit GtC
p80_surplusMaxTolerance("perm") = 3* 300 * 12/44 / 1000; !! convert MtCO2eq into internal unit GtC

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the actual relative residual permit surplus at convergence in the test runs? Could you share the p80_surplusMaxRel values? do the iterations converge below the tolerance, or does it tend to stay blocked close to it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So an edge case is e.g. if trade is only allowed for a short period in EC650-PC-Trade20-2060 here the surplus goes to 2060 perm 63 -0.24 this was not converging with 2* 300 * 12/44 / 1000= 0.16 now the tolerance is 0.245.

/p/tmp/rahelma/Committed/Equity/permTrading/output/EC650-PC-Trade20-2060_2026-02-06_15.10.31 (trading)$ dumpgdx fulldata.gdx p80_surplusMaxRel perm,63,
perm  63  2030  0.388459318122543
perm  63  2035  0.388459318122543
perm  63  2040  0.388459318122543
perm  63  2045  0.388459318122543
perm  63  2050  0.388459318122543
perm  63  2055  0.388459318122543
perm  63  2060  1.94757151310855
perm  63  2070  1.94757151310855
perm  63  2080  1.94757151310855
perm  63  2090  1.94757151310855
perm  63  2100  1.94757151310855
perm  63  2110  1.94757151310855
perm  63  2130  1.94757151310855
perm  63  2150  1.94757151310855

);
);

Expand All @@ -54,12 +54,12 @@ p80_etaXp("perm") = 0.2;

*LB* parameter for Nash price algorithm between different iterations
p80_etaLT(trade) = 0;
p80_etaLT("perm") = 0.03;
p80_etaLT("perm") = 0.04;

***These parameters are pretty sensitive. If market surpluses diverge, try higher values (up to 1). If surpluses oscillate, try lower values.
p80_etaST(tradePe) = 0.3;
p80_etaST("good") = 0.25;
p80_etaST("perm") = 0.3;
p80_etaST("perm") = 0.8;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I understand these p.._etaST/LT haven't been changed since the codebase was open-sourced in December 2019 with the explicit indication "These parameters are pretty sensitive" :)
The permit market also does not "benefit" from the adaptive convergence boosting mechanism (the 4x/8x/16x escalation after iterations 15/20/25) -- only applies to tradePe and good if I'm not wrong (see https://github.com/remindmodel/remind/blob/develop/modules/80_optimization/nash/postsolve.gms#L139C1-L173C19).

I wonder:

  • what motivate to such a big shift (from 0.3 to 0.8)?
  • why p80_etaST("pebiolc") = 0.8; was already fixed to 0.8 back then? @LaviniaBaumstark
  • have we try the "adaptative boosting"? wouldn't it be more consistent with the rest of the code? Are there good reasons to treat "perm" differently in that regard (e.g., much smaller fraction of the world exchanges wrt "good"? "pebiolc" does seem to have this boost as well)
  • don't we need to be even more strict on p80_etaSA for "perm" given the fact that the inter iteration adjustment cost parameter is much lower than for other goods (https://github.com/remindmodel/remind/blob/develop/modules/80_optimization/nash/datainput.gms#L45-L48) and therefore has more risk of oscillation? (not sure) Likewise, wouldn't it lead to better convergence (less oscillation while adjustment) to decrease the adjustment cost even further to not be so aggressive about p80_etaST ? In other words, instead of forcing the market with heavy-handed price corrections (high etaST), why not make the planners more responsive to prices (lower etaAdj) so the market clears more?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, I had the issue that the surplus was too high and the permit price did not change enough to motivate adjustments. I did not have the issue of oscillation in my runs.


$ifi %banking% == "banking" p80_etaST("perm") = 0.2; !! in banking mode, the permit market reacts more sensitively.
$ifi %emicapregi% == "budget" p80_etaST("perm") = 0.25; !! in budget mode, the permit market reacts more sensitively.
Expand Down
2 changes: 1 addition & 1 deletion modules/80_optimization/nash/equations.gms
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ q80_costAdjNash(ttot,regi)$( ttot.val ge cm_startyear ) ..
;

*' link between permit budget and emission budget
q80_budgetPermRestr(regi)$(cm_emiscen=6) ..
q80_budgetPermRestr(regi)$(cm_emiscen=6 OR cm_emiscen = 4) ..
sum(ttot$(ttot.val lt sm_endBudgetCO2eq and ttot.val ge cm_startyear), pm_ts(ttot)* vm_perm(ttot,regi))
+ sum(ttot$(ttot.val eq sm_endBudgetCO2eq),pm_ts(ttot)/2 * (vm_perm(ttot,regi))) =l=
pm_budgetCO2eq(regi) - sum(ttot $((ttot.val ge 2005) and (ttot.val lt cm_startyear)), pm_ts(ttot)* vm_co2eq(ttot,regi));
Expand Down
6 changes: 3 additions & 3 deletions modules/80_optimization/nash/preloop.gms
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ loop(regi,
if(p80_Mport0("2005",regi,tradePe) eq NA, p80_Mport0("2005",regi,tradePe) = 0);
););

*AJS* starting policy runs from permit prices that are all zero doesnot work. start from 30$ price path instead
*AJS* starting policy runs from permit prices that are all zero doesnot work. start from 49$ price path instead
if((cm_emiscen ne 1) and (cm_emiscen ne 9) and (smax(t,pm_pvp(t,"perm"))) eq 0,
loop(ttot$(ttot.val ge 2005),
***this is a 30$/tCo2eq in 2020 trajectory:
pm_pvp(ttot,"perm") = 0.11*1.05**(ttot.val-2020) * pm_pvp(ttot,"good");
***this is a 49$/tCo2eq in 2020 trajectory ([T$/GtC]. To get $/tCO2, multiply with 272: 0.18 T$/GtC = 48.96 $/tCO2):
pm_pvp(ttot,"perm") = 0.18*1.05**(ttot.val-2020) * pm_pvp(ttot,"good");
);
pm_pvp("2005","perm")=0;
);
Expand Down
99 changes: 7 additions & 92 deletions renv/activate.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ local({

# the requested version of renv
version <- "1.1.7"
attr(version, "md5") <- NULL
attr(version, "sha") <- NULL

# the project directory
Expand Down Expand Up @@ -169,16 +168,6 @@ local({
if (quiet)
return(invisible())

# also check for config environment variables that should suppress messages
# https://github.com/rstudio/renv/issues/2214
enabled <- Sys.getenv("RENV_CONFIG_STARTUP_QUIET", unset = NA)
if (!is.na(enabled) && tolower(enabled) %in% c("true", "1"))
return(invisible())

enabled <- Sys.getenv("RENV_CONFIG_SYNCHRONIZED_CHECK", unset = NA)
if (!is.na(enabled) && tolower(enabled) %in% c("false", "0"))
return(invisible())

msg <- sprintf(fmt, ...)
cat(msg, file = stdout(), sep = if (appendLF) "\n" else "")

Expand Down Expand Up @@ -226,16 +215,6 @@ local({
section <- header(sprintf("Bootstrapping renv %s", friendly))
catf(section)

# try to install renv from cache
md5 <- attr(version, "md5", exact = TRUE)
if (length(md5)) {
pkgpath <- renv_bootstrap_find(version)
if (length(pkgpath) && file.exists(pkgpath)) {
file.copy(pkgpath, library, recursive = TRUE)
return(invisible())
}
}

# attempt to download renv
catf("- Downloading renv ... ", appendLF = FALSE)
withCallingHandlers(
Expand All @@ -261,6 +240,7 @@ local({

# add empty line to break up bootstrapping from normal output
catf("")

return(invisible())
}

Expand All @@ -277,20 +257,12 @@ local({
repos <- Sys.getenv("RENV_CONFIG_REPOS_OVERRIDE", unset = NA)
if (!is.na(repos)) {

# split on ';' if present
parts <- strsplit(repos, ";", fixed = TRUE)[[1L]]

# split into named repositories if present
idx <- regexpr("=", parts, fixed = TRUE)
keys <- substring(parts, 1L, idx - 1L)
vals <- substring(parts, idx + 1L)
names(vals) <- keys
# check for RSPM; if set, use a fallback repository for renv
rspm <- Sys.getenv("RSPM", unset = NA)
if (identical(rspm, repos))
repos <- c(RSPM = rspm, CRAN = cran)

# if we have a single unnamed repository, call it CRAN
if (length(vals) == 1L && identical(keys, ""))
names(vals) <- "CRAN"

return(vals)
return(repos)

}

Expand Down Expand Up @@ -539,51 +511,6 @@ local({

}

renv_bootstrap_find <- function(version) {

path <- renv_bootstrap_find_cache(version)
if (length(path) && file.exists(path)) {
catf("- Using renv %s from global package cache", version)
return(path)
}

}

renv_bootstrap_find_cache <- function(version) {

md5 <- attr(version, "md5", exact = TRUE)
if (is.null(md5))
return()

# infer path to renv cache
cache <- Sys.getenv("RENV_PATHS_CACHE", unset = "")
if (!nzchar(cache)) {
root <- Sys.getenv("RENV_PATHS_ROOT", unset = NA)
if (!is.na(root))
cache <- file.path(root, "cache")
}

if (!nzchar(cache)) {
tools <- asNamespace("tools")
if (is.function(tools$R_user_dir)) {
root <- tools$R_user_dir("renv", "cache")
cache <- file.path(root, "cache")
}
}

# start completing path to cache
file.path(
cache,
renv_bootstrap_cache_version(),
renv_bootstrap_platform_prefix(),
"renv",
version,
md5,
"renv"
)

}

renv_bootstrap_download_tarball <- function(version) {

# if the user has provided the path to a tarball via
Expand Down Expand Up @@ -1052,7 +979,7 @@ local({

renv_bootstrap_validate_version_release <- function(version, description) {
expected <- description[["Version"]]
is.character(expected) && identical(c(expected), c(version))
is.character(expected) && identical(expected, version)
}

renv_bootstrap_hash_text <- function(text) {
Expand Down Expand Up @@ -1254,18 +1181,6 @@ local({

}

renv_bootstrap_cache_version <- function() {
# NOTE: users should normally not override the cache version;
# this is provided just to make testing easier
Sys.getenv("RENV_CACHE_VERSION", unset = "v5")
}

renv_bootstrap_cache_version_previous <- function() {
version <- renv_bootstrap_cache_version()
number <- as.integer(substring(version, 2L))
paste("v", number - 1L, sep = "")
}

renv_json_read <- function(file = NULL, text = NULL) {

jlerr <- NULL
Expand Down