Exemplo n.º 1
0
    def clean_model_targets(self):
        start_row = 4
        end_row = self.schema(
            IntCell(find_row("INPUTS!A", "Model End Row", target="B")))
        raw_targets = self.schema_list(schema=self.MODEL_SCHEMA,
                                       start=start_row,
                                       end=end_row)

        # Add the end dates for each of the targets
        for target in raw_targets:
            start = target["start"]
            target["end"] = start + timedelta(days=7)

        # Fix up the total investment targets
        for raw_target in raw_targets:
            for category in ["acq", "ret"]:
                raw_target[f"target_{category}_investment"] = (
                    raw_target[f"target_{category}_expenses"]
                    ["demand_creation"] +
                    raw_target[f"target_{category}_expenses"]
                    ["leasing_enablement"] +
                    raw_target[f"target_{category}_expenses"]
                    ["market_intelligence"] +
                    raw_target[f"target_{category}_expenses"]
                    ["reputation_building"])

        # Drop the extraneous period.
        return raw_targets
Exemplo n.º 2
0
def find_overview(predicate):
    """Return a locator that scans column A of the overview sheet for header values."""
    return find_row("Overview!A", predicate, target="B")
Exemplo n.º 3
0
def find(predicate):
    return find_row("OUTPUT!A", predicate, target="B")
Exemplo n.º 4
0
def find_meta(predicate):
    """Return a locator that scans the META!A column for header values and returns contents of column B."""
    return find_row("META!A", predicate, target="B")
Exemplo n.º 5
0
 def locate_overview_header_cell(self, predicate):
     predicate = predicate if callable(predicate) else matchp(
         iexact=predicate)
     return find_row("Overview!A", predicate)(self.workbook)
Exemplo n.º 6
0
def find_version(predicate):
    """Return a locator that scans the VERSION!A column for header values and returns values in VERSION!B"""
    return find_row("VERSION!A", predicate, target="B")
Exemplo n.º 7
0
def find(predicate, target="B"):
    """Return a locator that scans the Output!A column for header values and returns target column."""
    return find_row("Output!A", predicate, target=target)
Exemplo n.º 8
0
 def _find(predicate):
     return find_row("Output!A", predicate, start_row=row)