parameter

The module parameter contains the parameter classes allowing the management of parameters useful for in pipelines module and to extract parameters from a spreadsheet.

The module contains the following classes:
  • Parameter: main parameter class

  • Filepath: handles the paths to files and diverse required data

  • Server: handles the connection to ENTSO-E server

exception ecodynelec.parameter.FileNotFoundWarning(*args, **kwargs)[source]

Bases: UserWarning

class ecodynelec.parameter.Filepath(excel=None)[source]

Bases: object

Collection of ecodynelec parameters specifically related to data to be loaded from local machine.

Variables:
  • rootdir (str) – root directory of the experiment (highest common folder). Useful mainly within the class.

  • generation (str) – directory containing generation files from ENTSO-E database

  • exchanges (str) – directory containing cross-border flow files from ENTSO-E database

  • savedir (str) – directory where to save the results. Default: None (no saving)

  • ui_vector (str) – file with the impact matrix in a directly usable format as .csv (impact per kWh produced for each production unit)

  • mapping (str) – file with the mapping as a spreadsheet (impact per kWh produced for each production unit)

  • neighbours (str) – file gathering the list of neighbours of each european country

  • gap (str) – file with estimations of the nature of the residual

  • swissGrid (str) – file with production and cross-border flows from Swiss Grid

  • networkLosses (str) – file with estimation of the power grid losses.

from_excel(excel):

reads the values from an xlsx spreadsheet.

__setattr__:

ensures that new values for attribures are formated correctly

__repr__:

allows visualization via print()

from_excel(excel)[source]

Extract parameters information from a .xlsx spreadsheet.

Parameters:

excel (str) – path to a .xlsx spreadsheet

class ecodynelec.parameter.Parameter(excel=None)[source]

Bases: object

Parameter object adapted to the execution of the algorithm.

Variables:
  • path (str) – FilePath object containing information about path to different documents.

  • server (str) – Server object containing information about connections to ENTSO-E server.

  • ctry (list) – the (sorted) list of countries to include

  • target (str) – the target country where to compute the mix and impact.

  • start (datetime) – starting date (utc)

  • end (datetime) – ending date (utc)

  • freq (str) – the time step (15min, 30min, H, d, W, M or Y)

  • timezone (str) – the timezone to convert data to at the end of computation

  • cst_imports (bool) – boolean to consider a constant impact for the imports

  • sg_imports (bool) – boolean to replace Entso exchanges by SwissGrid exchanges

  • net_exchanges (bool) – boolean to consider net exchanges at each border (i.e. no bidirectional transfer within one time step)

  • residual_global (bool) – to include a residual for CH

  • data_cleaning (bool) – to enable automatic data cleaning / filling

  • ch_enr_model_path (str) – Path to the CH renewable energy production data, exported using EcoDynElec-Enr-Model. When residual global is True, this is used to replace the Residual_Other_CH category.

  • storage_path (str) – Path to the CH storage data.

  • dynamic_impact (bool) – To enable dynamic impact calculation

from_excel(excel):

reads the values from an xlsx spreadsheet. Method is also included in initialization, thus no need to apply if the object is declared with Parameter(excel=”paht/to/file.xlsx”).

__setattr__:

ensures that new values for attribures are formated correctly

__repr__:

allows visualization via print()

from_excel(excel)[source]

Extract parameters information from a .xlsx spreadsheet.

Parameters:

excel (str) – path to a .xlsx spreadsheet

class ecodynelec.parameter.Server(excel=None)[source]

Bases: object

Server object allowing to parametrize the automatic downloading of data files.

Variables:
  • useServer (bool, default to False) – to download from server or to skip this time consuming step.

  • removeUnused (bool, default to False) – to clear the target directory from non-related files.

  • host (str, default to "sftp-transparency.entsoe.eu") – specify the host database for the connection

  • port (int, deafult to 22) – specify the port to use

  • username (str, default to None) – the username for the account to connect with

  • password (str, default to None) – the password of the account. No encryption on the ecodynelec end. The credentials (username and password) are asked during the execution if missing from this class. Best practice for occasional use of the download functionality is to enter your credentials only during the main execution and not via this class or in spreadsheet.

  • _nameGenerationFile (str, default to "AggregatedGenerationPerType_16.1.B_C.csv") – general naming of files to download for unit generation on the ENTSO-E server. This excludes the first part of the files names, which involve the year and month.

  • _nameExchangesFile (str, default to "PhysicalFlows_12.1.G.csv") – general naming of files to download for phisical cross-border flows on the ENTSO-E server. This excludes the first part of the files names, which involve the year and month.

  • _remoteGenerationDir (str, default to "/TP_export/AggregatedGenerationPerType_16.1.B_C/") – path to files of interest for unit generation on the ENTSO-E server.

  • _remoteExchangesDir (str, default to "/TP_export/PhysicalFlows_12.1.G/") – path to files of interest for phisical cross-border flows on the ENTSO-E server.

from_excel(excel):

reads the values from an xlsx spreadsheet.

__setattr__:

ensures that new values for attribures are formated correctly

__repr__:

allows visualization via print()

from_excel(excel)[source]

Extract parameters information from a .xlsx spreadsheet.

Parameters:

excel (str) – path to a .xlsx spreadsheet