def setUp(self): self.es = EventStore( stored_event_repo=PythonObjectsStoredEventRepository()) self.ps = PersistenceSubscriber(self.es) self.call_dependencies_repo = CallDependenciesRepo(self.es) self.call_dependents_repo = CallDependentsRepo(self.es) self.call_leafs_repo = CallLeafsRepo(self.es) self.call_requirement_repo = CallRequirementRepo(self.es)
def setUp(self): assert_event_handlers_empty() self.es = EventStore(PythonObjectsStoredEventRepository()) self.ps = PersistenceSubscriber(self.es) # self.call_result_repo = CallResultRepo(self.es) self.call_result_repo = {} self.call_dependencies_repo = CallDependenciesRepo(self.es) self.call_dependents_repo = CallDependentsRepo(self.es) self.call_requirement_repo = CallRequirementRepo(self.es) self.policy = CallResultPolicy(call_result_repo=self.call_result_repo)
def __init__(self): super(BaseQuantDslApplication, self).__init__() self.contract_specification_repo = ContractSpecificationRepo(event_store=self.event_store) self.contract_valuation_repo = ContractValuationRepo(event_store=self.event_store) self.market_calibration_repo = MarketCalibrationRepo(event_store=self.event_store) self.market_simulation_repo = MarketSimulationRepo(event_store=self.event_store) self.simulated_price_repo = SimulatedPriceRepo(event_store=self.event_store) self.call_requirement_repo = CallRequirementRepo(event_store=self.event_store) self.call_dependencies_repo = CallDependenciesRepo(event_store=self.event_store) self.call_dependents_repo = CallDependentsRepo(event_store=self.event_store) self.call_link_repo = CallLinkRepo(event_store=self.event_store) self.call_result_repo = CallResultRepo(event_store=self.event_store) self.simulation_subscriber = SimulationSubscriber( market_calibration_repo=self.market_calibration_repo, market_simulation_repo=self.market_simulation_repo ) self.dependency_graph_subscriber = DependencyGraphSubscriber( contract_specification_repo=self.contract_specification_repo, call_dependencies_repo=self.call_dependencies_repo, call_dependents_repo=self.call_dependents_repo )
def __init__(self, call_evaluation_queue=None, result_counters=None, usage_counters=None, *args, **kwargs): super(QuantDslApplication, self).__init__(*args, **kwargs) self.contract_specification_repo = ContractSpecificationRepo( event_store=self.event_store, use_cache=True) self.contract_valuation_repo = ContractValuationRepo( event_store=self.event_store, use_cache=True) self.market_calibration_repo = MarketCalibrationRepo( event_store=self.event_store, use_cache=True) self.market_simulation_repo = MarketSimulationRepo( event_store=self.event_store, use_cache=True) self.perturbation_dependencies_repo = PerturbationDependenciesRepo( event_store=self.event_store, use_cache=True) self.simulated_price_requirements_repo = SimulatedPriceRequirementsRepo( event_store=self.event_store, use_cache=True) self.simulated_price_repo = SimulatedPriceRepo( event_store=self.event_store, use_cache=True) self.call_requirement_repo = CallRequirementRepo( event_store=self.event_store, use_cache=True) self.call_dependencies_repo = CallDependenciesRepo( event_store=self.event_store, use_cache=True) self.call_dependents_repo = CallDependentsRepo( event_store=self.event_store, use_cache=True) self.call_leafs_repo = CallLeafsRepo(event_store=self.event_store, use_cache=True) self.call_link_repo = CallLinkRepo(event_store=self.event_store, use_cache=True) self.call_result_repo = CallResultRepo(event_store=self.event_store, use_cache=True) self.call_evaluation_queue = call_evaluation_queue self.result_counters = result_counters self.usage_counters = usage_counters self.simulation_subscriber = SimulationSubscriber( market_calibration_repo=self.market_calibration_repo, market_simulation_repo=self.market_simulation_repo, ) self.dependency_graph_subscriber = DependencyGraphSubscriber( contract_specification_repo=self.contract_specification_repo, call_dependencies_repo=self.call_dependencies_repo, call_dependents_repo=self.call_dependents_repo, call_leafs_repo=self.call_leafs_repo, call_requirement_repo=self.call_requirement_repo, ) self.evaluation_subscriber = EvaluationSubscriber( contract_valuation_repo=self.contract_valuation_repo, call_link_repo=self.call_link_repo, call_dependencies_repo=self.call_dependencies_repo, call_requirement_repo=self.call_requirement_repo, call_result_repo=self.call_result_repo, simulated_price_repo=self.simulated_price_repo, market_simulation_repo=self.market_simulation_repo, call_evaluation_queue=self.call_evaluation_queue, call_leafs_repo=self.call_leafs_repo, result_counters=self.result_counters, usage_counters=self.usage_counters, call_dependents_repo=self.call_dependents_repo, perturbation_dependencies_repo=self.perturbation_dependencies_repo, simulated_price_requirements_repo=self. simulated_price_requirements_repo, )
def __init__(self, call_evaluation_queue=None, max_dependency_graph_size=DEFAULT_MAX_DEPENDENCY_GRAPH_SIZE, dsl_classes=None, *args, **kwargs): super(QuantDslApplication, self).__init__(*args, **kwargs) self.contract_specification_repo = ContractSpecificationRepo( event_store=self.event_store, use_cache=True) self.contract_valuation_repo = ContractValuationRepo( event_store=self.event_store, use_cache=True) self.market_calibration_repo = MarketCalibrationRepo( event_store=self.event_store, use_cache=True) self.market_simulation_repo = MarketSimulationRepo( event_store=self.event_store, use_cache=True) self.perturbation_dependencies_repo = PerturbationDependenciesRepo( event_store=self.event_store, use_cache=True) self.simulated_price_requirements_repo = SimulatedPriceRequirementsRepo( event_store=self.event_store, use_cache=True) # self.simulated_price_repo = SimulatedPriceRepo(event_store=self.event_store, use_cache=True) self.simulated_price_repo = {} self.call_requirement_repo = CallRequirementRepo( event_store=self.event_store, use_cache=True) self.call_dependencies_repo = CallDependenciesRepo( event_store=self.event_store, use_cache=True) self.call_dependents_repo = CallDependentsRepo( event_store=self.event_store, use_cache=True) self.call_leafs_repo = CallLeafsRepo(event_store=self.event_store, use_cache=True) self.call_link_repo = CallLinkRepo(event_store=self.event_store, use_cache=True) # self.call_result_repo = CallResultRepo(event_store=self.event_store, use_cache=True) self.call_result_repo = {} self.call_evaluation_queue = call_evaluation_queue self.max_dependency_graph_size = max_dependency_graph_size self.dsl_classes = dsl_classes self.simulation_subscriber = SimulationSubscriber( market_calibration_repo=self.market_calibration_repo, market_simulation_repo=self.market_simulation_repo, simulated_price_repo=self.simulated_price_repo) self.dependency_graph_subscriber = DependencyGraphSubscriber( contract_specification_repo=self.contract_specification_repo, call_dependencies_repo=self.call_dependencies_repo, call_dependents_repo=self.call_dependents_repo, call_leafs_repo=self.call_leafs_repo, call_requirement_repo=self.call_requirement_repo, max_dependency_graph_size=self.max_dependency_graph_size, dsl_classes=self.dsl_classes, ) self.evaluation_subscriber = EvaluationSubscriber( contract_valuation_repo=self.contract_valuation_repo, call_link_repo=self.call_link_repo, call_dependencies_repo=self.call_dependencies_repo, call_requirement_repo=self.call_requirement_repo, call_result_repo=self.call_result_repo, simulated_price_repo=self.simulated_price_repo, market_simulation_repo=self.market_simulation_repo, call_evaluation_queue=self.call_evaluation_queue, call_leafs_repo=self.call_leafs_repo, call_dependents_repo=self.call_dependents_repo, perturbation_dependencies_repo=self.perturbation_dependencies_repo, simulated_price_requirements_repo=self. simulated_price_requirements_repo, ) self.call_result_policy = CallResultPolicy(self.call_result_repo, self.call_evaluation_queue)