Skip to content

Commit

Permalink
fix LPJmL_new warnings of negative numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
k4rst3ns committed Jun 28, 2024
1 parent 3b794de commit 888e780
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '2246666'
ValidationKey: '2268828'
AutocreateReadme: yes
AcceptedWarnings:
- 'Warning: package ''.*'' was built under R version'
Expand Down
5 changes: 2 additions & 3 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ cff-version: 1.2.0
message: If you use this software, please cite it using the metadata from this file.
type: software
title: 'mrlandcore: One-line description of this awesome package'
version: 1.1.3
date-released: '2024-06-08'
version: 1.1.4
date-released: '2024-06-28'
abstract: One-paragraph description of this awesome package.
authors:
- family-names: Beier
Expand Down Expand Up @@ -36,6 +36,5 @@ authors:
- family-names: Kreidenweis
given-names: Ulrich
license: LGPL-3.0
keywords: ~
repository-code: https://github.com/pik-piam/mrlandcore

8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Type: Package
Package: mrlandcore
Title: One-line description of this awesome package
Version: 1.1.3
Date: 2024-06-08
Authors@R:c(
Version: 1.1.4
Date: 2024-06-28
Authors@R: c(
person("Felicitas", "Beier", , "beier@pik-potsdam.de", role = c("aut", "cre")),
person("Kristine", "Karstens", role = "aut"),
person("Marcos", "Alves", role = "aut"),
Expand Down Expand Up @@ -45,4 +45,4 @@ Imports:
Suggests:
testthat
Encoding: UTF-8
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
6 changes: 3 additions & 3 deletions R/calcLPJmL_new.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ calcLPJmL_new <- function(version = "LPJmL4_for_MAgPIE_44ac93de", # nolint

if (!grepl("historical", cfg$climatetype)) {

x <- mbind(readSource("LPJmL_new", subtype = readinHist, convert = FALSE),
readSource("LPJmL_new", subtype = readinName, convert = FALSE))
x <- mbind(readSource("LPJmL_new", subtype = readinHist, convert = "onlycorrect"),
readSource("LPJmL_new", subtype = readinName, convert = "onlycorrect"))
years <- getYears(x, as.integer = TRUE)
x <- x[, years[years >= 1951], ]

} else {

x <- readSource("LPJmL_new", subtype = readinName, convert = FALSE)
x <- readSource("LPJmL_new", subtype = readinName, convert = "onlycorrect")
years <- getYears(x, as.integer = TRUE)
if (!grepl("1901", stage)) x <- x[, years[years >= 1930], ]

Expand Down
2 changes: 1 addition & 1 deletion R/correctLPJmL_new.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

correctLPJmL_new <- function(x) { # nolint: object_name_linter.

x <- toolConditionalReplace(x, conditions = c("is.na()", "<0"), replaceby = 0)
x <- toolConditionalReplace(x, conditions = "<0", replaceby = 0)

return(x)
}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# One-line description of this awesome package

R package **mrlandcore**, version **1.1.3**
R package **mrlandcore**, version **1.1.4**

[![CRAN status](https://www.r-pkg.org/badges/version/mrlandcore)](https://cran.r-project.org/package=mrlandcore) [![R build status](https://github.com/pik-piam/mrlandcore/workflows/check/badge.svg)](https://github.com/pik-piam/mrlandcore/actions) [![codecov](https://codecov.io/gh/pik-piam/mrlandcore/branch/master/graph/badge.svg)](https://app.codecov.io/gh/pik-piam/mrlandcore) [![r-universe](https://pik-piam.r-universe.dev/badges/mrlandcore)](https://pik-piam.r-universe.dev/builds)

Expand Down Expand Up @@ -38,7 +38,7 @@ In case of questions / problems please contact Felicitas Beier <beier@pik-potsda

To cite package **mrlandcore** in publications use:

Beier F, Karstens K, Alves M, Philipp Dietrich J, Leon Bodirsky B, Hoetten D, Humpenoeder F, Heinke J, v. Jeetze P, Mishra A, Beier F, Wirth S, Chen D, Kreidenweis U (2024). _mrlandcore: One-line description of this awesome package_. R package version 1.1.3, <https://github.com/pik-piam/mrlandcore>.
Beier F, Karstens K, Alves M, Philipp Dietrich J, Leon Bodirsky B, Hoetten D, Humpenoeder F, Heinke J, v. Jeetze P, Mishra A, Beier F, Wirth S, Chen D, Kreidenweis U (2024). _mrlandcore: One-line description of this awesome package_. R package version 1.1.4, <https://github.com/pik-piam/mrlandcore>.

A BibTeX entry for LaTeX users is

Expand All @@ -47,7 +47,7 @@ A BibTeX entry for LaTeX users is
title = {mrlandcore: One-line description of this awesome package},
author = {Felicitas Beier and Kristine Karstens and Marcos Alves and Jan {Philipp Dietrich} and Benjamin {Leon Bodirsky} and David Hoetten and Florian Humpenoeder and Jens Heinke and Patrick {v. Jeetze} and Abhijeet Mishra and Felcitas Beier and Stephen Wirth and David Chen and Ulrich Kreidenweis},
year = {2024},
note = {R package version 1.1.3},
note = {R package version 1.1.4},
url = {https://github.com/pik-piam/mrlandcore},
}
```

0 comments on commit 888e780

Please sign in to comment.