Skip to content

Commit

Permalink
test github action fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pfuehrlich-pik committed Feb 1, 2022
2 parents 8f6d3bf + 262dcd0 commit 305737c
Show file tree
Hide file tree
Showing 531 changed files with 73,432 additions and 7,982 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ carbon_stored.*
^\.buildlibrary$
^\.github$
^codecov\.yml$
^\.pre-commit-config\.yaml$
^workflow$
3 changes: 2 additions & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
ValidationKey: '12547608'
ValidationKey: '3062864'
AcceptedWarnings:
- 'Warning: package ''.*'' was built under R version'
- 'Warning: namespace ''.*'' is not available and has been replaced'
AcceptedNotes:
- unable to verify current time
- Imports includes .* non-default packages.
- installed size is .*
AutocreateReadme: yes
allowLinterWarnings: yes
4 changes: 2 additions & 2 deletions .github/workflows/lucode2-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
env:
USE_BSPM: "true"
_R_CHECK_FORCE_SUGGESTS_: "false"
NO_BINARY_INSTALL_R_PACKAGES: 'c("madrat", "magclass", "citation", "gms", "goxygen")'
NO_BINARY_INSTALL_R_PACKAGES: 'c("madrat", "magclass", "citation", "gms", "goxygen", "raster")'

jobs:
lucode2-check:
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:

