Exemple #1
0
    def __init__(self, parent=None, period=None):
        self.id = ID()  # does not get its own bbid, just holds namespace

        # parent for Financials is BusinessUnit
        self.relationships = Relationships(self, parent=parent)

        self._period = period
        self._restricted = False
        self._full_order = self.DEFAULT_ORDER.copy()

        statements = [Statement(name=self.OVERVIEW_NAME, parent=self, 
                                period=period),
                      Statement(name=self.INCOME_NAME, parent=self, 
                                period=period),
                      CashFlow(name=self.CASH_NAME, parent=self, 
                               period=period),
                      Statement(name=self.VALUATION_NAME, parent=self, 
                                period=period, compute=False),
                      BalanceSheet(name=self.START_BAL_NAME, parent=self, 
                                   period=period),
                      BalanceSheet(name=self.ENDING_BAL_NAME, parent=self, 
                                   period=period)]

        self._statement_directory = dict()
        for stmt in statements:
            self._statement_directory[stmt.name.casefold()] = stmt

        self.update_statements = list()
Exemple #2
0
    def __init__(self, start_date, end_date, parent=None, **kargs):
        # TimePeriodBase.__init__(self, start_date, end_date, model=model)
        TagsMixIn.__init__(self)

        self.start = start_date
        self.end = end_date

        self.financials = dict()

        self.id = ID()
        self.relationships = Relationships(self)
        self.relationships.set_parent(parent)

        self.past_end = None
        self.next_end = None

        self.parameters = Parameters()
        self.unit_parameters = Parameters()

        self._line_item_storage = dict()
        # {"value": value of any primitive type,
        #  "xl_data": flat LineData object without styles info,
        #  "hardcoded": bool}

        self.complete = True
        self.periods_used = 1
Exemple #3
0
    def __init__(self, name=None, value=None, parent=None, period=None):
        BaseFinancialsComponent.__init__(self,
                                         name=name,
                                         parent=parent,
                                         period=period)

        self._local_value = None

        self.guide = Guide(priority=3, quality=1)
        self.log = []
        self.position = None

        # summary_type determines how the line is summarized
        self.summary_type = 'sum'

        # summary_count is used for summary_type == 'average'
        self.summary_count = 0

        self._consolidate = True
        self._replica = False
        self._hardcoded = False
        self._include_details = True
        self._sum_details = True
        self.id = ID()
        self._driver_id = None

        if value is not None:
            self.set_value(value, self.SIGNATURE_FOR_CREATION)

        self.workspace = dict()
        self.usage = LineItemUsage()
        self.xl_data = xl_mgmt.LineData(self)
        self.xl_format = xl_mgmt.LineFormat()
Exemple #4
0
    def __init__(self, name, fins=None, model=None):
        TagsMixIn.__init__(self, name)

        self._parameters = Parameters()
        self._type = None
        self.id = ID()
        self.life = LifeCycle()
        self.location = None
        self.size = 1
        self.xl = xl_mgmt.UnitData()

        self.components = None
        self._set_components()  # Only used in copy()

        self.relationships = Relationships(self, model=model)

        # financials must follow relationships in __init__ because we set the
        # period on financials, an the period is retrieved from model, which
        # is stored on relationships.
        self.financials = None
        self.set_financials(fins)

        # Attributes related to Path
        self._stage = None
        self.used = set()
        self.guide = Guide()
        self.interview = InterviewTracker()
        self.summary = None
        self.valuation = None

        # for monitoring, temporary storage for existing path and used sets
        self._path_archive = list()
        self._used_archive = list()

        self.cap_table = CapTable()
Exemple #5
0
    def __init__(self, model):
        self.model = model
        self.bu_directory = dict()
        self.ty_directory = dict()

        self.id = ID()
        self.id.set_namespace(model.id.bbid)
        self.id.assign(seed='taxonomy directory')
