Code Monkey home page Code Monkey logo

gdx's People

Contributors

0umfhxcvx5j7joaohfss5mncnistjj6q avatar fbenke-pik avatar pfuehrlich-pik avatar pre-commit-ci[bot] avatar tscheypidi avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

gdx's Issues

chage default to readGDX(react = 'silent')?

How about changing the default of parameter react in readGDX() from warning to silent?

readGDX <- function(gdx,...,types=c("sets","equations","parameters","variables","aliases"),field="All",format="simplest",restore_zeros=TRUE, react="warning", select=NULL, collapseNames=TRUE, magpie_cells=TRUE) {

Little code-census: searching through calls to readGDX() in all pik-piam packages:

react count
<none> 1151
'silent' 107
'warning' 8
'error' 0
'quiet' 5
F 2

Most users don't seem to care too much whether objects are found or not, and of those who seem to care, most are actually ok with silent, and some don't care enough to put down a legal parameter.

Of the first group (not caring or ok with silent), 544 calls are in the remind package, which elicits a truck load of warnings about

<some_parameter> not found in GDX! <some_parameter2> returned

due to all the renaming that has been going on.

This makes warnings quite meaningless, because a) this is designed-for behaviour and b) it also makes it impossible to see any other warnings, since R only keeps 50 of them.

So how about changing the default to silent, cutting down on all those warnings?

readGDX(format = 'first_found') breaks on some .gdx files

Using this file /p/projects/rd3mod/gdx_file_breaking_readGDX.gdx,

this works:

str(readGDX('gdx_file_breaking_readGDX.gdx', 'v37_emiIndCCSmax', field = 'l'))
Formal class 'magpie' [package "magclass"] with 1 slot
  ..@ .Data: num [1:12, 1:40, 1:5] 0 0 0 0 0 0 0 0 0 0 ...
  .. ..- attr(*, "dimnames")=List of 3
  .. .. ..$ all_regi: chr [1:12] "CAZ" "CHA" "EUR" "IND" ...
  .. .. ..$ ttot    : chr [1:40] "y1900" "y1905" "y1910" "y1915" ...
  .. .. ..$ emiInd37: chr [1:5] "co2cement_process" "co2cement" "co2chemicals" "co2steel" ...

but this doesn't:

readGDX('gdx_file_breaking_readGDX.gdx', 'v37_emiIndCCSmax', field = 'l', 
         format = 'first_found')
NULL
Warning message:
In readGDX("gdx_file_breaking_readGDX.gdx", "v37_emiIndCCSmax",  :
  No element of v37_emiIndCCSmax found in GDX! NULL returned

Using the current REMIND input.gdx works, though. Really weird interaction of .gdx file and readGDX() code.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.