euromod.core

Below are listed the main public classes of the euromod.core module.

Classes

Addon

A EUROMOD add-on (e.g. MTR, LMA, NRR).

AddonSystem

A system of a EUROMOD add-on.

ConsumptionTaxFactor

-

ConsumptionTaxFactorYear

-

Country

Country-specific EUROMOD tax-benefit model.

Dataset

Dataset available in a country model.

DatasetInSystem

Datasets available in a system model.

Extension

EUROMOD extensions.

ExtensionSwitch

A class containing the extension switches of an object.

Function

Functions implemented in a country policy.

FunctionInSystem

Functions implemented in a policy for a specific system.

IndTaxInfoContainer

Container class storing Country objects.

Model

Base class of the Euromod Connector instantiating the microsimulation model

Parameter

Parameters set up in a function.

ParameterInSystem

Parameters set up in a function for a specific system.

Policy

Policy rules modeled in a country.

PolicyInSystem

Policy rules modeled in a system.

ReferencePolicy

Object storing the reference policies.

Simulation

Object storing the simulation results.

System

A EUROMOD tax-benefit system.

SystemBase

Base class for systems, holding the navigation shared by System

UprateFactor

-

UprateFactorYear

-

UprateFactorYearsContainer

Container class storing Country objects.

class euromod.core.Addon(name: str, model: Model)

A EUROMOD add-on (e.g. MTR, LMA, NRR).

This class instantiates a EUROMOD add-on. An add-on is stored like a country and can be navigated in the same way: it contains AddonSystem, Policy (with their Function and Parameter) and Extension objects. Unlike a Country it has no datasets, local extensions or uprating factors, and its systems cannot be run on their own: an add-on is integrated on top of a base country system via the addons parameter of System.run().

A class instance is automatically generated and stored in the attribute addons of the base class Model.

Parameters:
  • name (str) – Name of the add-on (e.g. “MTR”).

  • model (Model) – A class containing the EUROMOD base model.

Returns:

A class containing a EUROMOD add-on.

Return type:

Addon

Example

>>> from euromod import Model
>>> mod=Model("C:\EUROMOD_RELEASES_I6.0+")
>>> mod.addons['MTR']

Overview

Attributes

extensions

A Container with Extension objects. Add-ons only reference the model extensions.

model

Model Returns the base Model object.

name

Name of the add-on.

policies

A Container with Policy objects.

systems

A Container with AddonSystem objects.

Methods

get_applicable_systems(base_system)

Get the add-on systems that apply to the given base country system.

Attributes

extensions: euromod.container.Container[Extension] | None = None

A Container with Extension objects. Add-ons only reference the model extensions.

model: Model

Model Returns the base Model object.

name: str

Name of the add-on.

policies: euromod.container.Container[Policy] | None = None

A Container with Policy objects.

systems: euromod.container.Container[AddonSystem] | None = None

A Container with AddonSystem objects.

Methods

get_applicable_systems(base_system)

Get the add-on systems that apply to the given base country system.

Parameters:

base_system (str | System) – Name of the base country system (e.g. “SE_2021”), or a System object.

Returns:

The AddonSystem objects whose AddOn_Applic patterns match the base system (add-on systems without an AddOn_Applic function are never applicable).

Return type:

Container[AddonSystem]

class euromod.core.AddonSystem(*arg)

A system of a EUROMOD add-on.

This class represents a system inside an add-on (e.g. MTR_SE). It is navigable like a System (policies -> functions -> parameters), but it cannot be run on its own and has no datasets: an add-on system is integrated on top of a base country system when running a simulation (see the addons parameter of System.run()). In addition it exposes the applicability declared by the add-on’s AddOn_Applic function: the base-system patterns are available as the read-only attributes applies_to_patterns and not_applicable_patterns, and the is_applicable() method tests a given base system against them.

Instances of this class are collected in a Container as attribute systems of the Addon.

Returns:

A class with an add-on system.

Return type:

AddonSystem

Example

>>> from euromod import Model
>>> mod=Model("C:\EUROMOD_RELEASES_I6.0+")
>>> mod.addons['MTR'].systems[0]

Overview

Attributes

parent

The add-on-specific class.

Methods

is_applicable(base_system)

Whether this add-on system applies to the given base country system.

Attributes

parent: Addon

The add-on-specific class.

Methods

is_applicable(base_system) bool

Whether this add-on system applies to the given base country system.

