コード例 #1
0
ファイル: energy.py プロジェクト: NIST860/relator
	def make(self, data, fuel):
		from relator.constants.models import Tariff, PriceIndex
		row = self.data.row
		year = row.period
		state = row.group.location.state
		deflator = float(row.group.database.deflator)
		enduses = row.group.simulation.fuel_enduses

		rate = Tariff.objects.get(fuel=self.fuel, state=state).tariff
		upv = PriceIndex.upv(self.fuel, state.census_region, year, deflator)

		self.use = enduses.get(fuel=self.fuel).total.into('kWh')
		self.cost = rate * upv * self.use
		self.save()
コード例 #2
0
    def make(self, data, fuel):
        from relator.constants.models import Tariff, PriceIndex
        row = self.data.row
        year = row.period
        state = row.group.location.state
        deflator = float(row.group.database.deflator)
        enduses = row.group.simulation.fuel_enduses

        rate = Tariff.objects.get(fuel=self.fuel, state=state).tariff
        upv = PriceIndex.upv(self.fuel, state.census_region, year, deflator)

        self.use = enduses.get(fuel=self.fuel).total.into('kWh')
        self.cost = rate * upv * self.use
        self.save()
コード例 #3
0
ファイル: energy.py プロジェクト: luzfcb/relator
	def upv(self):
		return PriceIndex.upv(self.fuel, self.master.census_region, self.year, self.deflator)