def __init__(self, building, standard, location, year, carbon, deflator, marr=None): self.master = self self.building = building self.location = location self.standard = standard self.year = year if isinstance(year, Quantity) else Quantity( year, 'years') self.data = EnergyPlusData.objects.get(building=building, location=location, standard=standard) self.deflator = float(deflator) self.marr = float(marr or deflator) try: self.set = ResultSet.objects.get(deflator=Decimal(str(deflator)), marr=Decimal(marr or str(deflator))) except ResultSet.DoesNotExist: self.set = None self.components = ComponentCostList(self) self.assemblies = AssemblyCostList(self) self.energy = EnergyCost(self) self.mrr = MRR(self) self.base_residual = BaseResidual(self) self.residual = ResidualValue(self) self.energy_efficiency = EnergyEfficiencyCost(self) self.first = FirstCost(self) self.future = FutureCost(self) self.investment = InvestmentCost(self) self.lifecycle = LifeCycleCost(self) self.emissions = Emissions(self, carbon)