Giter Club home page Giter Club logo

witchtools's Introduction

witchtools

witchtools provides a toolkit to manage data in integrated assessment models. witchtools is part of the tool ecosystem of the WITCH model. The package makes it possible to easily and transparently reproduce the data processing between the raw data, the data used in the model and the results uploaded in the IAMC database. While the package has been developed for the WITCH model, it is already used to simply process data for other uses or models.

Lifecycle: maturing devel:0.4.5 codecov

Features

  • Conversion of a yearly time series into a time-period (including possible decision tree structure) based time series.
  • Conversion of data from one regional mapping to another one.
  • Default time-period mappings, regional mappings and aggregation weights used by the WITCH model
  • Batch conversion of the make_data files from the input directory of the WITCH model
  • Easy access to the witch-team/witch-data repository

Installation

if (!requireNamespace("remotes"))
  install.packages("remotes")

remotes::install_github("witch-team/witchtools")

Usage

library(witchtools)

# Convert from 17 WITCH regions to the 5 SSP regions 
gdp_r5 <- convert_region(gdp_witch17, to_reg = 'r5')

# Convert from yearly to the WITCH time perdios
dd_t30 <- convert_region(dd_year, time_mapping = 't30')

# for WITCH user: Generate input data of the WITCH model
witch_translate_data(region = 'witch17', timescale = 't30')

witchtools's People

Contributors

jackjackk avatar johannesemm avatar laleluia avatar lolow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

witchtools's Issues

two questions

Thank you Johannes for the youtube link, it was very helpful. And, apologies in advance for basic questions.

Is it possible to do a country specific analysis?
is it possible to have carbon tax assigned to a specific sector, for example, coal? - also is it possible to do it in only one country [example USA]and keep the rest the same. I am assuming this will need code changes in the core policy file. any guidance on them would be helpful.

allow changing region mappings

Right now the region mappings seem hard coded and loaded in the packaged in an rda file.
We should think about a way to allow user specific mappings.
Both for other users, and also for us since now the .inc files used in witch and these hard coded sets are pretty incompatible, or we add a function to add or convert user defined mappings?

Debug mode & separation from witch-data

A few things from my experience in working with the witchtools package:

  • I think it would be really important to have a way in which new users can easily edit their files locally of the whole witch-* framework without having always to use github, ie using witch-data and witchtools in the local folder
  • Given it is an independent package would be good to make it work also based on a completely new witch-mode/input and witch-data folder. However, as of now it doesn't work: If I create all the files (ie run translate_witch_data), and then switch to witch-data method on an empty folder, and just rerun the script it gives a few errors: (Yet in my opinion, this should work without errors).
    -1) ssp data not found (OK I assume because of the weights).
    -2) "database connection not found" not sure which one (globiom? primap for emission weights?).

I think the weights we should or embed them in the package or make them by default use piggyback so it will work with a completely new data folder for other models etc.

Anyhow we should discuss in a witch strategic meeting!

Correct definition of EU

To be decided, but probably the set EU shoujdl contain only the current valid members of the European Union.
that is, 27 countries at present.
It seems in the moment other regions are in there like UK or so, since othereurope in witch20 is flagged as being also EU.
Also, should be based on population majority to wether it belongs to eht EU set or not imho.

Consistent time mappings and allow adding new ones

Now regional mappings are OK to added. SO would make sense to also allow custom time mappings.
In the pre-Package version there was the function
load_time_mapping = function(file){ tab = fread(file,colClasses="character") return(tab) }

However now I see some issues

  1. There is the new column "refyear" which is NOT in the raw csv files neither in WITCH nor witchtools
  2. the csv files are on yearly basis not tstep, so the function woudl be more complex now, but let's discuss how to have consisteny here too.

Convert_region additional check

Add a check to make sure all the members of the list passed to the regions field of convert_region are of type data.table and send an error message if they are not

update time and region mappings

I would suggest to add the DICE t58 mapping, ed57 (and remove enerdata56 which are actually 57 regions and it is nowhere used anymore) and add maxiso3 (from RICE50x inc files).

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.