Uses the same wildcard pattern-matching of the AddOn_Applic Sys/SysNA parameters as the EUROMOD user interface (SysNA prevails over Sys). A system without an AddOn_Applic function is never applicable.

Parameters:

base_system (str | System) – Name of the base country system (e.g. “SE_2021”), or a System object.

Returns:

True if this add-on system applies to the base system.

Return type:

bool

class euromod.core.ConsumptionTaxFactor(*args)

Overview

Attributes

ID

Identifier for ConsumptionTaxFactor

coicopCode

COICOP code related to consumption tax

coicopCodeVersion

Combined COICOP code and version

coicopLabel

Label for the COICOP code

coicopVersion

Version of the COICOP code

comment

Comment regarding the consumption tax factor

name

Name of the consumption tax factor

nameITT

ITT Name of the consumption tax factor

paramType

Parameter type, e.g., VAT Rates

parent

-

unit

Unit of the consumption tax factor, e.g., percentage

values

Container for the consumption tax values for respective years

Attributes

ID: str

Identifier for ConsumptionTaxFactor

coicopCode: str

COICOP code related to consumption tax

coicopCodeVersion: str

Combined COICOP code and version

coicopLabel: str

Label for the COICOP code

coicopVersion: str

Version of the COICOP code

comment: str

Comment regarding the consumption tax factor

name: str

Name of the consumption tax factor

nameITT: str

ITT Name of the consumption tax factor

paramType: str

Parameter type, e.g., VAT Rates

parent: Country
unit: str

Unit of the consumption tax factor, e.g., percentage

values: IndTaxInfoContainer

Container for the consumption tax values for respective years

class euromod.core.ConsumptionTaxFactorYear(*args)

Overview

Attributes

indTaxID

Identifier for the individual tax in this year

parent

-

value

Tax factor value for the specified year

year

Year associated with this tax factor

Attributes

indTaxID: str

Identifier for the individual tax in this year

parent: ConsumptionTaxFactor
value: str

Tax factor value for the specified year

year: str

Year associated with this tax factor

class euromod.core.Country(country: str, model: Model)

Country-specific EUROMOD tax-benefit model.

This class instantiates the EUROMOD tax benefit model for a given country. A class instance is automatically generated and stored in the attribute countries of the base class Model.

This class contains subclasses of type System, Policy, Dataset and Extension.

Parameters:
  • country (str) – Name of the country. Must be a two-letter country codes, see the Eurostat Glossary:Country codes.

  • model (Model) – A class containing the EUROMOD base model.

Returns:

A class containing the EUROMOD country models.

Return type:

Country

Example

>>> from euromod import Model
>>> mod=Model("C:\EUROMOD_RELEASES_I6.0+")
>>> mod.countries[0]

Overview

Attributes

ct_factors

A Container with ConsumptionTaxFactor objects.

datasets

A Container with Dataset objects.

extensions

A Container with Extension objects. These are the local + model extensions defined.

local_extensions

A Container with Extension objects. These are the local extensions defined for the country.

model

Model Returns the base Model object.

name

Two-letters country code.

policies

A Container with Policy objects.

systems

A Container with System objects.

upratefactors

A Container with UprateFactor objects.

Methods

get_switch_value(ext_name, dataset_name, sys_name)

Get the configuration of the switch.

load_data(ID_DATASET, PATH_DATA)

Load data as a pandas.DataFrame object.

Attributes

ct_factors: euromod.container.Container[ConsumptionTaxFactor] | None = None

A Container with ConsumptionTaxFactor objects.

datasets: euromod.container.Container[Dataset] | None = None

A Container with Dataset objects.

extensions: euromod.container.Container[Extension] | None = None

A Container with Extension objects. These are the local + model extensions defined.

local_extensions: euromod.container.Container[Extension] | None = None

A Container with Extension objects. These are the local extensions defined for the country.

model: Model

Model Returns the base Model object.

name: str

Two-letters country code.

policies: euromod.container.Container[Policy] | None = None

A Container with Policy objects.

systems: euromod.container.Container[System] | None = None

A Container with System objects.

upratefactors: euromod.container.Container[UprateFactor] | None = None

A Container with UprateFactor objects.

Methods

get_switch_value(ext_name: str | None = None, dataset_name: str | None = None, sys_name: str | None = None)

Get the configuration of the switch.

