Пример #1
0
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import numpy
import matplotlib
import matplotlib.patheffects as patheffects

from a_model.datascope import Datascope
from a_model.argparsers import SimulationParser

# parse command line arguments
parser = SimulationParser(description=__doc__)
args = parser.parse_args()

# instantiate datascope
datascope = Datascope()

# get past year's worth of cash in bank
historical_cash_in_bank = datascope.balance_sheet.get_historical_cash_in_bank()

# simulate cashflow for the rest of the year
monthly_cash_outcomes = datascope.simulate_monthly_cash(
    n_months=args.n_months,
    n_universes=args.n_universes,
    verbose=args.verbose,
)

# transform the data in a convenient way for plotting
historical_t, historical_cash = zip(*historical_cash_in_bank)
max_cash = max(historical_cash)
monthly_t = [historical_t[-1]]
Пример #2
0
Also note how this affects the minimum hourly rate that we need to charge if we
are all working half-time.
"""

import argparse

from a_model.datascope import Datascope
from a_model.utils import currency_str

# parse command line arguments
parser = argparse.ArgumentParser(description=__doc__)
args = parser.parse_args()

# instantiate datascope
datascope = Datascope()

# calculate the financials from the information provided in config.ini
print "If we met the happiness goals we have, we would have the "
print "following outcomes..."
print ""
print "%40s%16s" % ("EBIT", '{:.2%}'.format(datascope.ebit()))
print "%40s%15s" % (
    "REVENUE PER PERSON",
    currency_str(datascope.revenue_per_person()),
)
print "%40s%15s" % (
    "MINIMUM HOURLY RATE",
    currency_str(datascope.minimum_hourly_rate()),
)
print ""
Пример #3
0
import datetime

import matplotlib.pyplot as plt
import matplotlib.dates as mdates

from a_model.datascope import Datascope
from a_model.argparsers import HiringParser
from a_model import utils
from a_model import decorators

# parse command line arguments
parser = HiringParser(description=__doc__)
args = parser.parse_args()

# instantiate datascope
datascope = Datascope()


# simulate finances in our current situation and by adding up to n_n00bs new
# datascopers
@decorators.read_or_run
def get_all_n00b_outcomes():
    all_n00b_outcomes = []
    for n00b in range(0, args.n_n00bs+1):
        if n00b > 0:
            datascope.add_person("n00b_%d" % n00b)
        monthly_cash_outputs = datascope.simulate_monthly_cash(
            n_months=args.n_months,
            n_universes=args.n_universes,
            verbose=args.verbose,
        )
Пример #4
0
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from matplotlib.ticker import FuncFormatter
import seaborn as sns
import pandas as pd

from a_model.datascope import Datascope
from a_model.argparsers import SimulationParser
from a_model import utils

# parse command line arguments
parser = SimulationParser(description=__doc__)
args = parser.parse_args()

# instantiate datascope
datascope = Datascope()

# simulate cashflow for the rest of the year
monthly_cash_outcomes = datascope.simulate_monthly_cash(
    n_months=args.n_months,
    n_universes=args.n_universes,
    verbose=args.verbose,
)

# slice the data to get the eoy cash
eoy = datetime.date(datetime.date.today().year, 12, 31)
months_until_eoy = datascope.profit_loss.get_months_from_now(eoy)
cash_buffer = datascope.n_months_buffer * datascope.costs()
person_bonuses = []
for monthly_cash in monthly_cash_outcomes:
    eoy_cash = monthly_cash[months_until_eoy]