# Path: pylink/tagged_attribute.py
# class TaggedAttribute(object):
#     """Simple container object to tag values with attributes.
# 
#     Feel free to initialize any node with a TA instead of its actual
#     value only and it will then have the desired metadata.  For example:
# 
#     from pylink import TaggedAttribute as TA
#     tx_power = TA(2,
#                   part_number='234x',
#                   test_report='http://reports.co/234x')
#     m = DAGModel([pylink.Transmitter(tx_power_at_pa_dbw=tx_power)])
#     """
# 
#     def __init__(self, value, **kwargs):
#         self.meta = kwargs
#         self.value = value


import pylink
from pylink import TaggedAttribute as TA



def _net_salary_usd_per_month(model):
    return (model.gross_salary_usd_per_month
            * (1.0 - model.tax_rate))


def _expenses_usd_per_month(model):
    return (model.rent_usd_per_month
            + model.food_usd_per_month
            + model.other_expenses_usd_per_month)


def _savings_usd_per_month(model):
    return model.net_salary_usd_per_month - model.expenses_usd_per_month


class GenericFinancialModel(object):

    def __init__(self,
                 gross_salary_usd_per_month=10e3,
                 rent_usd_per_month=3e3,
                 food_usd_per_month=500,
                 other_expenses_usd_per_month=1e3,
                 tax_rate=0.4):
        self.tribute = {
            # calculators
            'net_salary_usd_per_month': _net_salary_usd_per_month,
            'expenses_usd_per_month': _expenses_usd_per_month,

# Path: pylink/tagged_attribute.py
# class TaggedAttribute(object):
#     """Simple container object to tag values with attributes.
# 
#     Feel free to initialize any node with a TA instead of its actual
#     value only and it will then have the desired metadata.  For example:
# 
#     from pylink import TaggedAttribute as TA
#     tx_power = TA(2,
#                   part_number='234x',
#                   test_report='http://reports.co/234x')
#     m = DAGModel([pylink.Transmitter(tx_power_at_pa_dbw=tx_power)])
#     """
# 
#     def __init__(self, value, **kwargs):
#         self.meta = kwargs
#         self.value = value


# Path: examples/midlife_crisis.py
import pylink
from pylink import TaggedAttribute as TA




def _net_salary_usd_per_month(model):
    return (model.gross_salary_usd_per_month
            * (1.0 - model.tax_rate))


def _expenses_usd_per_month(model):
    return (model.rent_usd_per_month
            + model.food_usd_per_month
            + model.other_expenses_usd_per_month)


def _savings_usd_per_month(model):
    return model.net_salary_usd_per_month - model.expenses_usd_per_month


class GenericFinancialModel(object):

    def __init__(self,
                 gross_salary_usd_per_month=10e3,
                 rent_usd_per_month=3e3,
                 food_usd_per_month=500,
                 other_expenses_usd_per_month=1e3,
                 tax_rate=0.4):
        self.tribute = {
            # calculators
            'net_salary_usd_per_month': _net_salary_usd_per_month,
            'expenses_usd_per_month': _expenses_usd_per_month,

            'savings_usd_per_month': _savings_usd_per_month,