Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,16 @@ services:
depends_on:
pg:
condition: service_healthy
# Runs sec_process job locally via `dagster job execute`
# Needs headroom for fastembed model + embedding computation (matches prod 16GB)
# Runs dagster job execute locally (SEC processing, materialization, etc.)
# Needs headroom for fastembed model + DuckDB + XBRL processing
restart: always
deploy:
resources:
limits:
memory: 16g
cpus: "8"
memory: 8g
cpus: "4"
reservations:
memory: 4g
memory: 1g
cpus: "2"
profiles: ["dagster", "robosystems", "all"]

Expand Down
54 changes: 50 additions & 4 deletions robosystems/config/taxonomy/seed.py
Original file line number Diff line number Diff line change
Expand Up @@ -847,9 +847,55 @@ def seed_reporting_taxonomy(connection) -> None:
for e in ALL_GAAP_ELEMENTS:
_insert_element(connection, e)

# 5. Create root-ordering associations (structure → SFAC6 root)
# 5. Create structure-root elements so they can be referenced in associations.
# The associations FK requires both from/to to be valid element IDs.
# These abstract elements represent the root of each financial statement.
STRUCTURE_ROOT_ELEMENTS = [
{
"id": STRUCT_BS_ID,
"qname": "report:BalanceSheet",
"namespace": "report",
"name": "Balance Sheet",
"classification": "asset",
"balance_type": "debit",
"period_type": "instant",
"is_abstract": True,
"element_type": "abstract",
"source": "native",
"depth": 0,
},
{
"id": STRUCT_IS_ID,
"qname": "report:IncomeStatement",
"namespace": "report",
"name": "Income Statement",
"classification": "revenue",
"balance_type": "credit",
"period_type": "duration",
"is_abstract": True,
"element_type": "abstract",
"source": "native",
"depth": 0,
},
{
"id": STRUCT_CF_ID,
"qname": "report:CashFlowStatement",
"namespace": "report",
"name": "Cash Flow Statement",
"classification": "asset",
"balance_type": "debit",
"period_type": "duration",
"is_abstract": True,
"element_type": "abstract",
"source": "native",
"depth": 0,
},
]
for e in STRUCTURE_ROOT_ELEMENTS:
_insert_element(connection, e)

# 6. Create root-ordering associations (structure root → SFAC6 root)
# These control the order of top-level sections in each statement.
# Convention: from_element_id = structure_id, to_element_id = SFAC6 root.
ROOT_ORDER: list[tuple[str, str, int]] = [
# Balance Sheet: Assets → Liabilities → Equity
(STRUCT_BS_ID, "elem_sfac6_assets", 1),
Expand Down Expand Up @@ -885,7 +931,7 @@ def seed_reporting_taxonomy(connection) -> None:
},
)

# 6. Create hierarchy associations (parent → child via structures)
# 7. Create hierarchy associations (parent → child via structures)
# Order per-parent so siblings sort correctly within each section
order_by_parent: dict[str, int] = {}
for e in ALL_GAAP_ELEMENTS:
Expand All @@ -911,7 +957,7 @@ def seed_reporting_taxonomy(connection) -> None:
},
)

# 7. Create calculation associations for computed elements.
# 8. Create calculation associations for computed elements.
# from_element = the computed total, to_element = the source, weight = multiplier.
# The renderer sums (source_value * weight) for each source.
CALCULATION_ASSOCIATIONS = [
Expand Down
Loading