Parameters:
  • ext_name (str , optional) – Name of the extension. The default is None.

  • dataset_name (str , optional) – Name of the dataset. The default is None.

  • sys_name (str, optional) – Name of the system. The default is None.

Raises:

KeyError – Is raised if ext_name, dataset_name or sys_name, but is not configured in the model.

Returns:

Object containing information how the switch is configured. Note that there is only a value returned if the switch is either explicitly ‘off’ or ‘on’. When it’s configured as n/a in the model no value will be included.

Return type:

Container[ExtensionSwitch]

load_data(ID_DATASET, PATH_DATA=None)

Load data as a pandas.DataFrame object.

Parameters:
  • ID_DATASET (str) – Name of the dataset excluding extension (Note: must be a txt file).

  • PATH_DATA (str, optional) – Path to the dataset. Default is the folder “PATH_TO_EUROMOD_PROJECT/Input”.

Returns:

Dataset is returned as a pandas.DataFrame object.

Return type:

pandas.DataFrame

class euromod.core.Dataset(*args)

Dataset available in a country model.

This class contains the relevant information about a dataset.

Returns:

A class with the country-specific dataset.

Return type:

Dataset

Overview

Attributes

ID

Dataset identifier number.

coicopVersion

COICOP version.

comment

Comment about the dataset.

currency

Currency of the monetary values in the dataset.

decimalSign

Decimal sign

name

Name of the dataset.

parent

The country-specific class.

private

Access type.

readXVariables

Read variables.

system_elements

-

useCommonDefault

Use default.

yearCollection

Year of the dataset collection.

yearInc

Reference year for the income variables.

Attributes

ID: str

Dataset identifier number.

coicopVersion: str = ''

COICOP version.

comment: str = ''

Comment about the dataset.

currency: str = ''

Currency of the monetary values in the dataset.

decimalSign: str = ''

Decimal sign

name: str

Name of the dataset.

parent: Country

The country-specific class.

private: str = 'no'

Access type.

readXVariables: str = 'no'

Read variables.

system_elements: euromod.container.Container
useCommonDefault: str = 'no'

Use default.

yearCollection: str

Year of the dataset collection.

yearInc: str

Reference year for the income variables.

class euromod.core.DatasetInSystem(info, id, parentSystemObject, parentTypeObject, parent)

Datasets available in a system model.

Returns:

A class with the system-specific dataset.

Return type:

DatasetInSystem

Overview

Attributes

ID

Dataset identifier number.

bestMatch

If yes, the current dataset is a best match for the specific system.

coicopVersion

COICOP version.

comment

Comment about the dataset.

currency

Currency of the monetary values in the dataset.

dataID

Identifier number of the reference dataset at the country level.

decimalSign

Decimal sign

name

Name of the dataset.

parent

The country specific class.

private

Access type.

readXVariables

Read variables.

sysID

Identifier number of the reference system.

useCommonDefault

Use default.

yearCollection

Year of the dataset collection.

yearInc

Reference year for the income variables.

Attributes

ID: str

Dataset identifier number.

bestMatch: str

If yes, the current dataset is a best match for the specific system.

coicopVersion: str

COICOP version.

comment: str

Comment about the dataset.

currency: str

Currency of the monetary values in the dataset.

dataID: str

Identifier number of the reference dataset at the country level.

decimalSign: str

Decimal sign

name: str

Name of the dataset.

parent: Country

The country specific class.

private: str

Access type.

readXVariables: str

Read variables.

sysID: str

Identifier number of the reference system.

useCommonDefault: str

Use default.

yearCollection: str

Year of the dataset collection.

yearInc: str

Reference year for the income variables.

class euromod.core.Extension(*arg)

EUROMOD extensions.

Returns:

A class with the model extensions.

Return type:

Extension

Overview

Attributes

name

Long name of the extension.

parent

The model base class.

shortName

Short name of the extension.

Attributes

name: str = None

Long name of the extension.

parent: Model

The model base class.

shortName: str = None

Short name of the extension.

class euromod.core.ExtensionSwitch(info, ctry)

A class containing the extension switches of an object.

This class is returned by get_switch_value() method and should not be used by the user as a stand alone.

Returns:

A class with relevant information on the extension switch.

Return type:

ExtensionSwitch

Overview

Attributes

data_name

Name of the applicable dataset.

extension_name

Short name of the extension.

parent

The country-specific class.

sys_name

Name of the applicable system.

value

Value of the switch as configured in EUROOMOD.

Attributes

data_name: str

Name of the applicable dataset.

extension_name: str

Short name of the extension.

parent: Country

The country-specific class.

sys_name: str

Name of the applicable system.

value: str = ''

Value of the switch as configured in EUROOMOD.

class euromod.core.Function(*arg)

Functions implemented in a country policy.

Returns:

A class with country-specific function.

Return type:

Function

Overview

Attributes

ID

Identifier number of the function.

comment

Comment specific to the function.

extensions

A Container of Extension objects in a country.

name

Name of the function.

order

Order of the function in the specific spine.

parameters

A Container of Parameter objects in a country.

parent

The class of the country-specific policy.

polID

Identifier number of the reference policy.

private

Access type.

spineOrder

Order of the function in the spine.

Attributes

ID: str

Identifier number of the function.

comment: str

Comment specific to the function.

extensions: euromod.container.Container[Extension] | None = None

A Container of Extension objects in a country.

name: str

Name of the function.

order: str

Order of the function in the specific spine.

parameters: euromod.container.Container[Parameter] | None = None

A Container of Parameter objects in a country.

parent: Policy

The class of the country-specific policy.

polID: str

Identifier number of the reference policy.

private: str

Access type.

spineOrder: str

Order of the function in the spine.

class euromod.core.FunctionInSystem(*arg)

Functions implemented in a policy for a specific system.

Returns:

A class with the system-specific function.

Return type:

FunctionInSystem

Overview

Attributes

ID

Identifier number of the function.

comment

Comment specific to the function.

extensions

A Container of Extension objects in a system.

funID

Identifier number of the reference function at country level.

name

Name of the function.

order

Order of the function in the specific spine.

parameters

A Container with ParameterInSystem objects specific to a function.

parent

The class of the country-specific policy.

polID

Identifier number of the reference policy.

private

Access type.

spineOrder

Order of the function in the spine.

switch

Policy switch action.

sysID

Identifier number of the reference policy.

Attributes

ID: str

Identifier number of the function.

comment: str

Comment specific to the function.

extensions: euromod.container.Container[Extension]

A Container of Extension objects in a system.

funID: str

Identifier number of the reference function at country level.

name: str

Name of the function.

order: str

Order of the function in the specific spine.

parameters: euromod.container.Container[ParameterInSystem] | None = None

A Container with ParameterInSystem objects specific to a function.

parent: Policy

The class of the country-specific policy.

polID: str

Identifier number of the reference policy.

private: str

Access type.

spineOrder: str

Order of the function in the spine.

switch: str

Policy switch action.

sysID: str

Identifier number of the reference policy.

class euromod.core.IndTaxInfoContainer(idDict=False)

Container class storing Country objects.

class euromod.core.Model(model_path: str)

Base class of the Euromod Connector instantiating the microsimulation model EUROMOD.

Parameters:

model_path (str) – Path to the EUROMOD project.

Returns:

A class containing the EUROMOD base model.

Return type:

Model

Example

>>> from euromod import Model
>>> mod=Model("C:\EUROMOD_RELEASES_I6.0+")

Overview

Attributes

addons

A Container with Addon objects.

countries

A Container with Country objects.

extensions

A Container with Model extensions.

model_path

Path to the EUROMOD project.

software_version

Version of the EUROMOD software (engine) actually loaded.

Attributes

addons: euromod.container.Container[Addon]

A Container with Addon objects.

countries: euromod.container.Container[Country]

A Container with Country objects.

extensions: euromod.container.Container[Extension]

A Container with Model extensions.

model_path: str

Path to the EUROMOD project.

software_version: str = ''

Version of the EUROMOD software (engine) actually loaded.

class euromod.core.Parameter(*arg)

Parameters set up in a function.

Returns:

A class with country-specific parameter.

Return type:

Parameter

Overview

Attributes

ID

Identifier number of the parameter.

comment

Comment specific to the parameter.

extensions

A Container with Extension objects.

funID

Identifier number of the reference function at country level.

group

Parameter group value.

name

Name of the parameter.

order

Order of the parameter in the specific spine.

parent

The class of the country-specific function.

spineOrder

Order of the parameter in the spine.

Attributes

ID: str

Identifier number of the parameter.

comment: str

Comment specific to the parameter.

extensions: euromod.container.Container[Extension] | None = None

A Container with Extension objects.

funID: str

Identifier number of the reference function at country level.

group: str = ''

Parameter group value.

Type:

str

name: str

Name of the parameter.

order: str

Order of the parameter in the specific spine.

parent: Function

The class of the country-specific function.

spineOrder: str

Order of the parameter in the spine.

class euromod.core.ParameterInSystem(info, id, parentSystemObject, parentTypeObject, parent)

Parameters set up in a function for a specific system.

Returns:

A class with the system-specific function parameter.

Return type:

ParameterInSystem

Overview

Attributes

ID

Identifier number of the parameter.

comment

Comment specific to the parameter.

extensions

A Container with Extension objects.

funID

Identifier number of the reference function at country level.

group

Parameter group number.

name

Name of the parameter.

order

Order of the parameter in the specific spine.

parID

Identifier number of the reference parameter at country level.

parent

The class of the country-specific function.

spineOrder

Order of the parameter in the spine.

sysID

Identifier number of the reference system.

value

Value of the parameter.

Methods

evaluate(var_dict)

-

Attributes

ID: str

Identifier number of the parameter.

comment: str

Comment specific to the parameter.

extensions: euromod.container.Container

A Container with Extension objects.

funID: str

Identifier number of the reference function at country level.

group: str

Parameter group number.

name: str

Name of the parameter.

order: str

Order of the parameter in the specific spine.

parID: str

Identifier number of the reference parameter at country level.

parent: Function

The class of the country-specific function.

spineOrder: str

Order of the parameter in the spine.

sysID: str

Identifier number of the reference system.

value: str

Value of the parameter.

Methods

evaluate(var_dict=dict())
class euromod.core.Policy(*arg)

Policy rules modeled in a country.

Returns:

A class with the country-specific policies.

Return type:

Policy

Overview

Attributes

ID

Identifier number of the policy.

comment

Comment specific to the policy.

extensions

A Container of policy-specific Extension objects.

functions

A Container of policy-specific Function objects.

name

Name of the policy.

order

Order of the policy in the specific spine.

parent

The country-specific class.

private

Access type. Default is ‘no’.

spineOrder

Order of the policy in the spine.

Attributes

ID: str

Identifier number of the policy.

comment: str

Comment specific to the policy.

extensions: euromod.container.Container[Extension] | None = None

A Container of policy-specific Extension objects.

functions: euromod.container.Container[Function] | None = None

A Container of policy-specific Function objects.

name: str

Name of the policy.

order: str

Order of the policy in the specific spine.

parent: Country

The country-specific class.

private: str = 'no'

Access type. Default is ‘no’.

spineOrder: str

Order of the policy in the spine.

class euromod.core.PolicyInSystem(*arg)

Policy rules modeled in a system.

Returns:

A class with system-specific policies.

Return type:

PolicyInSystem

Overview

Attributes

ID

Identifier number of the policy.

comment

Comment specific to the policy.

extensions

A Container of policy-specific Extension objects.

functions

A Container with FunctionInSystem objects specific to the system

name

Name of the policy.

order

Order of the policy in the specific spine.

parent

The country-specific class.

polID

Identifier number of the reference policy at country level.

private

Access type. Default is ‘no’.

spineOrder

Order of the policy in the spine.

switch

Policy switch action.

sysID

Identifier number of the reference system.

Attributes

ID: str

Identifier number of the policy.

comment: str

Comment specific to the policy.

extensions: euromod.container.Container[Extension]

A Container of policy-specific Extension objects.

functions: euromod.container.Container[FunctionInSystem] | None = None

A Container with FunctionInSystem objects specific to the system

name: str

Name of the policy.

order: str

Order of the policy in the specific spine.

parent: Country

The country-specific class.

polID: str

Identifier number of the reference policy at country level.

private: str

Access type. Default is ‘no’.

spineOrder: str

Order of the policy in the spine.

switch: str

Policy switch action.

sysID: str

Identifier number of the reference system.

class euromod.core.ReferencePolicy(info, parent)

Object storing the reference policies.

Returns:

A class with the country-specific reference policies.

Return type:

ReferencePolicy

Overview

Attributes

extensions

A Container of reference policy-specific Extension objects.

name

Name of the reference policy.

parent

The country-specific class.

Attributes

extensions: euromod.container.Container[Extension] | None = None

A Container of reference policy-specific Extension objects.

name: str

Name of the reference policy.

parent: Country

The country-specific class.

class euromod.core.Simulation(out, constantsToOverwrite, polars, keep_clr_data=True)

Object storing the simulation results.

This is a class containing results from the simulation run() and other related configuration information.

Returns:

A class with simulation output.

Return type:

Simulation

Overview

Attributes

constantsToOverwrite

A dict-type object with user-defined constants.

errors

A list with errors and warnings from the simulation run.

output_filenames

A list of file-names of simulation output.

outputs

A Container with pandas.DataFrame-type simulation results.

Methods

statistics(template_path, variable, reforms, pages, tables)

Calculate statistics from this simulation’s output.

Attributes

constantsToOverwrite: dict[tuple(str, str), str]

A dict-type object with user-defined constants.

errors: list[str]

A list with errors and warnings from the simulation run.

output_filenames: list[str] | [] = []

A list of file-names of simulation output.

outputs: euromod.container.Container[pandas.DataFrame]

A Container with pandas.DataFrame-type simulation results. For indexing use an integer or a label from output_filenames.

Methods

statistics(template_path: str, variable: str = None, reforms=None, pages=None, tables=None)

Calculate statistics from this simulation’s output.

Convenience method that creates a Statistics instance and calls calculate() with this Simulation as the baseline.

Parameters:
  • template_path (str) – Path to the template XML file.

  • variable (str, optional) – Variable name for Variable-type templates.

  • reforms (list[Simulation], optional) – Reform simulation outputs for comparison templates.

  • pages (list[str], optional) – If given, only these template pages are calculated (partial execution).

  • tables (list[str], optional) – If given, only these tables are calculated.

Returns:

Calculation results with multiple access patterns.

Return type:

StatisticsResult

class euromod.core.System(*arg)

A EUROMOD tax-benefit system.

This class represents a EUROMOD tax system. Instances of this class are generated when loading the EUROMOD base model. These are collected in a Container as attribute systems of the Country.

Returns:

A class with country systems.

Return type:

System

Example

>>> from euromod import Model
>>> mod=Model("C:\EUROMOD_RELEASES_I6.0+")
>>> mod.countries[0].systems[-1]

Overview

Attributes

bestmatch_datasets

A Container with best-match Dataset objects in the system.

datasets

A Container of DatasetInSystem objects in the system.

parent

The country-specific class.

Methods

get_default_extensions(dataset)

param dataset:

Name of Dataset.

run(data, dataset_id, constantsToOverwrite, verbose, outputpath, addons, switches, nowarnings, euro, public_components_only, requested_vars, requested_incomelists, requested_vargroups, requested_ilgroups, suppress_other_output, breakfun_id, keep_clr_data)

Run the simulation of a EUROMOD tax-benefit system by passing the pandas or polars dataframe in memory to EUROMOD. Note that string variables will not be passed.

Attributes

bestmatch_datasets: euromod.container.Container[Dataset] | None = None

A Container with best-match Dataset objects in the system.

datasets: euromod.container.Container[DatasetInSystem] | None = None

A Container of DatasetInSystem objects in the system.

parent: Country

The country-specific class.

Methods

get_default_extensions(dataset)
Parameters:

dataset (str) – Name of Dataset.

Returns:

extensions – key is name of the extension, value, is boolean indicating true for on, false for off

Return type:

dict[bool,str]

run(data: pandas.DataFrame, dataset_id: str, constantsToOverwrite: Dict[Tuple[str, str], str] | None = None, verbose: bool = True, outputpath: str = '', addons: List[str | Tuple[str, str]] = [], switches: List[Tuple[str, bool]] = [], nowarnings=False, euro=False, public_components_only=False, requested_vars: List[str] = [], requested_incomelists: List[str] = [], requested_vargroups: List[str] = [], requested_ilgroups: List[str] = [], suppress_other_output: bool = False, breakfun_id: str = None, keep_clr_data: bool = True) Simulation

Run the simulation of a EUROMOD tax-benefit system by passing the pandas or polars dataframe in memory to EUROMOD. Note that string variables will not be passed.

Parameters:
  • data (pandas.DataFrame) – input dataframe passed to the EUROMOD model.

  • dataset_id (str) – ID of the dataset.

  • constantsToOverwrite (dict [ tuple [ str, str ], str ], optional) – A dict with constants to overwrite. Note that the key is a tuple of two strings, for which the first element is the name of the constant and the second is the groupnumber. Note that the values must be defined as strings. Default is None.

  • verbose (bool, optional) – If True then information on the output will be printed. Default is True.

  • outputpath (str, optional) – When the output path is provided, there will be anoutput file generated. Default is “”.

  • addons (list [ str | tuple [ str, str ]], optional) – List of addons to be integrated in the spine. Each entry is either the name of the addon (as a str), or a tuple of which the first element is the name of the addon and the second element is the name of the system in the addon to be integrated. When only the addon name is given, the applicable addon system is resolved automatically (like the EUROMOD user interface does) by matching the run’s system against the addon’s AddOn_Applic definitions; an error is raised if no system, or more than one system, applies (in which case the system must be given explicitly as a tuple). Default is [].

  • switches (list [ tuple [ str, bool ]], optional) – List of tuples with extensions to be switched on or of. The first element of the tuple is the short name of the extension. The second element is a boolean Default is [].

  • nowarnings (bool, optional) – If True, the warning messages resulting from the simulations will be suppressed. Default is False.

  • euro (bool, optional) – If True, the monetary variables will be converted to euro for the simulation. Default value is False.

  • public_compoments_only (bool, optional) – If True, the the model will be on with only the public compoments. Default value is False.

  • nowarnings – If True then warnings returned by the model do not get printed. The default is False.

  • requested_vars (List[str], optional) – Variables requested in a new separate output. The default is [].

  • requested_incomelists (List[str], optional) – Income lists requested in a new separate output. The default is [].

  • requested_vargroups (List[str], optional) – Vargroups requested in a new separate output. The default is [].

  • requested_ilgroups (List[str], optional) – ilgroups requested in a new separate output. The default is [].

  • suppress_other_output (bool, optional) – If True and custom output is specified then DefOutput from the model get suppressed. The default is False.

  • keep_clr_data (bool, optional) – If True, retains the raw CLR data arrays on the Simulation object for efficient downstream use (e.g., statistics calculation without re-conversion). Default is True.

Raises:

Exception – Exception when simulation does not finish succesfully, i.e. without errors.

Returns:

A class containing simulation output and error messages.

Return type:

Simulation

Example

>>> # Load the dataset
>>> import pandas as pd
>>> data = pd.read_csv("C:\EUROMOD_RELEASES_I6.0+\Input\sl_demo_v4.txt",sep="   ")
>>> # Load EUROMOD
>>> from euromod import Model
>>> mod=Model("C:\EUROMOD_RELEASES_I6.0+")
>>> # Run simulation
>>> out=mod.countries['SL'].systems['SL_1996'].run(data,'sl_demo_v4')
class euromod.core.SystemBase(*arg)

Base class for systems, holding the navigation shared by System (in a country) and AddonSystem (in an add-on): the system attributes and the lazy policies container (policies -> functions -> parameters).

Overview

Attributes

ID

Identifier number of the system.

comment

Comment specific to the system.

currencyOutput

Currency of the simulation results.

currencyParam

Currency of the monetary parameters in the system.

headDefInc

Main income definition.

name

Name of the system.

order

System order in the spine.

policies

A Container of PolicyInSystem objects in the system.

private

Access type.

year

System year.

Attributes

ID: str

Identifier number of the system.

comment: str

Comment specific to the system.

currencyOutput: str

Currency of the simulation results.

currencyParam: str

Currency of the monetary parameters in the system.

headDefInc: str

Main income definition.

name: str

Name of the system.

order: str

System order in the spine.

policies: euromod.container.Container[PolicyInSystem] | None = None

A Container of PolicyInSystem objects in the system.

private: str

Access type.

year: str

System year.

class euromod.core.UprateFactor(*args)

Overview

Attributes

ID

Identifier UprateFactor

comment

Comment of uprating factor

description

Description of uprating factor

name

Name of uprating factor

parent

-

values

Container of the uprating values for the respective years

Attributes

ID: str

Identifier UprateFactor

comment: str

Comment of uprating factor

description: str

Description of uprating factor

name: str

Name of uprating factor

parent: Country
values: UprateFactorYearsContainer

Container of the uprating values for the respective years

class euromod.core.UprateFactorYear(*args)

Overview

Attributes

ID

Identifier UprateFactor

parent

-

value

Value of uprating factor

year

Year of uprating factor

Attributes

ID: str

Identifier UprateFactor

parent: UprateFactor
value: str

Value of uprating factor

year: str

Year of uprating factor

class euromod.core.UprateFactorYearsContainer(idDict=False)

Container class storing Country objects.