Example #1
0
 def __init__(self, id, subsector_id, service_demand_unit, stock_time_unit, cost_of_capital, scenario=None, **kwargs):
     self.id = id
     self.subsector_id = subsector_id
     self.scenario = scenario
     StockItem.__init__(self)
     self.service_demand_unit = service_demand_unit
     self.stock_time_unit = stock_time_unit
     for col, att in util.object_att_from_table('DemandTechs', self.id):
         setattr(self, col, att)
     # if cost_of_capital at the technology level is None, it uses subsector defaults
     if self.cost_of_capital is None:
         self.cost_of_capital = cost_of_capital
     else:
         pass
     # we can have multiple sales shares because sales share may be specific
     # to the transition between two technolog)
     self.reference_sales_shares = {}
     if self.id in util.sql_read_table('DemandSalesData', 'demand_technology_id', return_unique=True, return_iterable=True):
         self.reference_sales_shares[1] = SalesShare(id=self.id, subsector_id=self.subsector_id, reference=True,
                                                     sql_id_table='DemandSales', sql_data_table='DemandSalesData',
                                                     primary_key='subsector_id', data_id_key='demand_technology_id',
                                                     scenario=scenario)
     self.book_life()
     self.add_class()
     self.min_year()
     if self.shape_id is not None:
         self.shape = shape.shapes.data[self.shape_id]
 def __init__(self, id, subsector_id, service_demand_unit, stock_time_unit, cost_of_capital, scenario=None, **kwargs):
     self.id = id
     self.subsector_id = subsector_id
     self.scenario = scenario
     StockItem.__init__(self)
     self.service_demand_unit = service_demand_unit
     self.stock_time_unit = stock_time_unit
     for col, att in util.object_att_from_table('DemandTechs', self.id):
         setattr(self, col, att)
     # if cost_of_capital at the technology level is None, it uses subsector defaults
     if self.cost_of_capital is None:
         self.cost_of_capital = cost_of_capital
     else:
         pass
     # we can have multiple sales shares because sales share may be specific
     # to the transition between two technolog)
     self.reference_sales_shares = {}
     if self.id in util.sql_read_table('DemandSalesData', 'demand_technology_id', return_unique=True, return_iterable=True):
         self.reference_sales_shares[1] = SalesShare(id=self.id, subsector_id=self.subsector_id, reference=True,
                                                     sql_id_table='DemandSales', sql_data_table='DemandSalesData',
                                                     primary_key='subsector_id', data_id_key='demand_technology_id',
                                                     scenario=scenario)
     self.book_life()
     self.add_class()
     self.min_year()
     self.shape = shape.shapes.data[self.shape_id] if self.shape_id is not None else None
 def __init__(self,
              name,
              service_demand_unit,
              stock_time_unit,
              cost_of_capital,
              scenario=None):
     schema.DemandTechs.__init__(self, name=name, scenario=scenario)
     self.init_from_db(name, scenario)
     StockItem.__init__(self)
     self.scenario = scenario
     self.service_demand_unit = service_demand_unit
     self.stock_time_unit = stock_time_unit
     # if cost_of_capital at the technology level is None, it uses subsector defaults
     self.cost_of_capital = self.cost_of_capital or cost_of_capital
     # we can have multiple sales shares because sales share may be specific
     # to the transition between two technologies
     self.reference_sales_shares = {}
     if self.name in util.csv_read_table('DemandSales',
                                         column_names='demand_technology',
                                         return_iterable=True):
         self.reference_sales_shares[1] = DemandSales(
             demand_technology=self.name, scenario=scenario)
     self.book_life()
     self.add_class()
     self.min_year()
 def __init__(self, name, cost_of_capital, scenario=None):
     self.name = name
     schema.DemandFuelSwitchingMeasures.__init__(self,
                                                 name,
                                                 scenario=scenario)
     self.init_from_db(name, scenario)
     StockItem.__init__(self)
     self.calculate_book_life()
     self.cost_of_capital = cost_of_capital
     self.impact = FuelSwitchingImpact(self.name)
     self.energy_intensity = FuelSwitchingEnergyIntensity(self.name)
     self.cost = FuelSwitchingMeasuresCost(self.name, self.cost_of_capital,
                                           self.book_life)
Example #5
0
 def __init__(self,
              id,
              drivers,
              sql_id_table='SupplyStock',
              sql_data_table='SupplyStockData',
              primary_key='node_id',
              **kwargs):
     Stock.__init__(self,
                    id,
                    drivers,
                    sql_id_table='SupplyStock',
                    sql_data_table='SupplyStockData',
                    primary_key='node_id',
                    **kwargs)
     StockItem.__init__(self)
Example #6
0
 def __init__(self, id, cost_of_capital, **kwargs):
     self.id = id
     for col, att in util.object_att_from_table('SupplyTechs', id):
         setattr(self, col, att)
     if self.cost_of_capital is None:
         self.cost_of_capital = cost_of_capital
     self.add_costs()
     self.efficiency = SupplyTechEfficiency(id)
     self.capacity_factor = SupplyTechCapacityFactor(id)
     self.reference_sales_shares = {}
     if self.id in util.sql_read_table('SupplySalesShareData', 'supply_technology', return_unique=True, return_iterable=True):
         self.reference_sales_shares[1] = SupplySalesShare(id=self.id, supply_node_id=self.supply_node_id, reference=True,sql_id_table='SupplySalesShare', sql_data_table='SupplySalesShareData')           
     self.reference_sales = {}
     if self.id in util.sql_read_table('SupplySalesData','supply_technology', return_unique=True, return_iterable=True):
         self.reference_sales[1] = SupplySales(id=self.id, supply_node_id=self.supply_node_id, reference=True,sql_id_table='SupplySales', sql_data_table='SupplySalesData') 
     StockItem.__init__(self)
 def __init__(self, name, cost_of_capital, scenario):
     schema.SupplyTechs.__init__(self, name=name, scenario=scenario)
     self.init_from_db(name, scenario)
     StockItem.__init__(self)
     if self.cost_of_capital is None:
         self.cost_of_capital = cost_of_capital
     self.scenario = scenario
     self.add_costs()
     self.efficiency = SupplyTechEfficiency(name, self.scenario)
     self.capacity_factor = SupplyTechCapacityFactor(name, self.scenario)
     self.co2_capture = SupplyTechCO2Capture(name, self.scenario)
     self.reference_sales_shares = {}
     if self.name in util.csv_read_table('SupplySalesShare', 'supply_technology', return_unique=True, return_iterable=True):
         self.reference_sales_shares[1] = SupplySalesShareObj(supply_technology=self.name, scenario=self.scenario)
     self.reference_sales = {}
     if self.name in util.csv_read_table('SupplySales', 'supply_technology', return_unique=True, return_iterable=True):
         self.reference_sales[1] = SupplySalesObj(supply_technology=self.name, scenario=self.scenario)
Example #8
0
    def __init__(self, id, cost_of_capital, scenario, **kwargs):
        self.id = id
        for col, att in util.object_att_from_table('SupplyTechs', id):
            setattr(self, col, att)
        if self.cost_of_capital is None:
            self.cost_of_capital = cost_of_capital
        self.scenario = scenario
        self.add_costs()
        self.efficiency = SupplyTechEfficiency(id, self.scenario)
        self.capacity_factor = SupplyTechCapacityFactor(id, self.scenario)
        self.co2_capture = SupplyTechCO2Capture(id, self.scenario)
        self.reference_sales_shares = {}
        if self.id in util.sql_read_table('SupplySalesShareData',
                                          'supply_technology_id',
                                          return_unique=True,
                                          return_iterable=True):
            self.reference_sales_shares[1] = SupplySalesShare(
                id=self.id,
                supply_node_id=self.supply_node_id,
                reference=True,
                sql_id_table='SupplySalesShare',
                sql_data_table='SupplySalesShareData',
                primary_key='supply_node_id',
                data_id_key='supply_technology_id',
                scenario=self.scenario)
        self.reference_sales = {}
        if self.id in util.sql_read_table('SupplySalesData',
                                          'supply_technology_id',
                                          return_unique=True,
                                          return_iterable=True):
            self.reference_sales[1] = SupplySales(
                id=self.id,
                supply_node_id=self.supply_node_id,
                reference=True,
                sql_id_table='SupplySales',
                sql_data_table='SupplySalesData',
                primary_key='supply_node_id',
                data_id_key='supply_technology_id',
                scenario=self.scenario)
        StockItem.__init__(self)

        if self.shape_id is not None:
            self.shape = shape.shapes.data[self.shape_id]
 def __init__(self, id, cost_of_capital, scenario, **kwargs):
     self.id = id
     for col, att in util.object_att_from_table('SupplyTechs', id):
         setattr(self, col, att)
     if self.cost_of_capital is None:
         self.cost_of_capital = cost_of_capital
     self.scenario = scenario
     self.add_costs()
     self.efficiency = SupplyTechEfficiency(id, self.scenario)
     self.capacity_factor = SupplyTechCapacityFactor(id, self.scenario)
     self.co2_capture = SupplyTechCO2Capture(id, self.scenario)
     self.reference_sales_shares = {}
     if self.id in util.sql_read_table('SupplySalesShareData', 'supply_technology_id', return_unique=True, return_iterable=True):
         self.reference_sales_shares[1] = SupplySalesShare(id=self.id, supply_node_id=self.supply_node_id, reference=True,sql_id_table='SupplySalesShare', sql_data_table='SupplySalesShareData', primary_key='supply_node_id', data_id_key='supply_technology_id', scenario=self.scenario)
     self.reference_sales = {}
     if self.id in util.sql_read_table('SupplySalesData','supply_technology_id', return_unique=True, return_iterable=True):
         self.reference_sales[1] = SupplySales(id=self.id, supply_node_id=self.supply_node_id, reference=True,sql_id_table='SupplySales', sql_data_table='SupplySalesData', primary_key='supply_node_id', data_id_key='supply_technology_id', scenario=self.scenario)
     StockItem.__init__(self)
     
     if self.shape_id is not None:
         self.shape = shape.shapes.data[self.shape_id]
 def __init__(self, id, drivers, sql_id_table='SupplyStock', sql_data_table='SupplyStockData',
              primary_key='node_id', **kwargs):
     Stock.__init__(self, id, drivers, sql_id_table='SupplyStock', sql_data_table='SupplyStockData',
                  primary_key='node_id', **kwargs)
     StockItem.__init__(self)
 def __init__(self):
     StockItem.__init__(self)
Example #12
0
 def __init__(self):
     StockItem.__init__(self)