euromod.core ============ .. py:module:: euromod.core Below are listed the main public classes of the euromod.core module. .. list-table:: **Classes** :header-rows: 0 :widths: auto :class: summarytable * - :py:obj:`ConsumptionTaxFactor ` - \- * - :py:obj:`ConsumptionTaxFactorYear ` - \- * - :py:obj:`Country ` - Country-specific EUROMOD tax-benefit model. * - :py:obj:`Dataset ` - Dataset available in a country model. * - :py:obj:`DatasetInSystem ` - Datasets available in a system model. * - :py:obj:`Extension ` - EUROMOD extensions. * - :py:obj:`ExtensionSwitch ` - A class containing the extension switches of an object. * - :py:obj:`Function ` - Functions implemented in a country policy. * - :py:obj:`FunctionInSystem ` - Functions implemented in a policy for a specific system. * - :py:obj:`IndTaxInfoContainer ` - Container class storing Country objects. * - :py:obj:`Model ` - Base class of the Euromod Connector instantiating the microsimulation model * - :py:obj:`Parameter ` - Parameters set up in a function. * - :py:obj:`ParameterInSystem ` - Parameters set up in a function for a specific system. * - :py:obj:`Policy ` - Policy rules modeled in a country. * - :py:obj:`PolicyInSystem ` - Policy rules modeled in a system. * - :py:obj:`ReferencePolicy ` - Object storing the reference policies. * - :py:obj:`Simulation ` - Object storing the simulation results. * - :py:obj:`System ` - A EUROMOD tax-benefit system. * - :py:obj:`UprateFactor ` - \- * - :py:obj:`UprateFactorYear ` - \- * - :py:obj:`UprateFactorYearsContainer ` - Container class storing Country objects. .. toctree:: :titlesonly: :maxdepth: 3 .. py:class:: ConsumptionTaxFactor(*args) .. rubric:: Overview .. list-table:: Attributes :header-rows: 0 :widths: auto :class: summarytable * - :py:obj:`ID ` - Identifier for ConsumptionTaxFactor * - :py:obj:`coicopCode ` - COICOP code related to consumption tax * - :py:obj:`coicopCodeVersion ` - Combined COICOP code and version * - :py:obj:`coicopLabel ` - Label for the COICOP code * - :py:obj:`coicopVersion ` - Version of the COICOP code * - :py:obj:`comment ` - Comment regarding the consumption tax factor * - :py:obj:`name ` - Name of the consumption tax factor * - :py:obj:`nameITT ` - ITT Name of the consumption tax factor * - :py:obj:`paramType ` - Parameter type, e.g., VAT Rates * - :py:obj:`parent ` - \- * - :py:obj:`unit ` - Unit of the consumption tax factor, e.g., percentage * - :py:obj:`values ` - Container for the consumption tax values for respective years .. rubric:: Attributes .. py:attribute:: ID :type: str Identifier for ConsumptionTaxFactor .. py:attribute:: coicopCode :type: str COICOP code related to consumption tax .. py:attribute:: coicopCodeVersion :type: str Combined COICOP code and version .. py:attribute:: coicopLabel :type: str Label for the COICOP code .. py:attribute:: coicopVersion :type: str Version of the COICOP code .. py:attribute:: comment :type: str Comment regarding the consumption tax factor .. py:attribute:: name :type: str Name of the consumption tax factor .. py:attribute:: nameITT :type: str ITT Name of the consumption tax factor .. py:attribute:: paramType :type: str Parameter type, e.g., VAT Rates .. py:attribute:: parent :type: Country .. py:attribute:: unit :type: str Unit of the consumption tax factor, e.g., percentage .. py:attribute:: values :type: IndTaxInfoContainer Container for the consumption tax values for respective years .. py:class:: ConsumptionTaxFactorYear(*args) .. rubric:: Overview .. list-table:: Attributes :header-rows: 0 :widths: auto :class: summarytable * - :py:obj:`indTaxID ` - Identifier for the individual tax in this year * - :py:obj:`parent ` - \- * - :py:obj:`value ` - Tax factor value for the specified year * - :py:obj:`year ` - Year associated with this tax factor .. rubric:: Attributes .. py:attribute:: indTaxID :type: str Identifier for the individual tax in this year .. py:attribute:: parent :type: ConsumptionTaxFactor .. py:attribute:: value :type: str Tax factor value for the specified year .. py:attribute:: year :type: str Year associated with this tax factor .. py:class:: 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 :obj:`countries` of the base class :class:`Model`. This class contains subclasses of type :class:`System`, :class:`Policy`, :class:`Dataset` and :class:`Extension`. :param country: Name of the country. Must be a two-letter country codes, see the Eurostat `Glossary:Country codes `_. :type country: :obj:`str` :param model: A class containing the EUROMOD base model. :type model: :obj:`Model` :returns: A class containing the EUROMOD country models. :rtype: Country .. rubric:: Example >>> from euromod import Model >>> mod=Model("C:\EUROMOD_RELEASES_I6.0+") >>> mod.countries[0] .. rubric:: Overview .. list-table:: Attributes :header-rows: 0 :widths: auto :class: summarytable * - :py:obj:`ct_factors ` - A :obj:`Container` with :class:`ConsumptionTaxFactor` objects. * - :py:obj:`datasets ` - A :obj:`Container` with :class:`Dataset` objects. * - :py:obj:`extensions ` - A :obj:`Container` with :class:`Extension` objects. These are the local + model extensions defined. * - :py:obj:`local_extensions ` - A :obj:`Container` with :class:`Extension` objects. These are the local extensions defined for the country. * - :py:obj:`model ` - ":class:`Model` Returns the base :class:`Model` object. * - :py:obj:`name ` - Two-letters country code. * - :py:obj:`policies ` - A :obj:`Container` with :class:`Policy` objects. * - :py:obj:`systems ` - A :obj:`Container` with :class:`System` objects. * - :py:obj:`upratefactors ` - A :obj:`Container` with :class:`UprateFactor` objects. .. list-table:: Methods :header-rows: 0 :widths: auto :class: summarytable * - :py:obj:`get_switch_value `\ (ext_name, dataset_name, sys_name) - Get the configuration of the switch. * - :py:obj:`load_data `\ (ID_DATASET, PATH_DATA) - Load data as a :class:`pandas.DataFrame` object. .. rubric:: Attributes .. py:attribute:: ct_factors :type: container.Container[ConsumptionTaxFactor] | None :value: None A :obj:`Container` with :class:`ConsumptionTaxFactor` objects. .. py:attribute:: datasets :type: container.Container[Dataset] | None :value: None A :obj:`Container` with :class:`Dataset` objects. .. py:attribute:: extensions :type: container.Container[Extension] | None :value: None A :obj:`Container` with :class:`Extension` objects. These are the local + model extensions defined. .. py:attribute:: local_extensions :type: container.Container[Extension] | None :value: None A :obj:`Container` with :class:`Extension` objects. These are the local extensions defined for the country. .. py:attribute:: model :type: Model ":class:`Model` Returns the base :class:`Model` object. .. py:attribute:: name :type: str Two-letters country code. .. py:attribute:: policies :type: container.Container[Policy] | None :value: None A :obj:`Container` with :class:`Policy` objects. .. py:attribute:: systems :type: container.Container[System] | None :value: None A :obj:`Container` with :class:`System` objects. .. py:attribute:: upratefactors :type: container.Container[UprateFactor] | None :value: None A :obj:`Container` with :class:`UprateFactor` objects. .. rubric:: Methods .. py:method:: get_switch_value(ext_name: Optional[str] = None, dataset_name: Optional[str] = None, sys_name: Optional[str] = None) Get the configuration of the switch. :param ext_name: Name of the extension. The default is None. :type ext_name: :obj:`str` , optional :param dataset_name: Name of the dataset. The default is None. :type dataset_name: :obj:`str` , optional :param sys_name: Name of the system. The default is None. :type sys_name: :obj:`str`, optional :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. :rtype: Container[ExtensionSwitch] .. py:method:: load_data(ID_DATASET, PATH_DATA=None) Load data as a :class:`pandas.DataFrame` object. :param ID_DATASET: Name of the dataset excluding extension (Note: must be a `txt` file). :type ID_DATASET: :obj:`str` :param PATH_DATA: Path to the dataset. Default is the folder "PATH_TO_EUROMOD_PROJECT/Input". :type PATH_DATA: :obj:`str`, optional :returns: Dataset is returned as a :class:`pandas.DataFrame` object. :rtype: pandas.DataFrame .. py:class:: 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. :rtype: Dataset .. rubric:: Overview .. list-table:: Attributes :header-rows: 0 :widths: auto :class: summarytable * - :py:obj:`ID ` - Dataset identifier number. * - :py:obj:`coicopVersion ` - COICOP version. * - :py:obj:`comment ` - Comment about the dataset. * - :py:obj:`currency ` - Currency of the monetary values in the dataset. * - :py:obj:`decimalSign ` - Decimal sign * - :py:obj:`name ` - Name of the dataset. * - :py:obj:`parent ` - The country-specific class. * - :py:obj:`private ` - Access type. * - :py:obj:`readXVariables ` - Read variables. * - :py:obj:`system_elements ` - \- * - :py:obj:`useCommonDefault ` - Use default. * - :py:obj:`yearCollection ` - Year of the dataset collection. * - :py:obj:`yearInc ` - Reference year for the income variables. .. rubric:: Attributes .. py:attribute:: ID :type: str Dataset identifier number. .. py:attribute:: coicopVersion :type: str :value: '' COICOP version. .. py:attribute:: comment :type: str :value: '' Comment about the dataset. .. py:attribute:: currency :type: str :value: '' Currency of the monetary values in the dataset. .. py:attribute:: decimalSign :type: str :value: '' Decimal sign .. py:attribute:: name :type: str Name of the dataset. .. py:attribute:: parent :type: Country The country-specific class. .. py:attribute:: private :type: str :value: 'no' Access type. .. py:attribute:: readXVariables :type: str :value: 'no' Read variables. .. py:attribute:: system_elements :type: container.Container .. py:attribute:: useCommonDefault :type: str :value: 'no' Use default. .. py:attribute:: yearCollection :type: str Year of the dataset collection. .. py:attribute:: yearInc :type: str Reference year for the income variables. .. py:class:: DatasetInSystem Datasets available in a system model. :returns: A class with the system-specific dataset. :rtype: DatasetInSystem .. rubric:: Overview .. list-table:: Attributes :header-rows: 0 :widths: auto :class: summarytable * - :py:obj:`ID ` - Dataset identifier number. * - :py:obj:`bestMatch ` - If yes, the current dataset is a best match for the specific system. * - :py:obj:`coicopVersion ` - COICOP version. * - :py:obj:`comment ` - Comment about the dataset. * - :py:obj:`currency ` - Currency of the monetary values in the dataset. * - :py:obj:`dataID ` - Identifier number of the reference dataset at the country level. * - :py:obj:`decimalSign ` - Decimal sign * - :py:obj:`name ` - Name of the dataset. * - :py:obj:`parent ` - The country specific class. * - :py:obj:`private ` - Access type. * - :py:obj:`readXVariables ` - Read variables. * - :py:obj:`sysID ` - Identifier number of the reference system. * - :py:obj:`useCommonDefault ` - Use default. * - :py:obj:`yearCollection ` - Year of the dataset collection. * - :py:obj:`yearInc ` - Reference year for the income variables. .. rubric:: Attributes .. py:attribute:: ID :type: str Dataset identifier number. .. py:attribute:: bestMatch :type: str If yes, the current dataset is a best match for the specific system. .. py:attribute:: coicopVersion :type: str COICOP version. .. py:attribute:: comment :type: str Comment about the dataset. .. py:attribute:: currency :type: str Currency of the monetary values in the dataset. .. py:attribute:: dataID :type: str Identifier number of the reference dataset at the country level. .. py:attribute:: decimalSign :type: str Decimal sign .. py:attribute:: name :type: str Name of the dataset. .. py:attribute:: parent :type: Country The country specific class. .. py:attribute:: private :type: str Access type. .. py:attribute:: readXVariables :type: str Read variables. .. py:attribute:: sysID :type: str Identifier number of the reference system. .. py:attribute:: useCommonDefault :type: str Use default. .. py:attribute:: yearCollection :type: str Year of the dataset collection. .. py:attribute:: yearInc :type: str Reference year for the income variables. .. py:class:: Extension(*arg) EUROMOD extensions. :returns: A class with the model extensions. :rtype: Extension .. rubric:: Overview .. list-table:: Attributes :header-rows: 0 :widths: auto :class: summarytable * - :py:obj:`name ` - Long name of the extension. * - :py:obj:`parent ` - The model base class. * - :py:obj:`shortName ` - Short name of the extension. .. rubric:: Attributes .. py:attribute:: name :type: str :value: None Long name of the extension. .. py:attribute:: parent :type: Model The model base class. .. py:attribute:: shortName :type: str :value: None Short name of the extension. .. py:class:: ExtensionSwitch(info, ctry) A class containing the extension switches of an object. This class is returned by :func:`~Country.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. :rtype: ExtensionSwitch .. rubric:: Overview .. list-table:: Attributes :header-rows: 0 :widths: auto :class: summarytable * - :py:obj:`data_name ` - Name of the applicable dataset. * - :py:obj:`extension_name ` - Short name of the extension. * - :py:obj:`parent ` - The country-specific class. * - :py:obj:`sys_name ` - Name of the applicable system. * - :py:obj:`value ` - Value of the switch as configured in EUROOMOD. .. rubric:: Attributes .. py:attribute:: data_name :type: str Name of the applicable dataset. .. py:attribute:: extension_name :type: str Short name of the extension. .. py:attribute:: parent :type: Country The country-specific class. .. py:attribute:: sys_name :type: str Name of the applicable system. .. py:attribute:: value :type: str :value: '' Value of the switch as configured in EUROOMOD. .. py:class:: Function(*arg) Functions implemented in a country policy. :returns: A class with country-specific function. :rtype: Function .. rubric:: Overview .. list-table:: Attributes :header-rows: 0 :widths: auto :class: summarytable * - :py:obj:`ID ` - Identifier number of the function. * - :py:obj:`comment ` - Comment specific to the function. * - :py:obj:`extensions ` - A :obj:`Container` of :class:`Extension` objects in a country. * - :py:obj:`name ` - Name of the function. * - :py:obj:`order ` - Order of the function in the specific spine. * - :py:obj:`parameters ` - A :obj:`Container` of :class:`Parameter` objects in a country. * - :py:obj:`parent ` - The class of the country-specific policy. * - :py:obj:`polID ` - Identifier number of the reference policy. * - :py:obj:`private ` - Access type. * - :py:obj:`spineOrder ` - Order of the function in the spine. .. rubric:: Attributes .. py:attribute:: ID :type: str Identifier number of the function. .. py:attribute:: comment :type: str Comment specific to the function. .. py:attribute:: extensions :type: container.Container[Extension] | None :value: None A :obj:`Container` of :class:`Extension` objects in a country. .. py:attribute:: name :type: str Name of the function. .. py:attribute:: order :type: str Order of the function in the specific spine. .. py:attribute:: parameters :type: container.Container[Parameter] | None :value: None A :obj:`Container` of :class:`Parameter` objects in a country. .. py:attribute:: parent :type: Policy The class of the country-specific policy. .. py:attribute:: polID :type: str Identifier number of the reference policy. .. py:attribute:: private :type: str Access type. .. py:attribute:: spineOrder :type: str Order of the function in the spine. .. py:class:: FunctionInSystem(*arg) Functions implemented in a policy for a specific system. :returns: A class with the system-specific function. :rtype: FunctionInSystem .. rubric:: Overview .. list-table:: Attributes :header-rows: 0 :widths: auto :class: summarytable * - :py:obj:`ID ` - Identifier number of the function. * - :py:obj:`comment ` - Comment specific to the function. * - :py:obj:`extensions ` - A :obj:`Container` of :class:`Extension` objects in a system. * - :py:obj:`funID ` - Identifier number of the reference function at country level. * - :py:obj:`name ` - Name of the function. * - :py:obj:`order ` - Order of the function in the specific spine. * - :py:obj:`parameters ` - A :obj:`Container` with :class:`ParameterInSystem` objects specific to a function. * - :py:obj:`parent ` - The class of the country-specific policy. * - :py:obj:`polID ` - Identifier number of the reference policy. * - :py:obj:`private ` - Access type. * - :py:obj:`spineOrder ` - Order of the function in the spine. * - :py:obj:`switch ` - Policy switch action. * - :py:obj:`sysID ` - Identifier number of the reference policy. .. rubric:: Attributes .. py:attribute:: ID :type: str Identifier number of the function. .. py:attribute:: comment :type: str Comment specific to the function. .. py:attribute:: extensions :type: container.Container[Extension] A :obj:`Container` of :class:`Extension` objects in a system. .. py:attribute:: funID :type: str Identifier number of the reference function at country level. .. py:attribute:: name :type: str Name of the function. .. py:attribute:: order :type: str Order of the function in the specific spine. .. py:attribute:: parameters :type: container.Container[ParameterInSystem] | None :value: None A :obj:`Container` with :class:`ParameterInSystem` objects specific to a function. .. py:attribute:: parent :type: Policy The class of the country-specific policy. .. py:attribute:: polID :type: str Identifier number of the reference policy. .. py:attribute:: private :type: str Access type. .. py:attribute:: spineOrder :type: str Order of the function in the spine. .. py:attribute:: switch :type: str Policy switch action. .. py:attribute:: sysID :type: str Identifier number of the reference policy. .. py:class:: IndTaxInfoContainer Container class storing Country objects. .. py:class:: Model(model_path: str) Base class of the Euromod Connector instantiating the microsimulation model EUROMOD. :param model_path: Path to the EUROMOD project. :type model_path: :obj:`str` :returns: A class containing the EUROMOD base model. :rtype: Model .. rubric:: Example >>> from euromod import Model >>> mod=Model("C:\EUROMOD_RELEASES_I6.0+") .. _Documentation: https://github.com/euromod/PythonIntegration/HOWTO.pdf .. rubric:: Overview .. list-table:: Attributes :header-rows: 0 :widths: auto :class: summarytable * - :py:obj:`countries ` - A :class:`Container` with :class:`Country` objects. * - :py:obj:`extensions ` - A :class:`Container` with :class:`Model` extensions. * - :py:obj:`model_path ` - Path to the EUROMOD project. .. rubric:: Attributes .. py:attribute:: countries :type: container.Container[Country] A :class:`Container` with :class:`Country` objects. .. py:attribute:: extensions :type: container.Container[Extension] A :class:`Container` with :class:`Model` extensions. .. py:attribute:: model_path :type: str Path to the EUROMOD project. .. py:class:: Parameter(*arg) Parameters set up in a function. :returns: A class with country-specific parameter. :rtype: Parameter .. rubric:: Overview .. list-table:: Attributes :header-rows: 0 :widths: auto :class: summarytable * - :py:obj:`ID ` - Identifier number of the parameter. * - :py:obj:`comment ` - Comment specific to the parameter. * - :py:obj:`extensions ` - A :obj:`Container` with :class:`Extension` objects. * - :py:obj:`funID ` - Identifier number of the reference function at country level. * - :py:obj:`group ` - Parameter group value. * - :py:obj:`name ` - Name of the parameter. * - :py:obj:`order ` - Order of the parameter in the specific spine. * - :py:obj:`parent ` - The class of the country-specific function. * - :py:obj:`spineOrder ` - Order of the parameter in the spine. .. rubric:: Attributes .. py:attribute:: ID :type: str Identifier number of the parameter. .. py:attribute:: comment :type: str Comment specific to the parameter. .. py:attribute:: extensions :type: container.Container[Extension] | None :value: None A :obj:`Container` with :class:`Extension` objects. .. py:attribute:: funID :type: str Identifier number of the reference function at country level. .. py:attribute:: group :type: str :value: '' Parameter group value. :type: str .. py:attribute:: name :type: str Name of the parameter. .. py:attribute:: order :type: str Order of the parameter in the specific spine. .. py:attribute:: parent :type: Function The class of the country-specific function. .. py:attribute:: spineOrder :type: str Order of the parameter in the spine. .. py:class:: ParameterInSystem Parameters set up in a function for a specific system. :returns: A class with the system-specific function parameter. :rtype: ParameterInSystem .. rubric:: Overview .. list-table:: Attributes :header-rows: 0 :widths: auto :class: summarytable * - :py:obj:`ID ` - Identifier number of the parameter. * - :py:obj:`comment ` - Comment specific to the parameter. * - :py:obj:`extensions ` - A :obj:`Container` with :class:`Extension` objects. * - :py:obj:`funID ` - Identifier number of the reference function at country level. * - :py:obj:`group ` - Parameter group number. * - :py:obj:`name ` - Name of the parameter. * - :py:obj:`order ` - Order of the parameter in the specific spine. * - :py:obj:`parID ` - Identifier number of the reference parameter at country level. * - :py:obj:`parent ` - The class of the country-specific function. * - :py:obj:`spineOrder ` - Order of the parameter in the spine. * - :py:obj:`sysID ` - Identifier number of the reference system. * - :py:obj:`value ` - Value of the parameter. .. list-table:: Methods :header-rows: 0 :widths: auto :class: summarytable * - :py:obj:`evaluate `\ (var_dict) - \- .. rubric:: Attributes .. py:attribute:: ID :type: str Identifier number of the parameter. .. py:attribute:: comment :type: str Comment specific to the parameter. .. py:attribute:: extensions :type: container.Container A :obj:`Container` with :class:`Extension` objects. .. py:attribute:: funID :type: str Identifier number of the reference function at country level. .. py:attribute:: group :type: str Parameter group number. .. py:attribute:: name :type: str Name of the parameter. .. py:attribute:: order :type: str Order of the parameter in the specific spine. .. py:attribute:: parID :type: str Identifier number of the reference parameter at country level. .. py:attribute:: parent :type: Function The class of the country-specific function. .. py:attribute:: spineOrder :type: str Order of the parameter in the spine. .. py:attribute:: sysID :type: str Identifier number of the reference system. .. py:attribute:: value :type: str Value of the parameter. .. rubric:: Methods .. py:method:: evaluate(var_dict=dict()) .. py:class:: Policy(*arg) Policy rules modeled in a country. :returns: A class with the country-specific policies. :rtype: Policy .. rubric:: Overview .. list-table:: Attributes :header-rows: 0 :widths: auto :class: summarytable * - :py:obj:`ID ` - Identifier number of the policy. * - :py:obj:`comment ` - Comment specific to the policy. * - :py:obj:`extensions ` - A :obj:`Container` of policy-specific :class:`Extension` objects. * - :py:obj:`functions ` - A :obj:`Container` of policy-specific :class:`Function` objects. * - :py:obj:`name ` - Name of the policy. * - :py:obj:`order ` - Order of the policy in the specific spine. * - :py:obj:`parent ` - The country-specific class. * - :py:obj:`private ` - Access type. Default is 'no'. * - :py:obj:`spineOrder ` - Order of the policy in the spine. .. rubric:: Attributes .. py:attribute:: ID :type: str Identifier number of the policy. .. py:attribute:: comment :type: str Comment specific to the policy. .. py:attribute:: extensions :type: container.Container[Extension] | None :value: None A :obj:`Container` of policy-specific :class:`Extension` objects. .. py:attribute:: functions :type: container.Container[Function] | None :value: None A :obj:`Container` of policy-specific :class:`Function` objects. .. py:attribute:: name :type: str Name of the policy. .. py:attribute:: order :type: str Order of the policy in the specific spine. .. py:attribute:: parent :type: Country The country-specific class. .. py:attribute:: private :type: str :value: 'no' Access type. Default is 'no'. .. py:attribute:: spineOrder :type: str Order of the policy in the spine. .. py:class:: PolicyInSystem(*arg) Policy rules modeled in a system. :returns: A class with system-specific policies. :rtype: PolicyInSystem .. rubric:: Overview .. list-table:: Attributes :header-rows: 0 :widths: auto :class: summarytable * - :py:obj:`ID ` - Identifier number of the policy. * - :py:obj:`comment ` - Comment specific to the policy. * - :py:obj:`extensions ` - A :obj:`Container` of policy-specific :class:`Extension` objects. * - :py:obj:`functions ` - A :obj:`Container` with :class:`FunctionInSystem` objects specific to the system * - :py:obj:`name ` - Name of the policy. * - :py:obj:`order ` - Order of the policy in the specific spine. * - :py:obj:`parent ` - The country-specific class. * - :py:obj:`polID ` - Identifier number of the reference policy at country level. * - :py:obj:`private ` - Access type. Default is 'no'. * - :py:obj:`spineOrder ` - Order of the policy in the spine. * - :py:obj:`switch ` - Policy switch action. * - :py:obj:`sysID ` - Identifier number of the reference system. .. rubric:: Attributes .. py:attribute:: ID :type: str Identifier number of the policy. .. py:attribute:: comment :type: str Comment specific to the policy. .. py:attribute:: extensions :type: container.Container[Extension] A :obj:`Container` of policy-specific :class:`Extension` objects. .. py:attribute:: functions :type: container.Container[FunctionInSystem] | None :value: None A :obj:`Container` with :class:`FunctionInSystem` objects specific to the system .. py:attribute:: name :type: str Name of the policy. .. py:attribute:: order :type: str Order of the policy in the specific spine. .. py:attribute:: parent :type: Country The country-specific class. .. py:attribute:: polID :type: str Identifier number of the reference policy at country level. .. py:attribute:: private :type: str Access type. Default is 'no'. .. py:attribute:: spineOrder :type: str Order of the policy in the spine. .. py:attribute:: switch :type: str Policy switch action. .. py:attribute:: sysID :type: str Identifier number of the reference system. .. py:class:: ReferencePolicy(info, parent) Object storing the reference policies. :returns: A class with the country-specific reference policies. :rtype: ReferencePolicy .. rubric:: Overview .. list-table:: Attributes :header-rows: 0 :widths: auto :class: summarytable * - :py:obj:`extensions ` - A :obj:`Container` of reference policy-specific :class:`Extension` objects. * - :py:obj:`name ` - Name of the reference policy. * - :py:obj:`parent ` - The country-specific class. .. rubric:: Attributes .. py:attribute:: extensions :type: container.Container[Extension] | None :value: None A :obj:`Container` of reference policy-specific :class:`Extension` objects. .. py:attribute:: name :type: str Name of the reference policy. .. py:attribute:: parent :type: Country The country-specific class. .. py:class:: Simulation(out, constantsToOverwrite, polars) Object storing the simulation results. This is a class containing results from the simulation :func:`~System.run` and other related configuration information. :returns: A class with simulation output. :rtype: Simulation .. rubric:: Overview .. list-table:: Attributes :header-rows: 0 :widths: auto :class: summarytable * - :py:obj:`constantsToOverwrite ` - A :obj:`dict`-type object with user-defined constants. * - :py:obj:`errors ` - A :obj:`list` with errors and warnings from the simulation run. * - :py:obj:`output_filenames ` - A :obj:`list` of file-names of simulation output. * - :py:obj:`outputs ` - A :obj:`Container` with :class:`pandas.DataFrame`-type simulation results. .. rubric:: Attributes .. py:attribute:: constantsToOverwrite :type: dict[tuple(str, str), str] A :obj:`dict`-type object with user-defined constants. .. py:attribute:: errors :type: list[str] A :obj:`list` with errors and warnings from the simulation run. .. py:attribute:: output_filenames :type: list[str] | [] :value: [] A :obj:`list` of file-names of simulation output. .. py:attribute:: outputs :type: container.Container[pandas.DataFrame] A :obj:`Container` with :class:`pandas.DataFrame`-type simulation results. For indexing use an integer or a label from :obj:`output_filenames`. .. py:class:: 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 :obj:`Container` as attribute `systems` of the :class:`Country`. :returns: A class with country systems. :rtype: System .. rubric:: Example >>> from euromod import Model >>> mod=Model("C:\EUROMOD_RELEASES_I6.0+") >>> mod.countries[0].systems[-1] .. rubric:: Overview .. list-table:: Attributes :header-rows: 0 :widths: auto :class: summarytable * - :py:obj:`ID ` - Identifier number of the system. * - :py:obj:`bestmatch_datasets ` - A :obj:`Container` with best-match :class:`Dataset` objects in the system. * - :py:obj:`comment ` - Comment specific to the system. * - :py:obj:`currencyOutput ` - Currency of the simulation results. * - :py:obj:`currencyParam ` - Currency of the monetary parameters in the system. * - :py:obj:`datasets ` - A :obj:`Container` of :class:`DatasetInSystem` objects in the system. * - :py:obj:`headDefInc ` - Main income definition. * - :py:obj:`name ` - Name of the system. * - :py:obj:`order ` - System order in the spine. * - :py:obj:`parent ` - The country-specific class. * - :py:obj:`policies ` - A :obj:`Container` of :class:`PolicyInSystem` objects in the system. * - :py:obj:`private ` - Access type. * - :py:obj:`year ` - System year. .. list-table:: Methods :header-rows: 0 :widths: auto :class: summarytable * - :py:obj:`get_default_extensions `\ (dataset) - :param dataset: Name of Dataset. * - :py:obj:`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) - 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. .. rubric:: Attributes .. py:attribute:: ID :type: str Identifier number of the system. .. py:attribute:: bestmatch_datasets :type: container.Container[Dataset] | None :value: None A :obj:`Container` with best-match :class:`Dataset` objects in the system. .. py:attribute:: comment :type: str Comment specific to the system. .. py:attribute:: currencyOutput :type: str Currency of the simulation results. .. py:attribute:: currencyParam :type: str Currency of the monetary parameters in the system. .. py:attribute:: datasets :type: container.Container[DatasetInSystem] | None :value: None A :obj:`Container` of :class:`DatasetInSystem` objects in the system. .. py:attribute:: headDefInc :type: str Main income definition. .. py:attribute:: name :type: str Name of the system. .. py:attribute:: order :type: str System order in the spine. .. py:attribute:: parent :type: Country The country-specific class. .. py:attribute:: policies :type: container.Container[PolicyInSystem] | None :value: None A :obj:`Container` of :class:`PolicyInSystem` objects in the system. .. py:attribute:: private :type: str Access type. .. py:attribute:: year :type: str System year. .. rubric:: Methods .. py:method:: get_default_extensions(dataset) :param dataset: Name of Dataset. :type dataset: str :returns: **extensions** -- key is name of the extension, value, is boolean indicating true for on, false for off :rtype: dict[bool,str] .. py:method:: run(data: pandas.DataFrame, dataset_id: str, constantsToOverwrite: Optional[Dict[Tuple[str, str], str]] = None, verbose: bool = True, outputpath: str = '', addons: List[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) -> 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. :param data: input dataframe passed to the EUROMOD model. :type data: :class:`pandas.DataFrame` :param dataset_id: ID of the dataset. :type dataset_id: :obj:`str` :param constantsToOverwrite: A :obj:`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 :obj:`None`. :type constantsToOverwrite: :obj:`dict` [ :obj:`tuple` [ :obj:`str`, :obj:`str` ], :obj:`str` ], optional :param verbose: If True then information on the output will be printed. Default is :obj:`True`. :type verbose: :obj:`bool`, optional :param outputpath: When the output path is provided, there will be anoutput file generated. Default is "". :type outputpath: :obj:`str`, optional :param addons: List of tuples with addons to be integrated in the spine. The first element of the tuple is the name of the addon and the second element is the name of the system in the Addon to be integrated. Default is []. :type addons: :obj:`list` [ :obj:`tuple` [ :obj:`str`, :obj:`str` ]], optional :param switches: 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 []. :type switches: :obj:`list` [ :obj:`tuple` [ :obj:`str`, :obj:`bool` ]], optional :param nowarnings: If True, the warning messages resulting from the simulations will be suppressed. Default is :obj:`False`. :type nowarnings: :obj:`bool`, optional :param euro: If True, the monetary variables will be converted to euro for the simulation. Default value is :obj:`False`. :type euro: :obj:`bool`, optional :param public_compoments_only: If True, the the model will be on with only the public compoments. Default value is :obj:`False`. :type public_compoments_only: :obj:`bool`, optional :param nowarnings: If True then warnings returned by the model do not get printed. The default is False. :type nowarnings: bool, optional :param requested_vars: Variables requested in a new separate output. The default is []. :type requested_vars: List[str], optional :param requested_incomelists: Income lists requested in a new separate output. The default is []. :type requested_incomelists: List[str], optional :param requested_vargroups: Vargroups requested in a new separate output. The default is []. :type requested_vargroups: List[str], optional :param requested_ilgroups: ilgroups requested in a new separate output. The default is []. :type requested_ilgroups: List[str], optional :param suppress_other_output: If True and custom output is specified then DefOutput from the model get suppressed. The default is False. :type suppress_other_output: bool, optional :raises Exception: Exception when simulation does not finish succesfully, i.e. without errors. :returns: A class containing simulation output and error messages. :rtype: Simulation .. rubric:: 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') .. py:class:: UprateFactor(*args) .. rubric:: Overview .. list-table:: Attributes :header-rows: 0 :widths: auto :class: summarytable * - :py:obj:`ID ` - Identifier UprateFactor * - :py:obj:`comment ` - Comment of uprating factor * - :py:obj:`description ` - Description of uprating factor * - :py:obj:`name ` - Name of uprating factor * - :py:obj:`parent ` - \- * - :py:obj:`values ` - Container of the uprating values for the respective years .. rubric:: Attributes .. py:attribute:: ID :type: str Identifier UprateFactor .. py:attribute:: comment :type: str Comment of uprating factor .. py:attribute:: description :type: str Description of uprating factor .. py:attribute:: name :type: str Name of uprating factor .. py:attribute:: parent :type: Country .. py:attribute:: values :type: UprateFactorYearsContainer Container of the uprating values for the respective years .. py:class:: UprateFactorYear(*args) .. rubric:: Overview .. list-table:: Attributes :header-rows: 0 :widths: auto :class: summarytable * - :py:obj:`ID ` - Identifier UprateFactor * - :py:obj:`parent ` - \- * - :py:obj:`value ` - Value of uprating factor * - :py:obj:`year ` - Year of uprating factor .. rubric:: Attributes .. py:attribute:: ID :type: str Identifier UprateFactor .. py:attribute:: parent :type: UprateFactor .. py:attribute:: value :type: str Value of uprating factor .. py:attribute:: year :type: str Year of uprating factor .. py:class:: UprateFactorYearsContainer Container class storing Country objects.