Skip to content

Feature/phi imf efficiency - #778

Closed
daymontas1 wants to merge 21 commits into
pik-piam:masterfrom
daymontas1:feature/phi-imf-efficiency
Closed

daymontas1 wants to merge 21 commits into
pik-piam:masterfrom
daymontas1:feature/phi-imf-efficiency

Conversation

@daymontas1

Copy link
Copy Markdown
Contributor

This PR introduces the input data for the new realization investment inefficiencies in the macro module (Available here: remindmodel/remind#2278).

Comment thread R/calcCostOfCapital.R Outdated
Comment thread R/calcCostOfCapital.R
Comment thread R/readIMF_PHI.R Outdated
Comment thread R/readETH_WACC.R Outdated
@fbenke-pik

Copy link
Copy Markdown
Contributor

First steps:

  • move latest master branch into you branch and resolve conflicts
  • run lucode2::buildLibrary() to increment library version (choose option 3). If this does not work right away, fix all the problems shown.

Comment thread R/readIMF_PHI.R Outdated
Comment thread R/readIMF_PHI.R Outdated
Comment thread R/readETH_WACC.R Outdated

@LaviniaBaumstark LaviniaBaumstark left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

if this PR is o.k., it can be merged independently of the REMIND-PR. Additional inptu data files can behandled (are ignored) by our input data workflow

@fbenke-pik

Copy link
Copy Markdown
Contributor

This PR still contains files that should not be added, namely .RDataTmp1 - .RDataTmp4 and two pdfs. Please remove these first. Also, run lucode2::buildLibrary() to increase the version number.

Comment thread R/calcPHI.R Outdated

# ------------------------------------------------------------
# Manual overrides for specific regions
# ------------------------------------------------------------

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What does this comment mean? Looks to me like a leftover of AI generated code. Please remove.

Comment thread R/imports.R
Comment thread R/calcCostOfCapital.R Outdated
Comment thread R/calcPHI.R
calcPHI <- function() {

output <- readSource("IMF_PHI")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

add this line
getNames(output) <- NULL

this avoids the useless column value in the output file
CAZ,value,0.8233030245275

Comment thread R/calcPHI.R Outdated
Comment thread R/readIMF_PHI.R
# ------------------------------------------------------------
# Clean numeric columns
# ------------------------------------------------------------
raw_clean <- raw %>%

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is not necessary in your data, read in data is already in numeric format.

Comment thread R/readETH_WACC.R Outdated
@fbenke-pik

Copy link
Copy Markdown
Contributor

The unwanted files still exist in the repository. Unfortunately, just deleting them and adding a new commit won't be enough, as the files are extremely large and will clutter the git history, even if we delete them with a commit.

So the solution should be:

  1. create a new feature branch from the current upstream master branch on your fork.
  2. copy over your newly written files and run buildLibrary again
  3. push to your new feature branch and open a new PR with your clean feature branch
  4. close this PR and and link the new one

Comment thread R/readIMF_PHI.R
return(as.magpie(phi_region))

}
return(as.magpie(phi_region))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this code is syntactically incorrect. looks like a merge error

Comment thread R/readETH_WACC.R
#' @author Diamantis Koutsandreas

#' @noRd
utils::globalVariables(c("value", "min_val", "reg", "tewacc"))

@fbenke-pik fbenke-pik Jun 15, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should not be used. if you get warnings for unknown variables, there are other ways to deal with them . in your case, there should be no problems with this list of variables as is.

@daymontas1

Copy link
Copy Markdown
Contributor Author

Closing in favor of #822 which is clean from unwanted files.

@daymontas1 daymontas1 closed this Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants