-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Santi
committed
Jun 23, 2023
1 parent
e4116ba
commit 222aeb2
Showing
21 changed files
with
1,342 additions
and
1,828 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# GridCal | ||
# Copyright (C) 2022 Santiago Peñate Vera | ||
# | ||
# This program is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU Lesser General Public | ||
# License as published by the Free Software Foundation; either | ||
# version 3 of the License, or (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
# Lesser General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Lesser General Public License | ||
# along with this program; if not, write to the Free Software Foundation, | ||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
|
||
from GridCal.Engine.Core.Devices.Associations.generator_fuel import GeneratorFuel | ||
from GridCal.Engine.Core.Devices.Associations.generator_emission import GeneratorEmission | ||
from GridCal.Engine.Core.Devices.Associations.generator_technology import GeneratorTechnology |
73 changes: 73 additions & 0 deletions
73
src/GridCal/Engine/Core/Devices/Associations/generator_emission.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# GridCal | ||
# Copyright (C) 2022 Santiago Peñate Vera | ||
# | ||
# This program is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU Lesser General Public | ||
# License as published by the Free Software Foundation; either | ||
# version 3 of the License, or (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
# Lesser General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Lesser General Public License | ||
# along with this program; if not, write to the Free Software Foundation, | ||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
|
||
from typing import Union | ||
from GridCal.Engine.Core.Devices.editable_device import EditableDevice, DeviceType, GCProp | ||
from GridCal.Engine.Core.Devices import Generator, EmissionGas | ||
|
||
|
||
class GeneratorEmission(EditableDevice): | ||
|
||
def __init__(self, name='', | ||
code='', | ||
idtag=None, | ||
generator: Union[Generator, None] = None, | ||
emission: Union[EmissionGas, None] = None, | ||
rate: float = 0.0): | ||
""" | ||
:param name: | ||
:param idtag: | ||
""" | ||
EditableDevice.__init__(self, | ||
name=name, | ||
code=code, | ||
idtag=idtag, | ||
active=True, | ||
device_type=DeviceType.GeneratorEmissionAssociation, | ||
editable_headers={'idtag': GCProp('', str, 'Unique ID'), | ||
'generator': GCProp('', DeviceType.GeneratorDevice, 'Generator'), | ||
'emission': GCProp('', DeviceType.EmissionGasDevice, 'Emission'), | ||
'rate': GCProp('t/MWh', float, 'Emissions rate'), | ||
}, | ||
non_editable_attributes=['idtag'], | ||
properties_with_profile={}) | ||
|
||
self.generator = generator | ||
|
||
self.emission = emission | ||
|
||
self.rate = rate | ||
|
||
def get_properties_dict(self, version=3): | ||
data = {'id': self.idtag, | ||
'name': self.name, | ||
'code': self.code, | ||
'generator': self.generator, | ||
'emission': self.emission, | ||
'rate': self.rate | ||
} | ||
return data | ||
|
||
def get_profiles_dict(self, version=3): | ||
data = {'id': self.idtag} | ||
return data | ||
|
||
def get_units_dict(self, version=3): | ||
data = {} | ||
return data |
73 changes: 73 additions & 0 deletions
73
src/GridCal/Engine/Core/Devices/Associations/generator_fuel.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# GridCal | ||
# Copyright (C) 2022 Santiago Peñate Vera | ||
# | ||
# This program is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU Lesser General Public | ||
# License as published by the Free Software Foundation; either | ||
# version 3 of the License, or (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
# Lesser General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Lesser General Public License | ||
# along with this program; if not, write to the Free Software Foundation, | ||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
|
||
from typing import Union | ||
from GridCal.Engine.Core.Devices.editable_device import EditableDevice, DeviceType, GCProp | ||
from GridCal.Engine.Core.Devices import Generator, Fuel | ||
|
||
|
||
class GeneratorFuel(EditableDevice): | ||
|
||
def __init__(self, name='', | ||
code='', | ||
idtag=None, | ||
generator: Union[Generator, None] = None, | ||
fuel: Union[Fuel, None] = None, | ||
rate: float = 0.0): | ||
""" | ||
:param name: | ||
:param idtag: | ||
""" | ||
EditableDevice.__init__(self, | ||
name=name, | ||
code=code, | ||
idtag=idtag, | ||
active=True, | ||
device_type=DeviceType.GeneratorFuelAssociation, | ||
editable_headers={'idtag': GCProp('', str, 'Unique ID'), | ||
'generator': GCProp('', DeviceType.GeneratorDevice, 'Generator'), | ||
'fuel': GCProp('', DeviceType.FuelDevice, 'Fuel'), | ||
'rate': GCProp('t/MWh', float, 'Emissions rate'), | ||
}, | ||
non_editable_attributes=['idtag'], | ||
properties_with_profile={}) | ||
|
||
self.generator = generator | ||
|
||
self.fuel = fuel | ||
|
||
self.rate = rate | ||
|
||
def get_properties_dict(self, version=3): | ||
data = {'id': self.idtag, | ||
'name': self.name, | ||
'code': self.code, | ||
'generator': self.generator, | ||
'fuel': self.fuel, | ||
'rate': self.rate | ||
} | ||
return data | ||
|
||
def get_profiles_dict(self, version=3): | ||
data = {'id': self.idtag} | ||
return data | ||
|
||
def get_units_dict(self, version=3): | ||
data = {} | ||
return data |
74 changes: 74 additions & 0 deletions
74
src/GridCal/Engine/Core/Devices/Associations/generator_technology.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# GridCal | ||
# Copyright (C) 2022 Santiago Peñate Vera | ||
# | ||
# This program is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU Lesser General Public | ||
# License as published by the Free Software Foundation; either | ||
# version 3 of the License, or (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
# Lesser General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Lesser General Public License | ||
# along with this program; if not, write to the Free Software Foundation, | ||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
|
||
from typing import Union | ||
from GridCal.Engine.Core.Devices.editable_device import EditableDevice, DeviceType, GCProp | ||
from GridCal.Engine.Core.Devices import Generator, Technology | ||
|
||
|
||
class GeneratorTechnology(EditableDevice): | ||
|
||
def __init__(self, name='', | ||
code='', | ||
idtag=None, | ||
generator: Union[Generator, None] = None, | ||
technology: Union[Technology, None] = None, | ||
proportion: float = 1.0): | ||
""" | ||
:param name: | ||
:param idtag: | ||
:param device_type: | ||
""" | ||
EditableDevice.__init__(self, | ||
name=name, | ||
code=code, | ||
idtag=idtag, | ||
active=True, | ||
device_type=DeviceType.GeneratorTechnologyAssociation, | ||
editable_headers={'idtag': GCProp('', str, 'Unique ID'), | ||
'generator': GCProp('', DeviceType.GeneratorDevice, 'Generator'), | ||
'technology': GCProp('', DeviceType.Technology, 'Technology'), | ||
'proportion': GCProp('p.u.', float, 'Emissions rate'), | ||
}, | ||
non_editable_attributes=['idtag'], | ||
properties_with_profile={}) | ||
|
||
self.generator = generator | ||
|
||
self.technology = technology | ||
|
||
self.proportion = proportion | ||
|
||
def get_properties_dict(self, version=3): | ||
data = {'id': self.idtag, | ||
'name': self.name, | ||
'code': self.code, | ||
'generator': self.generator, | ||
'technology': self.technology, | ||
'proportion': self.proportion | ||
} | ||
return data | ||
|
||
def get_profiles_dict(self, version=3): | ||
data = {'id': self.idtag} | ||
return data | ||
|
||
def get_units_dict(self, version=3): | ||
data = {} | ||
return data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.