bayesline.api.equity.PortfolioOrganizerSettings#
- pydantic model bayesline.api.equity.PortfolioOrganizerSettings#
Definition of where to source portfolio data from.
Specifies which portfolios to enable (from different sources). Different sources (e.g. uploaded portfolios) can provide the same portfolio identifiers. These settings allow to specify which portfolios to enable from which sources.
Show JSON schema
{ "title": "PortfolioOrganizerSettings", "description": "Definition of where to source portfolio data from.\n\nSpecifies which portfolios to enable (from different sources).\nDifferent sources (e.g. uploaded portfolios) can provide the same portfolio\nidentifiers. These settings allow to specify which portfolios to enable from\nwhich sources.", "type": "object", "properties": { "enabled_portfolios": { "anyOf": [ { "type": "string" }, { "additionalProperties": { "type": "string" }, "type": "object" } ], "description": "The enabled portfolios from different sources. The key is the portfolio ID, and the value is the source (name of the underlying portfolio service). Pass a str to reference an entire portfolio source (e.g. all portfolios from an upload).", "title": "Enabled Portfolios" }, "auxiliary_portfolios": { "additionalProperties": { "type": "string" }, "description": "Portfolios pulled in by fund-of-funds (FoF) cascade. Informational: always recomputed from ``enabled_portfolios`` plus the FoF graph at load time. Persisted as-is on save; any stale values are overwritten on the next normalize. The loader's effective enabled set is the union of ``enabled_portfolios`` and ``auxiliary_portfolios`` with user-explicit entries winning on key collision.", "title": "Auxiliary Portfolios", "type": "object" } }, "additionalProperties": false, "required": [ "enabled_portfolios" ] }
- Config:
frozen: bool = True
extra: str = forbid
- Fields:
auxiliary_portfolios (dict[str, str])enabled_portfolios (str | dict[str, str])
- Validators:
validate_enabled_portfolios»enabled_portfolios
-
field enabled_portfolios:
str|dict[str,str] [Required]# The enabled portfolios from different sources. The key is the portfolio ID, and the value is the source (name of the underlying portfolio service). Pass a str to reference an entire portfolio source (e.g. all portfolios from an upload).
- Validated by:
_strip_unknown_on_loadvalidate_enabled_portfolios
-
field auxiliary_portfolios:
dict[str,str] [Optional]# Portfolios pulled in by fund-of-funds (FoF) cascade. Informational: always recomputed from
enabled_portfoliosplus the FoF graph at load time. Persisted as-is on save; any stale values are overwritten on the next normalize. The loader’s effective enabled set is the union ofenabled_portfoliosandauxiliary_portfolioswith user-explicit entries winning on key collision.- Validated by:
_strip_unknown_on_load
- get_references() Sequence[str | int]#
Get references for this settings object.
Returns#
- Sequence[str | int]
A sequence of references (strings or integers) for this settings object.
- map_references(fn: Callable[[str | int], str | int]) Self#
Return a copy with every reference rewritten by
fn.The structural dual of
get_references(): it appliesfnto each reference this settings object holds — recursing into nested settings — and returns a rewritten copy, leaving all non-reference fields untouched. The base implementation has no references and returnsselfunchanged, mirroringget_references()(whose default is[]); a subclass that overrides one must override the other in lockstep so the two stay consistent (a parity test enforces this).fnis applied purely structurally — this object knows where its references live, not what a rewrite means. Any resolution context (e.g. a current user or a user directory) must be captured by the caller in thefnclosure; the settings layer never learns of it.Parameters#
- fnCallable[[str | int], str | int]
Applied to each reference leaf. Must preserve a reference’s kind (a name stays a name, an id stays an id).
Returns#
- Self
A copy with references rewritten.
Get the menu type for this settings object.
Returns#
- type[M]
The menu type for this settings object.
- describe(menu: PortfolioOrganizerSettingsMenu) str#
Describe the settings.
Parameters#
- menuPortfolioOrganizerSettingsMenu
The menu to get context information from.
Returns#
- str
A description of the settings.