Skip to content

Commit

Permalink
Merge branch 'fix_as_raster_LPJmLDataCalc' into 'master'
Browse files Browse the repository at this point in the history
implemented fix of as_raster

See merge request lpjml/lpjmlkit!93
  • Loading branch information
DavidhoPIK committed Mar 28, 2024
2 parents 8341481 + 4d4af3c commit e5dafe8
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '2773260'
ValidationKey: '2793210'
AutocreateReadme: yes
AcceptedWarnings:
- 'Warning: package ''.*'' was built under R version'
Expand Down
4 changes: 2 additions & 2 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: 'lpjmlkit: Toolkit for Basic LPJmL Handling'
version: 1.4.0
date-released: '2024-03-27'
version: 1.4.1
date-released: '2024-03-28'
abstract: A collection of basic functions to facilitate the work with the Dynamic
Global Vegetation Model (DGVM) Lund-Potsdam-Jena managed Land (LPJmL) hosted at
the Potsdam Institute for Climate Impact Research (PIK). It provides functions for
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: lpjmlkit
Type: Package
Title: Toolkit for Basic LPJmL Handling
Version: 1.4.0
Version: 1.4.1
Authors@R: c(
person("Jannes", "Breier", , "[email protected]", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-9055-6904")),
person("Sebastian","Ostberg", , "[email protected]", role = "aut", comment = c(ORCID = "0000-0002-2368-7015")),
Expand Down Expand Up @@ -54,4 +54,4 @@ Suggests:
sf
Config/testthat/edition: 3
VignetteBuilder: knitr
Date: 2024-03-27
Date: 2024-03-28
12 changes: 6 additions & 6 deletions R/LPJmLData_as.R
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ LPJmLData$set(
if (data_subset$meta$._space_format_ == "lon_lat") {

# default handling of LPJmLData objects else inherited like LPJmLGridData
if (class(data_subset)[1] == "LPJmLData") {
if (class(data_subset)[1] %in% c("LPJmLData", "LPJmLDataCalc")) {

data_subset$transform(to = "cell")

Expand Down Expand Up @@ -318,7 +318,7 @@ LPJmLData$set(
tmp_data <- data_subset$data
}
# default handling of LPJmLData objects else inherited like LPJmLGridData
if (class(data_subset)[1] == "LPJmLData") {
if (class(data_subset)[1] %in% c("LPJmLData", "LPJmLDataCalc")) {
tmp_raster[
raster::cellFromXY(
tmp_raster,
Expand Down Expand Up @@ -419,7 +419,7 @@ LPJmLData$set(
if (data_subset$meta$._space_format_ == "lon_lat") {

# default handling of LPJmLData objects else inherited like LPJmLGridData
if (class(data_subset)[1] == "LPJmLData") {
if (class(data_subset)[1] %in% c("LPJmLData", "LPJmLDataCalc")) {

data_subset$transform(to = "cell")

Expand Down Expand Up @@ -487,7 +487,7 @@ LPJmLData$set(
tmp_data <- data_subset$data
}
# default handling of LPJmLData objects else inherited like LPJmLGridData
if (class(data_subset)[1] == "LPJmLData") {
if (class(data_subset)[1] %in% c("LPJmLData", "LPJmLDataCalc")) {
tmp_rast[
terra::cellFromXY(
tmp_rast,
Expand Down Expand Up @@ -527,7 +527,7 @@ LPJmLData$set(
# Support lazy loading of grid for meta files. This throws an error if no
# suitable grid file is detected.
# default handling of LPJmLData objects else inherited like LPJmLGridData
if (class(self)[1] == "LPJmLData") {
if (class(self)[1] %in% c("LPJmLData", "LPJmLDataCalc")) {
self$add_grid()
}

Expand Down Expand Up @@ -566,7 +566,7 @@ create_tmp_raster <- function(data_subset, is_terra = FALSE) {
# Calculate grid extent from range to span raster
if (data_subset$meta$._space_format_ == "cell") {
# default handling of LPJmLData objects else inherited like LPJmLGridData
if (class(data_subset)[1] == "LPJmLData") {
if (class(data_subset)[1] %in% c("LPJmLData", "LPJmLDataCalc")) {
data_extent <- rbind(min = apply(data_subset$grid$data, "band", min),
max = apply(data_subset$grid$data, "band", max))
} else {
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Toolkit for Basic LPJmL Handling <a href=''><img src='inst/img/logo.png' align='right' height='139' /></a>

R package **lpjmlkit**, version **1.4.0**
R package **lpjmlkit**, version **1.4.1**

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

Expand Down Expand Up @@ -76,7 +76,7 @@ In case of questions / problems please contact Jannes Breier <jannesbr@pik-potsd

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

Breier J, Ostberg S, Wirth S, Minoli S, Stenzel F, Müller C (2024). _lpjmlkit: Toolkit for Basic LPJmL Handling_. doi: 10.5281/zenodo.7773134 (URL: https://doi.org/10.5281/zenodo.7773134), R package version 1.4.0, <URL: https://github.com/PIK-LPJmL/lpjmlkit>.
Breier J, Ostberg S, Wirth S, Minoli S, Stenzel F, Müller C (2024). _lpjmlkit: Toolkit for Basic LPJmL Handling_. doi: 10.5281/zenodo.7773134 (URL: https://doi.org/10.5281/zenodo.7773134), R package version 1.4.1, <URL: https://github.com/PIK-LPJmL/lpjmlkit>.

A BibTeX entry for LaTeX users is

Expand All @@ -85,7 +85,7 @@ A BibTeX entry for LaTeX users is
title = {lpjmlkit: Toolkit for Basic LPJmL Handling},
author = {Jannes Breier and Sebastian Ostberg and Stephen Björn Wirth and Sara Minoli and Fabian Stenzel and Christoph Müller},
year = {2024},
note = {R package version 1.4.0},
note = {R package version 1.4.1},
doi = {10.5281/zenodo.7773134},
url = {https://github.com/PIK-LPJmL/lpjmlkit},
}
Expand Down

0 comments on commit e5dafe8

Please sign in to comment.