def check_area_ytp(pickle_name): data = load(pickle_name) n_years = 15 house_cost = data.loc[0].value appreciation = 3.0 n_months = n_years * 12 dates = pd.date_range(data.loc[0].date, periods=n_months, freq="M") rent = Revenue("rent", "monthly payment", 0.011 * house_cost) # costs utilities = Cost("utilities", "hvac", 150) insurance = Cost("insurance", "full coverage", 100) property_tax = Cost("insurance", "full coverage", (house_cost * 0.019) / 12) mortgage = Mortgage(house_cost, 25000, dates, 3.0) # revenue revenues = [rent] costs = [utilities, insurance, property_tax] house = House(revenues, costs, mortgage, dates, appreciation) # house.summary() house.graph_net_profit() portfolio = Portfolio([house]) ytp = portfolio.get_years_to_positive(house) print("years till positive", ytp) exit(0) return ytp