コード例 #1
0
def setup_registers(setup_region_data):
    """One-time setup: load all the fixture region and interval
    sets into the module-level registers.
    """
    regions = get_region_register()
    lsoa = RegionSet('LSOA', setup_region_data['features'])
    regions.register(lsoa)
    regions.register(regions_half_squares())
    regions.register(regions_single_half_square())
    regions.register(regions_half_triangles())
    regions.register(regions_rect())

    # register alt rect (same area)
    regions_rect_alt = copy(regions_rect())
    regions_rect_alt.name = 'rect_alt'
    regions.register(regions_rect_alt)

    intervals = get_interval_register()
    annual_data = [{'id': 1, 'start': 'P0Y', 'end': 'P1Y'}]
    intervals.register(IntervalSet('annual', annual_data))
    intervals.register(IntervalSet('months', months()))
    intervals.register(IntervalSet('seasons', seasons()))
    intervals.register(IntervalSet('hourly_day', twenty_four_hours()))
    intervals.register(IntervalSet('one_day', one_day()))
    intervals.register(IntervalSet('remap_months', remap_months()))
コード例 #2
0
ファイル: __init__.py プロジェクト: ludusi/smif
    def __init__(self, name):
        self.name = name
        self.description = ''
        self._inputs = MetadataSet([])
        self._outputs = MetadataSet([])
        self.deps = {}

        self._parameters = ParameterList()

        self.regions = get_region_register()
        self.intervals = get_interval_register()
        self.timesteps = []

        self.logger = getLogger(__name__)
コード例 #3
0
ファイル: modelrun.py プロジェクト: RoaldL/smif
    def __init__(self):

        self._name = ""
        self.description = ""
        self.sos_model = None
        self._model_horizon = []

        self.narratives = None
        self.strategies = None
        self.status = 'Empty'

        self.logger = getLogger(__name__)

        # space and time
        self.regions = get_region_register()
        self.intervals = get_interval_register()

        self.results = {}
コード例 #4
0
            VERBOSITY = len(arg) - 1
            break

if VERBOSITY is None:
    LOGGING_CONFIG['root']['level'] = logging.WARNING
elif VERBOSITY == 1:
    LOGGING_CONFIG['root']['level'] = logging.INFO
else:
    LOGGING_CONFIG['root']['level'] = logging.DEBUG

logging.config.dictConfig(LOGGING_CONFIG)
LOGGER = logging.getLogger(__name__)
LOGGER.debug('Debug logging enabled.')

REGIONS = get_region_register()
INTERVALS = get_interval_register()
UNITS = get_unit_register()


def setup_project_folder(args):
    """Creates folder structure in the target directory

    Parameters
    ----------
    args
    """
    _recursive_overwrite('smif', 'sample_project', args.directory)
    if args.directory == ".":
        dirname = "the current directory"
    else:
        dirname = args.directory
コード例 #5
0
    def __init__(self, name):
        self.scenario = ScenarioModel(name)
        self.logger = getLogger(__name__)

        self.region_register = get_region_register()
        self.interval_register = get_interval_register()
コード例 #6
0
 def __init__(self):
     self.logger = logging.getLogger(__name__)
     self.regions = get_region_register()
     self.intervals = get_interval_register()
コード例 #7
0
 def __init__(self, name, sector_model=None):
     self._sector_model_name = name
     self._sector_model = sector_model
     self.interval_register = get_interval_register()
     self.region_register = get_region_register()
     self.logger = logging.getLogger(__name__)
コード例 #8
0
ファイル: sos_model.py プロジェクト: RoaldL/smif
    def __init__(self, name='global'):
        self.sos_model = SosModel(name)
        self.region_register = get_region_register()
        self.interval_register = get_interval_register()

        self.logger = logging.getLogger(__name__)