modifying sanam catalog model

This commit is contained in:
Pilar Monsalvete 2023-09-28 10:35:11 -04:00
parent 12d20f2d7a
commit 286e5c190c
4 changed files with 17 additions and 35 deletions

View File

@ -6,7 +6,6 @@ Project Coder Sanam Dabirian sanam.dabirian@mail.concordia.ca
""" """
class Archetype: class Archetype:
""" """
Archetype class Archetype class
@ -14,14 +13,13 @@ class Archetype:
def __init__(self, archetype_id, def __init__(self, archetype_id,
name, name,
function, function,
climate_zone, stochastic_schedule climate_zone
): ):
self._id = archetype_id self._id = archetype_id
self._name = name self._name = name
self._function = function self._function = function
self._climate_zone = climate_zone self._climate_zone = climate_zone
self._stochastic_schedule self._clusters = clusters
@property @property
def id(self): def id(self):
@ -55,24 +53,13 @@ class Archetype:
""" """
return self._climate_zone return self._climate_zone
@property
def stchastic_schedule(self):
"""
Get stochastic schedules from the code
:return: schedule
"""
return self._stochastic_schedule
def to_dictionary(self): def to_dictionary(self):
"""Class content to dictionary""" """Class content to dictionary"""
_stochastic_schedule = [] _stochastic_schedule = []
for _stochastic_schedule in self.stochastic_schedule:
_stochastic_schedule.append(_stochastic_schedule.to_dictionary())
content = {'Archetype': {'id': self.id, content = {'Archetype': {'id': self.id,
'name': self.name, 'name': self.name,
'function': self.function, 'function': self.function,
'climate zone': self.climate_zone, 'climate zone': self.climate_zone
'stochastic_schedule': self.stochastic_schedule
} }
} }
return content return content

View File

@ -0,0 +1,14 @@
from hub.catalog_factories.data_models.usages.schedule import Schedule
class Cluster:
"""
Archetype class
"""
def __init__(self):
self._day_type = day_type
self._schedules = schedules
@property
def schedules(self) -> [Schedule]:
return self._schedules

View File

@ -1,19 +0,0 @@
"""
Stochastic_occupancy catalog stochastic schedules
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Concordia CERC group
Project Coder Sanam Dabirian sanam.dabirian@mail.concordia.ca
"""
class StochasticSchedules:
"""
Schedule class
"""
def __init__(self, schedule_type, values, data_type, time_step, time_range, day_types):
self._type = schedule_type
self._values = values
self._data_type = data_type
self._time_step = time_step
self._time_range = time_range
self._day_types = day_types