bayesline.api.equity.DerivedRiskDatasetSettings#
- model DerivedRiskDatasetSettings#
Settings for creating a derived risk dataset built on top of a parent.
A derived dataset is configured by selecting a reference dataset, optionally overriding exposures, filtering assets/exchanges, and trimming dates. All underlying market data is sourced from the reference dataset.
For datasets assembled directly from upload sources (no parent), see
RootRiskDatasetSettings. The discriminated union of both variants is exposed asAnyRiskDatasetSettings.Fields# Field
Type
Required
Default
Constraints
No
Nonelist[Annotated[RiskDatasetReferencedExposureSettings|RiskDatasetUploadedExposureSettings|RiskDatasetHuberRegressionExposureSettings|RiskDatasetUnitExposureSettings, FieldInfo(annotation=NoneType, required=True, discriminator=’exposure_type’)]]No
factory
min_length=1
No
FalseLiteral[‘derived’]No
'derived'Yes
Literal[‘none’, ‘asset_union’, ‘ccy_union’]No
'none'No
NoneNo
'latest_end'No
'earliest_start'Validators# Validator
Mode
Fields
after
- field exchange_codes: list[str] | None [Optional]#
The exchange codes to filter the reference dataset down to.
- field exposures: list[Annotated[RiskDatasetReferencedExposureSettings | RiskDatasetUploadedExposureSettings | RiskDatasetHuberRegressionExposureSettings | RiskDatasetUnitExposureSettings, FieldInfo(annotation=NoneType, required=True, discriminator='exposure_type')]] [Optional]#
The exposures to use for the new dataset. By default the reference dataset is copied as a basis for the new dataset.
- Constraints:
min_length =
1
- field is_system_wide: bool [Optional]#
Whether the risk dataset is system wide and provided by Bayesline.
- field kind: Literal['derived'] [Optional]#
Discriminator field for the risk dataset settings union (derived vs root). Use
derivedfor datasets built on top of a parent reference dataset; useroot(on RootRiskDatasetSettings) for datasets built directly from upload sources.
- field reference_dataset: str | int [Required]#
The dataset (either name or global int identifier) to use as a basis for the new dataset. All data will be sourced from this dataset.
- Validated by:
- field trim_assets: Literal['none', 'asset_union', 'ccy_union'] [Optional]#
Whether to trim the assets based on the uploaded exposures. If ‘none’, the assets are not trimmed. If ‘asset_union’, the assets are trimmed to the union of the asset ids in the uploaded exposures. If ‘ccy_union’, the assets are trimmed to the union of all currencies in the uploaded exposures.
- field trim_assets_sources: list[str] | None [Optional]#
Restrict the asset/ccy union used by
trim_assetsto these upload sources.None(default) preserves the prior behaviour: the union is taken across every uploaded-exposure source inexposures. Each entry must be theexposure_sourceof anuploaded-type entry inexposures. Only meaningful whentrim_assetsis'asset_union'or'ccy_union'.
- field trim_end_date: Literal['none', 'earliest_end', 'latest_end'] | date [Optional]#
Whether to trim the end date based on the uploaded exposures. If ‘none’, the end date is not trimmed. If ‘earliest_end’, the end date is trimmed to the earliest end date of the uploaded exposures, or the uploaded exposures and the reference dataset when referenced exposures are provided. If ‘latest_end’, the end date is trimmed to the latest end date of the uploaded exposures, or the uploaded exposures and the reference dataset when referenced exposures are provided. If a date is provided, the end date is trimmed to the provided date.
- field trim_start_date: Literal['none', 'earliest_start', 'latest_start'] | date [Optional]#
Whether to trim the start date based on the uploaded exposures. If ‘none’, the start date is not trimmed. If ‘earliest_start’, the start date is trimmed to the earliest start date of the uploaded exposures, or the uploaded exposures and the reference dataset when referenced exposures are provided. If ‘latest_start’, the start date is trimmed to the latest start date the uploaded exposures, or the uploaded exposures and the reference dataset when referenced exposures are provided. If a date is provided, the start date is trimmed to the provided date.
- validator validate_reference_dataset(mode=after)#
- Validates: