<commit_before># -*- coding: utf-8 -*-
"""This module coordinates the software components that make up the integration
framework.

"""
import logging
from collections import defaultdict

import networkx
import numpy as np
from enum import Enum
from smif import StateData
from smif.convert import SpaceTimeConvertor
from smif.convert.area import RegionRegister, RegionSet
from smif.convert.interval import TimeIntervalRegister
from smif.decision import Planning
from smif.intervention import Intervention, InterventionRegister
from smif.metadata import MetadataSet
from smif.sector_model import SectorModelBuilder

__author__ = "<NAME>, <NAME>"
__copyright__ = "<NAME>, <NAME>"
__license__ = "mit"


class SosModel(object):
    """Consists of the collection of timesteps and sector models

    This is NISMOD - i.e. the system of system model which brings all of the
    sector models together. Sector models may be joined through dependencies.

    This class is populated at runtime by the :class:`SosModelBuilder` and
    called from :func:`smif.cli.run_model`.

    Attributes
    ==========
    models : dict
        This is a dictionary of :class:`smif.SectorModel`
    initial_conditions : list
        List of interventions required to set up the initial system, with any
        state attributes provided here too

    """
    def __init__(self):
        # housekeeping
        self.logger = logging.getLogger(__name__)
        self.max_iterations = 25
        self.convergence_relative_tolerance = 1e-05
        self.convergence_absolute_tolerance = 1e-08

        # models
        self.models = {}
        self.dependency_graph = None

        # space and time
        self._timesteps = []
        self.regions = RegionRegister()
        self.intervals = TimeIntervalRegister()
        self._scenario_metadata = MetadataSet({})

        # systems, interventions and (system) state
        self.interventions = InterventionRegister()
        self.initial_conditions = []
        self.planning = Planning([])
        self._state = defaultdict(dict)

        # scenario data and results
        self._scenario_data = {}<commit_msg>Clarify SoSModel->SectorModel dict type in docstring docs<commit_after># -*- coding: utf-8 -*-
"""This module coordinates the software components that make up the integration
framework.

"""
import logging
from collections import defaultdict

import networkx
import numpy as np
from enum import Enum
from smif import StateData
from smif.convert import SpaceTimeConvertor
from smif.convert.area import RegionRegister, RegionSet
from smif.convert.interval import TimeIntervalRegister
from smif.decision import Planning
from smif.intervention import Intervention, InterventionRegister
from smif.metadata import MetadataSet
from smif.sector_model import SectorModelBuilder

__author__ = "<NAME>, <NAME>"
__copyright__ = "<NAME>, <NAME>"
__license__ = "mit"


class SosModel(object):
    """Consists of the collection of timesteps and sector models

    This is the system of systems model which brings all of the
    sector models together. Sector models may be joined through dependencies.

    This class is populated at runtime by the :class:`SosModelBuilder` and
    called from :func:`smif.cli.run_model`.

    Attributes
    ==========
    models : dict of :class:`smif.SectorModel`
        The coupled models that simulate the system of systems
    initial_conditions : list
        List of interventions required to set up the initial system, with any
        state attributes provided here too

    """
    def __init__(self):
        # housekeeping
        self.logger = logging.getLogger(__name__)
        self.max_iterations = 25
        self.convergence_relative_tolerance = 1e-05
        self.convergence_absolute_tolerance = 1e-08

        # models
        self.models = {}
        self.dependency_graph = None

        # space and time
        self._timesteps = []
        self.regions = RegionRegister()
        self.intervals = TimeIntervalRegister()
        self._scenario_metadata = MetadataSet({})

        # systems, interventions and (system) state
        self.interventions = InterventionRegister()
        self.initial_conditions = []
        self.planning = Planning([])
        self._state = defaultdict(dict)

        # scenario data and results
        self._scenario_data = {}
{'fraction_non_alphanumeric': 0.07440681870536743, 'fraction_numerical': 0.00414651002073255, 'mean_word_length': 3.244379276637341, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2310490', 'n_tokens_mistral': 1155, 'n_tokens_neox': 1088, 'n_words': 391}