- name: Install dependencies
run: |
./run.sh install_aptget libhdf5-dev
./run.sh install_aptget libgdal-dev
./run.sh install_all
./run.sh install_r lucode2 covr
Expand Down
12 changes: 12 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: check-case-conflict
- id: check-json
- id: check-yaml
- id: check-merge-conflict
- id: fix-byte-order-marker
- id: end-of-file-fixer
ci:
autoupdate_schedule: quarterly
2 changes: 1 addition & 1 deletion .zenodo.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "mrcommons: MadRat commons Input Data Library",
"version": "0.66.4",
"version": "1.6.1",
"description": "<p>Provides useful functions and a common structure to all the input data required to run models like MAgPIE\n and REMIND of model input data.<\/p>",
"creators": [
{
Expand Down
14 changes: 6 additions & 8 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: mrcommons
Type: Package
Title: MadRat commons Input Data Library
Version: 0.66.4
Date: 2021-09-27
Version: 1.6.1
Date: 2022-02-01
Authors@R: c(person("Benjamin Leon", "Bodirsky", email = "[email protected]", role = "aut"),
person("Kristine", "Karstens", role = "aut"),
person("Lavinia", "Baumstark", role = "aut"),
Expand Down Expand Up @@ -36,17 +36,17 @@ Description: Provides useful functions and a common structure to all the input d
Depends:
R(>= 2.10.0),
magclass(>= 3.17),
madrat(>= 2.2.1),
madrat(>= 2.5.1),
mrdrivers (>= 0.2.1),
mstools
Imports:
bezier,
countrycode,
data.table,
dplyr,
hdf5r,
GDPuc,
glue,
lazyeval,
lifecycle,
lpjclass,
luscale,
magpiesets(>= 0.44.2),
Expand All @@ -61,10 +61,7 @@ Imports:
rlang,
SPEI,
stringr,
tibble,
tidyr,
tidyselect,
WDI,
zoo
Suggests:
covr,
Expand All @@ -83,3 +80,4 @@ LazyData: no
Encoding: UTF-8
RoxygenNote: 7.1.2
VignetteBuilder: knitr
Roxygen: list(markdown = TRUE)
29 changes: 10 additions & 19 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Generated by roxygen2: do not edit by hand

export(calc1stBioenergyPast)
export(calcAdjustGrassi2021)
export(calcBodyHeight)
export(calcConstructionWoodDemand)
export(calcDemography)
Expand All @@ -18,6 +19,7 @@ export(calcPhysicalInactivity)
export(calcPlantEstablishCalib)
export(calcTimberDemand)
export(convertMAgPIE)
export(readEurostat)
export(readFAO_FRA2015)
export(readFRA2020)
export(readFeedEfficiencyReg)
Expand All @@ -27,6 +29,7 @@ export(toolAggregateCell2Country)
export(toolCalcIEAfromStructureMappingPEFE)
export(toolCell2isoCell)
export(toolCoord2Isocell)
export(toolExtrapolateFodder)
export(toolFAOcombine)
export(toolFreezeEffect)
export(toolGetMappingCoord2Country)
Expand All @@ -39,36 +42,33 @@ export(toolSmooth)
import(countrycode)
import(madrat)
import(magclass)
import(mrdrivers)
import(mstools)
importFrom(GDPuc,convertGDP)
importFrom(SPEI,thornthwaite)
importFrom(countrycode,countrycode)
importFrom(data.table,as.data.table)
importFrom(data.table,fread)
importFrom(dplyr,"%>%")
importFrom(dplyr,across)
importFrom(dplyr,all_of)
importFrom(dplyr,arrange)
importFrom(dplyr,arrange_)
importFrom(dplyr,bind_rows)
importFrom(dplyr,count)
importFrom(dplyr,filter)
importFrom(dplyr,filter_)
importFrom(dplyr,full_join)
importFrom(dplyr,group_by)
importFrom(dplyr,inner_join)
importFrom(dplyr,intersect)
importFrom(dplyr,last)
importFrom(dplyr,left_join)
importFrom(dplyr,matches)
importFrom(dplyr,mutate)
importFrom(dplyr,mutate_)
importFrom(dplyr,n)
importFrom(dplyr,rename)
importFrom(dplyr,right_join)
importFrom(dplyr,select)
importFrom(dplyr,select_)
importFrom(dplyr,summarise)
importFrom(graphics,plot)
importFrom(hdf5r,h5file)
importFrom(lazyeval,interp)
importFrom(lpjclass,as.lpj)
importFrom(lpjclass,read.LPJ_input)
importFrom(lpjclass,readLPJ)
Expand All @@ -79,7 +79,6 @@ importFrom(luscale,speed_aggregate)
importFrom(luscale,superAggregate)
importFrom(luscale,weighted_mean.groupAggregate)
importFrom(madrat,calcOutput)
importFrom(madrat,getConfig)
importFrom(madrat,metadataGFZ)
importFrom(madrat,readSource)
importFrom(madrat,regionscode)
Expand All @@ -95,9 +94,7 @@ importFrom(madrat,toolSplitSubtype)
importFrom(madrat,toolSubtypeSelect)
importFrom(madrat,toolTimeAverage)
importFrom(madrat,toolTimeSpline)
importFrom(madrat,toolXlargest)
importFrom(madrat,vcat)
importFrom(magclass,"getCells<-")
importFrom(magclass,"getNames<-")
importFrom(magclass,"getRegionList<-")
importFrom(magclass,"getSets<-")
Expand All @@ -124,7 +121,7 @@ importFrom(magclass,hasCoords)
importFrom(magclass,magpie_expand)
importFrom(magclass,magpiesort)
importFrom(magclass,mbind)
importFrom(magclass,ncells)
importFrom(magclass,ndim)
importFrom(magclass,new.magpie)
importFrom(magclass,nregions)
importFrom(magclass,nyears)
Expand All @@ -151,7 +148,6 @@ importFrom(purrr,map)
importFrom(purrr,map2)
importFrom(purrr,pmap)
importFrom(purrr,walk)
importFrom(quitte,add_countrycode_)
importFrom(quitte,as.quitte)
importFrom(quitte,inline.data.frame)
importFrom(raster,"extent<-")
Expand All @@ -165,13 +161,12 @@ importFrom(raster,extent)
importFrom(raster,extract)
importFrom(raster,projectRaster)
importFrom(raster,raster)
importFrom(raster,rasterToPoints)
importFrom(raster,res)
importFrom(raster,resample)
importFrom(raster,stack)
importFrom(raster,subset)
importFrom(raster,writeRaster)
importFrom(readr,read_csv2)
importFrom(readxl,excel_sheets)
importFrom(readxl,read_excel)
importFrom(readxl,read_xlsx)
importFrom(reshape2,acast)
Expand All @@ -192,15 +187,12 @@ importFrom(stringr,str_sub)
importFrom(stringr,str_subset)
importFrom(stringr,str_trim)
importFrom(tidyr,expand_grid)
importFrom(tidyr,gather)
importFrom(tidyr,pivot_longer)
importFrom(tidyr,pivot_wider)
importFrom(tidyr,starts_with)
importFrom(tidyr,unite)
importFrom(tidyr,unnest)
importFrom(tidyselect,starts_with)
importFrom(tools,file_ext)
importFrom(tools,file_path_sans_ext)
importFrom(utils,bibentry)
importFrom(utils,data)
importFrom(utils,download.file)
importFrom(utils,head)
Expand All @@ -212,4 +204,3 @@ importFrom(utils,read.table)
importFrom(utils,tail)
importFrom(utils,unzip)
importFrom(utils,write.table)
importFrom(zoo,na.locf)
1 change: 0 additions & 1 deletion R/.Rbuildignore

This file was deleted.

7 changes: 0 additions & 7 deletions R/.buildlibrary

This file was deleted.

3 changes: 1 addition & 2 deletions R/calc1stBioDem.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@
#' @param subtype all per default. ethanol_oils for selecting 1st gen crop types relevant for REMIND input.
#' @author Xiaoxi Wang, David Klein
#' @seealso
#' \code{\link{calc1stBioenergyPast}}
#' [calc1stBioenergyPast()]
#' @examples
#'
#' \dontrun{
#' calcOutput("1stBioDem")
#' }
#' @importFrom magclass getNames<- as.magpie
#' @importFrom magpiesets findset

calc1stBioDem<- function(subtype="all"){
Expand Down
35 changes: 15 additions & 20 deletions R/calc1stBioenergyPast.R
Original file line number Diff line number Diff line change
@@ -1,33 +1,28 @@
#' @title calc1stBioenergyPast
#' @description
#' Calculates first generation biofuels production, imports, exports for biogas, bioethanol and biodiesel from IEA database.
#' The unit is Petajoule.
#' @description
#' Calculates first generation biofuels production, imports, exports for biogas, bioethanol and biodiesel
#' from IEA database. The unit is Petajoule.
#'
#' @return List of magpie objects with results on country level, weight on country level, unit and description.
#' @author Xiaoxi Wang, Isabelle Weindl
#' @seealso
#' \code{\link{setConfig}}
#' @examples
#'
#' \dontrun{
#' \dontrun{
#' calcOutput("1stBioenergyPast")
#' }
#' @importFrom magclass getNames<- as.magpie
#' @importFrom madrat toolGetMapping
#' @export

calc1stBioenergyPast <- function(){
calc1stBioenergyPast <- function() {
df <- toolCalcIEAfromStructureMappingPEFE(
readSource("IEA",subtype="EnergyBalances"),
readSource("IEA", subtype = "EnergyBalances"),
toolGetMapping(type = "sectoral", name = "structuremappingPE.csv", returnPathOnly = TRUE),
subtype="magpie")
#Unit conversion from ktoe to PJ
df <- df[,,c("biogas","ethanol","oils","woodfuel")]*0.041868
return(list(x=df,
weight=NULL,
unit="PJ",
description="1st generation bionegy demand")
subtype = "magpie")

# Unit conversion from ktoe to PJ
df <- df[, , c("biogas", "ethanol", "oils", "woodfuel")] * 0.041868

return(list(x = df,
weight = NULL,
unit = "PJ",
description = "1st generation bionegy demand")
)
}
4 changes: 2 additions & 2 deletions R/calcACCMIP.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#' @param glo_incl_oceans if true, a global value will be returned that also includes deposition on oceans and should be equivalent to total emissions.
#' @author Benjamin Leon Bodirsky
#' @seealso
#' \code{\link{calcAtmosphericDeposition}}
#' [calcAtmosphericDeposition()]
#' @examples
#'
#' \dontrun{
Expand Down Expand Up @@ -80,4 +80,4 @@ calcACCMIP<-function(glo_incl_oceans=FALSE){
min=0,
max=200,
description="Atmospheric deposition by cell"))
}
}
4 changes: 1 addition & 3 deletions R/calcAWMSconfShr.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@
#' @return List of magpie objects with results on country level, weight on country level, unit and description.
#' @author Benjamin Leon Bodirsky. Modifications by Edna J. Molina Bacca
#' @seealso
#' \code{\link{calcAWMSconfShrPast}}
#' [calcAWMSconfShrPast()]
#' @examples
#'
#' \dontrun{
#' calcOutput("AWMSconfShr")
#' }
#' @importFrom magpiesets findset
#' @importFrom magclass collapseNames add_columns add_dimension getNames<- setYears


calcAWMSconfShr<-function(rev=0.1){

Expand Down
9 changes: 2 additions & 7 deletions R/calcAWMSconfShrPast.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,14 @@
#'
#' @return List of magpie object with results on country level, weight on country level, unit and description.
#' @seealso
#' \code{\link{calcAWMSconfShr}},
#' \code{\link{calcExcretionIPCC}}
#' [calcAWMSconfShr()],
#' [calcExcretionIPCC()]
#' @author Benjamin Leon Bodirsky
#' @examples
#'
#' \dontrun{
#' calcOutput("AWMSconfShrPast")
#' }
#' @importFrom magclass collapseNames where
#' @importFrom madrat toolXlargest




calcAWMSconfShrPast<-function(products="magpie"){
excretion<-calcOutput("ExcretionIPCC",products=products,aggregate = FALSE)
Expand Down
Loading

0 comments on commit 305737c

Please sign in to comment.