FrameworkObject#
-
class sigtech.framework.internal.infra.objects.core.framework_object.FrameworkObject
Baseclasses:
InstanceKwargsMixin
,ObjectBase
Subclasses:
FrameworkObjectUnmapped
,ContractGroup
,HistoricalFrameworkObject
,Signal
,CorporateActionIgnores
,ListedAsOTCOptionBase
,CustomDataset
,DigitalOptionBase
,RatesStrategyMixin
,BasketConfig
Object base with includes db cache and comparison
-
property cache_name: str
Cache name of this object.
-
property class_name
Class name of this object.
-
property class_short_name
Short name of the object class.
-
property data_source
Field used when retrieving history.
-
property dependency_type
Should return GraphNodeType. Return None to autodetect based on result of dependencies()
-
property env: ConfiguredEnvironment
Return the configured environment.
-
property identifier: Identifier
Return the object identifier.
-
instrument_id: Optional[int]
-
property internal_id
Ticker - i.e. part of name determining content of the class. For types with saved reference data - ticker will be
self._ticker
. For software types - ticker should be calculated.
-
property is_unmapped
Check if the object is not mapped.
-
property live_supported: bool
Flag for live supported objects.
-
property name
Primary name by which the
FrameworkObject
is identified. If reference information (or e.g. corresponding time series) are stored in the DB, then this name will be used.
-
property product_type
Return the
product_type
property of this object.
-
property sector
Sector used on BBG, or the class ID for SIG instruments.
-
available_data_providers(entitled_only=True) Optional[List[str]]
Available data providers for this object. Bool to return entitled providers only
-
clear_cached_data()
Clear all the cached data of the object.
-
clone_object(params=None)
Return a clone of the object with amended parameters.
- Parameters:
params – Optional dictionary of parameters to override.
- Returns:
New object.
-
compute_dependencies(root_dependency: Dependency = None)
Compute these dependencies - triggers data requests
-
dependencies(input_dependency: Dependency = None, valuation_currency: str = None, use_start: bool = True) list[sigtech.framework.internal.infra.mu.graph.registry.factory.Dependency]
Returns a list of Dependency
- Parameters:
input_dependency – A Dependency object representing the root of the dependency tree to be returned.
valuation_currency – If supplied, include the dependencies required to output the data in this currency.
use_start – If False, return only dependencies required to calculate an earliest start date - self.start_date will be None in this case.
- Returns:
List of Dependency objects representing the current level in the dependency tree.
-
env_date_change(old_env_dt: datetime, new_env_dt: datetime, live_data_update=None)
Routine called after the environment date is changed.
- Parameters:
old_env_dt – Old datetime (tz aware).
new_env_dt – New datetime (tz aware).
live_data_update – Live streaming data associated with the environment date change.
-
finalize_for_comparison()
Method to call to ensure all data dict values are finalized prior to doing object comparisons.
-
classmethod from_dictionary(dct: dict[str, Any], cache: bool = True, identifier: Optional[Identifier] = None, env: Optional[ConfiguredEnvironment] = None, **kwargs)
Factory method to create object using data dictionary
-
classmethod get_names(sort_by_group: Optional[bool] = False, include_db: Optional[bool] = True, include_local: Optional[bool] = True, include_children: Optional[bool] = False, ignore_unmapped: Optional[bool] = True) list[str]
Return an ordered list of object names associated with the class.
- Parameters:
sort_by_group – If set, the list is first ordered by sector/group, if applies, e.g. commodity or index futures (default is False).
include_db – If set, include objects available from the database (default is True).
include_local – If set, include objects available in the local environment (default is True).
include_children – If set, include objects available from child classes (default is False).
ignore_unmapped – If set, ignore errors due to unmapped database objects (default is True).
- Returns:
List of object names.
-
info() dict
Return a dictionary with useful object information.
-
print_dependencies(root_dependency: Dependency = None, resolve_future_dependencies: bool = True, fields: Optional[list] = None)
Pretty print dependency tree :param root_dependency: starting dependency of the tree. :param resolve_future_dependencies: resolve future dependencies before printing. If ‘false’ nothing get printed. :param fields: additional fields to extract from dependencies object. Default fields are
product_type
,currency
,frequency
anddata_source
. To get the list of available fields for an object you can use thedata_dict()
method.
-
static sort_key_static(name)
Convert a name to the sort key as of Portfolio Presentation Guidelines for performance reasons.
- Parameters:
name – Input name.
- Returns:
Tuple (sort key, length of sort key, input name).
-
textual_representation()
Return a printable representation of this object.
-
validate()
Validation routine adding checks that will be run on object creation.