Skip to content

tedf

TEDFInconsistencyException

Description

This is a class to store inconsistencies in the TEDFs

Methods

Public Methods

Method new()

Create instance of TEDFInconsistencyException class

Usage

TEDFInconsistencyException$new(
  message = "Inconsistency detected",
  row_id = NULL,
  col_id = NULL,
  file_path = NULL
)

Arguments:

  • message (character) the message of the exception
  • row_id Id of the row
  • col_id Id of the column
  • file_path file path

Method clone()

The objects of this class are cloneable with this method.

Usage

TEDFInconsistencyException$clone(deep = FALSE)

Arguments:

  • deep Whether to make a deep clone.

TEBase

Description

This is the base class for technoeconomic data.

Examples

## Example usage:
base_technoeconomic_data <- TEBase$new("variable_name")

Methods

Public Methods

Method new()

Create new instance of TEBase class. Set parent variable and technology specifications (var_specs) from input

Usage

TEBase$new(parent_variable)

Arguments:

  • parent_variable (character) Name of the parent variable

Method clone()

The objects of this class are cloneable with this method.

Usage

TEBase$clone(deep = FALSE)

Arguments:

  • deep Whether to make a deep clone.

TEDF

Description

This class is used to store Technoeconomic DataFiles.

Examples

## Example usage:
tedf <- TEDF$new("variable_name")
tedf$load()
tedf$read("file_path.csv")
tedf$write("output_file_path.csv")
tedf$check()
tedf$check_row()


### ------------------------------------------------
### Method `TEDF$load`
### ------------------------------------------------

## Example usage:
tedf$load()


### ------------------------------------------------
### Method `TEDF$read`
### ------------------------------------------------

## Example usage:
tedf$read()


### ------------------------------------------------
### Method `TEDF$write`
### ------------------------------------------------

## Example usage:
tedf$write()


### ------------------------------------------------
### Method `TEDF$check`
### ------------------------------------------------

## Example usage:
tedf$check(raise_exception = TRUE)

Methods

Public Methods

Method new()

Create new instance of TEDF class. Initialise parent class and object fields

Usage

TEDF$new(
  parent_variable,
  database_id = "public",
  file_path = NULL,
  data = NULL
)

Arguments:

  • parent_variable (Character): Variable from which data should be collected.
  • database_id (Character):, default: "public". Database from which to load data.
  • file_path (Path):, optional. File path from which to load file.
  • data (DataFrame):, optional. Specific Technoeconomic data.

Method load()

Load TEDataFile (only if it has not been read yet)

Usage

TEDF$load()

Example:

## Example usage:
tedf$load()

Returns:

TEDF. Returns the TEDF object it is called on.

Method read()

This method reads TEDF from a CSV file.

Usage

TEDF$read()

Example:

## Example usage:
tedf$read()

Method write()

write TEDF to CSV file.

Usage

TEDF$write()

Example:

## Example usage:
tedf$write()

Method check()

Check that TEDF is consistent and add inconsistencies to internal parameter

Usage

TEDF$check(raise_exception = TRUE)

Arguments:

  • raise_exception Logical, default: TRUE. If an exception is to be raised.

Example:

## Example usage:
tedf$check(raise_exception = TRUE)

Method check_row()

checks if row of dataframe has issues - NOT IMPLEMENTED YET

Usage

TEDF$check_row(row_id, raise_exception = TRUE)

Arguments:

  • row_id Id of the row
  • raise_exception (logical) If exception is to be raised

Method clone()

The objects of this class are cloneable with this method.

Usage

TEDF$clone(deep = FALSE)

Arguments:

  • deep Whether to make a deep clone.