Exemple #6
0
    def __init__(self,
                 name=None,
                 priority=DEFAULT_PRIORITY_LEVEL,
                 quality=DEFAULT_QUALITY_REQUIREMENT):
        PrintAsLine.__init__(self)
        TagsMixIn.__init__(self, name)

        self.guide = Guide(priority, quality)
        self.relationships = Relationships(self)
        self.id = ID()
Exemple #7
0
    def __init__(self, name=None, spacing=100, parent=None, period=None):
        TagsMixIn.__init__(self, name)

        self._consolidated = False
        self._details = dict()
        self.relationships = Relationships(self, parent=parent)
        self.POSITION_SPACING = max(1, int(spacing))
        self.id = ID()  # does not get its own bbid, just holds namespace
        self._restricted = False  # whether user can modify structure,
        self._period = period
Exemple #8
0
    def __init__(self, name=None):
        TagsMixIn.__init__(self, name=name)

        self.conversion_table = dict()
        self.formula_bbid = None
        self.id = ID()
        self.parameters = Parameters()
        self.run_on_past = False
        # OBSOLETE
        self.workConditions = dict()
        self.active = True
Exemple #9
0
    def __init__(self, name):
        if not name:
            name = bb_settings.DEFAULT_MODEL_NAME

        TagsMixIn.__init__(self, name)

        # read-only attributes
        self._company = None
        self._fiscal_year_end = None
        self._processing_status = 'intake'
        self._ref_date = None
        self._started = False

        # container for holding Drivers
        self.drivers = DriverContainer()

        # set and assign unique ID - models carry uuids in the origin namespace
        self.id = ID()
        self.id.assign(name)

        # set up Portal data, this is used primarily by Wrapper
        self.portal_data = dict()
        self.portal_data['industry'] = None
        self.portal_data['summary'] = None
        self.portal_data['business_name'] = None
        self.portal_data['business_id'] = 99999999
        self.portal_data['user_context'] = None
        self.portal_data['tags'] = None
        self.portal_data['update_count'] = 0
        self.portal_data['monitoring'] = False

        self.report_summary = None

        self.taxo_dir = TaxoDir(model=self)
        self.taxonomy = Taxonomy(self.taxo_dir)

        self.timelines = dict()
        timeline = TimeLine(self)
        self.set_timeline(timeline)

        # business units
        self.target = None
        self.bu_directory = dict()
        self.ty_directory = dict()

        # scenarios parameters
        self.scenarios = dict()
        for s in DEFAULT_SCENARIOS:
            self.scenarios[s] = dict()

        self.transcript = list()
        self.topic_list = list()
Exemple #10
0
    def __init__(self,
                 model,
                 resolution='monthly',
                 name='default',
                 interval=1):
        dict.__init__(self)
        self.id = ID()
        # Timeline objects support the id interface and pass the model's id
        # down to time periods. The Timeline instance itself does not get
        # its own bbid.

        self.model = model
        self.resolution = resolution
        self.name = name
        self.interval = interval
        self.master = None
        self.parameters = Parameters()
        self.has_been_extrapolated = False
        self.ref_date = None

        self.id.set_namespace(model.id.bbid)
Exemple #11
0
    def copy(self, clean=False):
        """


        Financials.copy() -> Financials


        Return a deep copy of instance.

        Method starts with a shallow copy and then substitutes deep copies
        for the values of each attribute in instance.ORDER
        """
        new_instance = Financials()
        new_instance._full_order = self._full_order.copy()

        for key, stmt in self._statement_directory.items():
            new_statement = stmt.copy(clean=clean)
            new_statement.relationships.set_parent(new_instance)
            new_instance._statement_directory[key] = new_statement

        new_instance.id = ID()
        new_instance.register(self.id.namespace)

        return new_instance
Exemple #12
0
 def __init__(self):
     self.id = ID()
     self.directory = dict()
     self.by_name = dict()
Exemple #13
0
 def __init__(self, name=None):
     TagsMixIn.__init__(self, name=name)
     self.func = None
     self.id = ID()
     self.source = None