Skip to content

Commit

Permalink
Merge pull request #96 from 0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q/dev/depr…
Browse files Browse the repository at this point in the history
…ecate_read.gdx_factors

soft-deprecate read.gdx(factors = )
  • Loading branch information
0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q authored Jul 8, 2024
2 parents 0b66d3f + 66fd907 commit 60b21d7
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '623603320'
ValidationKey: '623865000'
AcceptedWarnings:
- 'Warning: package ''.*'' was built under R version'
- 'Warning: namespace ''.*'' is not available and has been replaced'
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: 'quitte: Bits and pieces of code to use with quitte-style data frames'
version: 0.3134.0
date-released: '2024-06-24'
version: 0.3135.0
date-released: '2024-06-26'
abstract: A collection of functions for easily dealing with quitte-style data frames,
doing multi-model comparisons and plots.
authors:
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Type: Package
Package: quitte
Title: Bits and pieces of code to use with quitte-style data frames
Version: 0.3134.0
Date: 2024-06-24
Version: 0.3135.0
Date: 2024-06-26
Authors@R: c(
person("Michaja", "Pehl", , "[email protected]", role = c("aut", "cre")),
person("Nico", "Bauer", , "[email protected]", role = "aut"),
Expand Down
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ importFrom(lazyeval,interp)
importFrom(lazyeval,lazy_dots)
importFrom(lazyeval,lazy_eval)
importFrom(lifecycle,deprecate_warn)
importFrom(lifecycle,deprecated)
importFrom(lifecycle,is_present)
importFrom(lubridate,is.POSIXct)
importFrom(magclass,"getNames<-")
importFrom(magclass,"getSets<-")
Expand Down
19 changes: 10 additions & 9 deletions R/read.gdx.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,24 @@
#' @param fields fields to read from variables and equations (any of `lo`,
#' `l`, `m`, and `up`); ignored for parameters
#' @param colNames string vector of column names to override dimension names
#' @param factors return non-numerical columns as factors (default) or character
#' vectors
#' @param squeeze if TRUE, squeeze out any zero or EPS stored in the GDX
#' @param factors Deprecated. Do not use any more.
#' @param squeeze if `TRUE`, squeeze out any zero or EPS stored in the GDX
#' container
#' @return quitte data frame
#' @author Michaja Pehl
#'
#' @importFrom lifecycle deprecated deprecate_warn is_present
#' @importFrom tibble as_tibble
#'
#' @export
read.gdx <- function(gdxName, requestList.name, fields = "l", colNames = NULL,
factors = TRUE, squeeze = TRUE) {
factors = deprecated(), squeeze = TRUE) {

if (is_present(factors))
{
deprecate_warn('0.3135.0', 'quitte::read.gdx(factors = )',
details = 'Please do not use the argument anymore.')
}

# Check if gdxrrw package is installed
if (!any(.packages(all.available = TRUE) == "gdxrrw"))
Expand Down Expand Up @@ -117,10 +123,5 @@ read.gdx <- function(gdxName, requestList.name, fields = "l", colNames = NULL,

data <- as_tibble(data.frame(data))

if (!factors) {
data <- data %>%
character.data.frame()
}

return(data)
}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Bits and pieces of code to use with quitte-style data frames

R package **quitte**, version **0.3134.0**
R package **quitte**, version **0.3135.0**

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

Expand Down Expand Up @@ -47,7 +47,7 @@ In case of questions / problems please contact Michaja Pehl <michaja.pehl@pik-po

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

Pehl M, Bauer N, Hilaire J, Levesque A, Luderer G, Schultes A, Dietrich J, Richters O (2024). _quitte: Bits and pieces of code to use with quitte-style data frames_. R package version 0.3134.0, <URL: https://github.com/pik-piam/quitte>.
Pehl M, Bauer N, Hilaire J, Levesque A, Luderer G, Schultes A, Dietrich J, Richters O (2024). _quitte: Bits and pieces of code to use with quitte-style data frames_. R package version 0.3135.0, <https://github.com/pik-piam/quitte>.

A BibTeX entry for LaTeX users is

Expand All @@ -56,7 +56,7 @@ A BibTeX entry for LaTeX users is
title = {quitte: Bits and pieces of code to use with quitte-style data frames},
author = {Michaja Pehl and Nico Bauer and Jérôme Hilaire and Antoine Levesque and Gunnar Luderer and Anselm Schultes and Jan Philipp Dietrich and Oliver Richters},
year = {2024},
note = {R package version 0.3134.0},
note = {R package version 0.3135.0},
url = {https://github.com/pik-piam/quitte},
}
```

0 comments on commit 60b21d7

Please sign in to comment.