hgraph
  • Home
  • Getting Started
  • Quick Start
    • The run loop
    • graph
    • node
      • source_node
      • compute_node
      • sink_node
  • Programming Model
    • Mental Model
      • Graph
        • Backward Propagation Graphs
        • Forward Propagation Graphs
        • Observer Pattern
        • Cached Results
        • Terminology
      • Time-Series
      • Functional
        • Functions
        • Immutability
        • Deterministic
        • Composition
      • Typing
    • Code Organisation
      • Describing the problems / solution
      • Move from top down to bottom up
      • Integration Testing / Runtime Wiring
  • HGraph Concepts
    • Run Loop Concept
      • Life-Cycle
      • Evaluation Loop
      • Nested Graphs
    • Node Based Computation
      • Source Node
        • Pull Source Node
        • Push Source Node
      • Compute / Sink Node
      • Node Scheduling
      • Node Activation
      • Node Outputs
      • Using REF to reduce activations
      • Tracing issues
        • IDE / Python debugger
        • Trace
        • Introspector
    • Typing System
      • Schema Based Types
      • Generics
      • Extending the Type Support
    • Time Series Types
      • Time-series properties
    • Dynamic Graphs
      • Map
        • Knowing the key
        • Manging the key set
        • You can’t touch this
      • Reduce
      • Switch
      • Mesh
    • Services
      • Reference Service
      • Subscription Service
      • Request Reply Service
  • HGraph Tools
    • HGraph Inspector
      • Inspector columns
      • Operating inspector
      • Graph performance table
  • Adaptors
    • Home
    • REST API
      • Client API
        • rest_list()
        • rest_read()
        • rest_create()
        • rest_update()
        • rest_delete()
      • Service API
        • rest_handler()
        • RestRequest
        • RestCreateRequest
        • RestUpdateRequest
        • RestReadRequest
        • RestDeleteRequest
        • RestListRequest
        • RestResultEnum
        • RestResponse
        • RestCreateResponse
        • RestUpdateResponse
        • RestReadResponse
        • RestDeleteResponse
        • RestListResponse
    • HTTP Adaptor
      • HTTP Server
        • http_server_handler()
        • HttpRequest
        • HttpGetRequest
        • HttpDeleteRequest
        • HttpPutRequest
        • HttpPostRequest
        • HttpResponse
        • register_http_server_adaptor()
      • HTTP Client
        • http_client_adaptor()
        • http_client_adaptor_impl()
    • Web Socket API
      • Client API
        • websocket_client_adaptor()
        • websocket_client_adaptor_impl()
      • Server API
        • websocket_server_handler()
        • websocket_server_adaptor_helper()
        • WebSocketConnectRequest
        • WebSocketServerRequest
        • WebSocketClientRequest
        • WebSocketResponse
  • Tutorial
    • Basic Programming Structure
      • evaluate_graph
      • graph
      • Aside
    • Unit Testing - Basics
      • The eval_node Function
      • The debug_print Function
      • breakpoint_
    • The Compute Node
      • Node Instance
      • Timing
      • valid
      • active
      • Aside
    • Injectables
      • State
      • Scheduling
      • Logging
      • Access the Output
      • Engine Time
      • The Engine API
    • Typing
      • TimeSeriesValue (TS)
      • Casting
      • CompoundScalar
      • TimeSeriesBundle (TSB)
        • Exercise
      • TimeSeriesList (TSL)
      • TimeSeriesSet (TSS)
      • TimeSeriesDict (TSD)
    • Generics
      • SCALAR
        • Exercise
      • TIME_SERIES_TYPE
        • Exercise
      • Resolvers
      • Requires
    • Operators
    • Graph
      • Basic example
      • Composition
      • Polymorphism
      • Higher Order Functions
    • Common Pitfalls
      • The infinite loop
        • Symptom
        • Likely Cause
        • How to validate
        • Corrective Actions
  • HGraph Reference
    • Graph Run Loop
      • EvaluationMode
        • EvaluationMode.REAL_TIME
        • EvaluationMode.SIMULATION
      • GraphConfiguration
        • GraphConfiguration.capture_values
        • GraphConfiguration.cleanup_on_error
        • GraphConfiguration.default_log_level
        • GraphConfiguration.end_time
        • GraphConfiguration.error_capture_options
        • GraphConfiguration.graph_logger
        • GraphConfiguration.life_cycle_observers
        • GraphConfiguration.logger_formatter
        • GraphConfiguration.profile
        • GraphConfiguration.run_mode
        • GraphConfiguration.start_time
        • GraphConfiguration.trace
        • GraphConfiguration.trace_back_depth
        • GraphConfiguration.trace_wiring
        • GraphConfiguration.wiring_observers
      • evaluate_graph()
      • eval_node()
      • EvaluationLifeCycleObserver
        • EvaluationLifeCycleObserver.on_after_graph_evaluation()
        • EvaluationLifeCycleObserver.on_after_graph_push_nodes_evaluation()
        • EvaluationLifeCycleObserver.on_after_node_evaluation()
        • EvaluationLifeCycleObserver.on_after_start_graph()
        • EvaluationLifeCycleObserver.on_after_start_node()
        • EvaluationLifeCycleObserver.on_after_stop_graph()
        • EvaluationLifeCycleObserver.on_after_stop_node()
        • EvaluationLifeCycleObserver.on_before_graph_evaluation()
        • EvaluationLifeCycleObserver.on_before_node_evaluation()
        • EvaluationLifeCycleObserver.on_before_start_graph()
        • EvaluationLifeCycleObserver.on_before_start_node()
        • EvaluationLifeCycleObserver.on_before_stop_graph()
        • EvaluationLifeCycleObserver.on_before_stop_node()
      • EvaluationTrace
        • EvaluationTrace.set_print_all_values()
        • EvaluationTrace.set_use_logger()
        • EvaluationTrace.on_after_graph_evaluation()
        • EvaluationTrace.on_after_node_evaluation()
        • EvaluationTrace.on_after_start_graph()
        • EvaluationTrace.on_after_start_node()
        • EvaluationTrace.on_after_stop_graph()
        • EvaluationTrace.on_after_stop_node()
        • EvaluationTrace.on_before_graph_evaluation()
        • EvaluationTrace.on_before_node_evaluation()
        • EvaluationTrace.on_before_start_graph()
        • EvaluationTrace.on_before_start_node()
        • EvaluationTrace.on_before_stop_graph()
        • EvaluationTrace.on_before_stop_node()
      • EvaluationProfiler
        • EvaluationProfiler.on_after_graph_evaluation()
        • EvaluationProfiler.on_after_node_evaluation()
        • EvaluationProfiler.on_after_start_graph()
        • EvaluationProfiler.on_after_start_node()
        • EvaluationProfiler.on_after_stop_graph()
        • EvaluationProfiler.on_after_stop_node()
        • EvaluationProfiler.on_before_graph_evaluation()
        • EvaluationProfiler.on_before_node_evaluation()
        • EvaluationProfiler.on_before_start_graph()
        • EvaluationProfiler.on_before_start_node()
        • EvaluationProfiler.on_before_stop_graph()
        • EvaluationProfiler.on_before_stop_node()
      • WiringObserver
        • WiringObserver.on_enter_graph_wiring()
        • WiringObserver.on_enter_nested_graph_wiring()
        • WiringObserver.on_enter_node_wiring()
        • WiringObserver.on_exit_graph_wiring()
        • WiringObserver.on_exit_nested_graph_wiring()
        • WiringObserver.on_exit_node_wiring()
        • WiringObserver.on_overload_resolution()
      • WiringTracer
        • WiringTracer.on_enter_graph_wiring()
        • WiringTracer.on_enter_nested_graph_wiring()
        • WiringTracer.on_enter_node_wiring()
        • WiringTracer.on_exit_graph_wiring()
        • WiringTracer.on_exit_nested_graph_wiring()
        • WiringTracer.on_exit_node_wiring()
        • WiringTracer.on_overload_resolution()
    • Decorators
      • operator()
      • graph()
      • compute_node()
      • sink_node()
      • generator()
      • push_queue()
      • const_fn()
      • reference_service()
      • subscription_service()
      • request_reply_service()
      • service_impl()
      • adaptor()
      • adaptor_impl()
      • service_adaptor()
      • service_adaptor_impl()
      • component()
      • pull_source_node()
      • push_source_node()
      • Supporting functions
        • register_service()
        • register_adaptor()
    • Time-Series Types
      • TS
      • TSS
      • TSL
      • TSB
      • TSD
      • SIGNAL
      • REF
      • TSW
      • TimeSeries
        • TimeSeries.is_reference()
        • TimeSeries.re_parent()
        • TimeSeries.all_valid
        • TimeSeries.delta_value
        • TimeSeries.last_modified_time
        • TimeSeries.modified
        • TimeSeries.owning_graph
        • TimeSeries.owning_node
        • TimeSeries.valid
        • TimeSeries.value
      • TimeSeriesOutput
        • TimeSeriesOutput.apply_result()
        • TimeSeriesOutput.can_apply_result()
        • TimeSeriesOutput.clear()
        • TimeSeriesOutput.copy_from_input()
        • TimeSeriesOutput.copy_from_output()
        • TimeSeriesOutput.invalidate()
        • TimeSeriesOutput.mark_invalid()
        • TimeSeriesOutput.mark_modified()
        • TimeSeriesOutput.subscribe()
        • TimeSeriesOutput.unsubscribe()
        • TimeSeriesOutput.delta_value
        • TimeSeriesOutput.has_parent_output
        • TimeSeriesOutput.parent_output
        • TimeSeriesOutput.value
      • TimeSeriesInput
        • TimeSeriesInput.bind_output()
        • TimeSeriesInput.do_bind_output()
        • TimeSeriesInput.do_un_bind_output()
        • TimeSeriesInput.make_active()
        • TimeSeriesInput.make_passive()
        • TimeSeriesInput.un_bind_output()
        • TimeSeriesInput.active
        • TimeSeriesInput.bound
        • TimeSeriesInput.has_parent_input
        • TimeSeriesInput.has_peer
        • TimeSeriesInput.output
        • TimeSeriesInput.parent_input
      • TimeSeriesDeltaValue
        • TimeSeriesDeltaValue.delta_value
        • TimeSeriesDeltaValue.value
      • TimeSeriesSignalInput
        • TimeSeriesSignalInput.value
      • TimeSeriesValueOutput
        • TimeSeriesValueOutput.value
      • TimeSeriesValueInput
      • SetDelta
        • SetDelta.added
        • SetDelta.removed
      • TimeSeriesSet
        • TimeSeriesSet.added()
        • TimeSeriesSet.removed()
        • TimeSeriesSet.values()
        • TimeSeriesSet.was_added()
        • TimeSeriesSet.was_removed()
      • TimeSeriesSetInput
      • TimeSeriesSetOutput
        • TimeSeriesSetOutput.add()
        • TimeSeriesSetOutput.clear()
        • TimeSeriesSetOutput.get_contains_output()
        • TimeSeriesSetOutput.is_empty_output()
        • TimeSeriesSetOutput.release_contains_output()
        • TimeSeriesSetOutput.remove()
        • TimeSeriesSetOutput.delta_value
        • TimeSeriesSetOutput.value
      • TimeSeriesIterable
        • TimeSeriesIterable.items()
        • TimeSeriesIterable.keys()
        • TimeSeriesIterable.modified_items()
        • TimeSeriesIterable.modified_keys()
        • TimeSeriesIterable.modified_values()
        • TimeSeriesIterable.valid_items()
        • TimeSeriesIterable.valid_keys()
        • TimeSeriesIterable.valid_values()
        • TimeSeriesIterable.values()
      • TimeSeriesList
        • TimeSeriesList.items()
        • TimeSeriesList.key_from_value()
        • TimeSeriesList.keys()
        • TimeSeriesList.modified_items()
        • TimeSeriesList.modified_keys()
        • TimeSeriesList.modified_values()
        • TimeSeriesList.valid_items()
        • TimeSeriesList.valid_keys()
        • TimeSeriesList.valid_values()
        • TimeSeriesList.values()
      • TimeSeriesListInput
        • TimeSeriesListInput.from_ts()
      • TimeSeriesListOutput
      • TimeSeriesBundle
        • TimeSeriesBundle.items()
        • TimeSeriesBundle.key_from_value()
        • TimeSeriesBundle.keys()
        • TimeSeriesBundle.modified_items()
        • TimeSeriesBundle.modified_keys()
        • TimeSeriesBundle.modified_values()
        • TimeSeriesBundle.valid_items()
        • TimeSeriesBundle.valid_keys()
        • TimeSeriesBundle.valid_values()
        • TimeSeriesBundle.values()
        • TimeSeriesBundle.as_schema
      • TimeSeriesBundleInput
        • TimeSeriesBundleInput.from_ts()
        • TimeSeriesBundleInput.copy_with()
        • TimeSeriesBundleInput.do_bind_output()
        • TimeSeriesBundleInput.items()
        • TimeSeriesBundleInput.make_active()
        • TimeSeriesBundleInput.make_passive()
        • TimeSeriesBundleInput.values()
        • TimeSeriesBundleInput.active
        • TimeSeriesBundleInput.all_valid
        • TimeSeriesBundleInput.bound
        • TimeSeriesBundleInput.delta_value
        • TimeSeriesBundleInput.has_parent_input
        • TimeSeriesBundleInput.last_modified_time
        • TimeSeriesBundleInput.modified
        • TimeSeriesBundleInput.output
        • TimeSeriesBundleInput.owning_graph
        • TimeSeriesBundleInput.owning_node
        • TimeSeriesBundleInput.parent_input
        • TimeSeriesBundleInput.valid
        • TimeSeriesBundleInput.value
      • TimeSeriesBundleOutput
        • TimeSeriesBundleOutput.items()
        • TimeSeriesBundleOutput.values()
      • TimeSeriesDict
        • TimeSeriesDict.added_items()
        • TimeSeriesDict.added_keys()
        • TimeSeriesDict.added_values()
        • TimeSeriesDict.create()
        • TimeSeriesDict.get()
        • TimeSeriesDict.get_or_create()
        • TimeSeriesDict.items()
        • TimeSeriesDict.keys()
        • TimeSeriesDict.modified_items()
        • TimeSeriesDict.modified_keys()
        • TimeSeriesDict.modified_values()
        • TimeSeriesDict.removed_items()
        • TimeSeriesDict.removed_keys()
        • TimeSeriesDict.removed_values()
        • TimeSeriesDict.valid_items()
        • TimeSeriesDict.valid_keys()
        • TimeSeriesDict.valid_values()
        • TimeSeriesDict.values()
        • TimeSeriesDict.key_set
      • TimeSeriesDictInput
        • TimeSeriesDictInput.from_ts()
      • TimeSeriesDictOutput
        • TimeSeriesDictOutput.get_ref()
        • TimeSeriesDictOutput.pop()
        • TimeSeriesDictOutput.release_ref()
      • TimeSeriesReference
        • TimeSeriesReference.is_instance()
        • TimeSeriesReference.make()
        • TimeSeriesReference.bind_input()
        • TimeSeriesReference.has_output
        • TimeSeriesReference.is_empty
        • TimeSeriesReference.is_valid
      • TimeSeriesReferenceOutput
        • TimeSeriesReferenceOutput.observe_reference()
        • TimeSeriesReferenceOutput.stop_observing_reference()
        • TimeSeriesReferenceOutput.value
      • TimeSeriesReferenceInput
        • TimeSeriesReferenceInput.clone_binding()
      • TimeSeriesWindow
        • TimeSeriesWindow.first_modified_time
        • TimeSeriesWindow.has_removed_value
        • TimeSeriesWindow.min_size
        • TimeSeriesWindow.removed_value
        • TimeSeriesWindow.size
        • TimeSeriesWindow.value_times
      • TimeSeriesWindowOutput
      • TimeSeriesWindowInput
    • Typing
      • HgTypeMetaData
        • HgTypeMetaData.parse_type()
        • HgTypeMetaData.parse_value()
        • HgTypeMetaData.as_reference()
        • HgTypeMetaData.build_resolution_dict()
        • HgTypeMetaData.dereference()
        • HgTypeMetaData.do_build_resolution_dict()
        • HgTypeMetaData.matches()
        • HgTypeMetaData.matches_type()
        • HgTypeMetaData.resolve()
        • HgTypeMetaData.generic_rank
        • HgTypeMetaData.has_references
        • HgTypeMetaData.is_atomic
        • HgTypeMetaData.is_context_manager
        • HgTypeMetaData.is_context_wired
        • HgTypeMetaData.is_generic
        • HgTypeMetaData.is_injectable
        • HgTypeMetaData.is_reference
        • HgTypeMetaData.is_resolved
        • HgTypeMetaData.is_scalar
        • HgTypeMetaData.py_type
        • HgTypeMetaData.type_vars
      • AbstractSchema
      • CompoundScalar
        • CompoundScalar.from_dict()
        • CompoundScalar.to_dict()
      • TimeSeriesSchema
        • TimeSeriesSchema.scalar_type()
        • TimeSeriesSchema.to_scalar_schema()
        • TimeSeriesSchema.from_scalar_schema()
      • compound_scalar()
      • ts_schema()
    • Injectables
      • InjectableTypesEnum
        • InjectableTypesEnum.CLOCK
        • InjectableTypesEnum.ENGINE_API
        • InjectableTypesEnum.LOGGER
        • InjectableTypesEnum.NODE
        • InjectableTypesEnum.OUTPUT
        • InjectableTypesEnum.SCHEDULER
        • InjectableTypesEnum.STATE
      • STATE
        • STATE.is_updated()
        • STATE.items()
        • STATE.keys()
        • STATE.reset_updated()
        • STATE.values()
        • STATE.as_schema
      • SCHEDULER
        • SCHEDULER.has_tag()
        • SCHEDULER.pop_tag()
        • SCHEDULER.reset()
        • SCHEDULER.schedule()
        • SCHEDULER.un_schedule()
        • SCHEDULER.is_scheduled
        • SCHEDULER.is_scheduled_now
        • SCHEDULER.next_scheduled_time
      • LOGGER
      • EvaluationClock
        • EvaluationClock.cycle_time
        • EvaluationClock.evaluation_time
        • EvaluationClock.next_cycle_evaluation_time
        • EvaluationClock.now
      • EvaluationEngineApi
        • EvaluationEngineApi.add_after_evaluation_notification()
        • EvaluationEngineApi.add_before_evaluation_notification()
        • EvaluationEngineApi.add_life_cycle_observer()
        • EvaluationEngineApi.remove_life_cycle_observer()
        • EvaluationEngineApi.request_engine_stop()
        • EvaluationEngineApi.end_time
        • EvaluationEngineApi.evaluation_clock
        • EvaluationEngineApi.evaluation_mode
        • EvaluationEngineApi.is_stop_requested
        • EvaluationEngineApi.start_time
    • Dynamic Graphs
      • map_()
      • reduce()
      • switch_()
      • mesh_()
    • Operators
      • abs_()
      • add_()
      • all_()
      • any_()
      • apply()
      • average()
      • batch()
      • bit_and()
      • bit_or()
      • bit_xor()
      • BoolResult
      • cast_()
      • call()
      • clip()
      • cmp_()
      • CmpResult
      • combine()
      • const()
      • contains_()
      • convert()
      • collapse_keys()
      • collect()
      • count()
      • day_of_month()
      • default()
      • DebugContext
      • debug_print()
      • dedup()
      • diff()
      • difference()
      • DivideByZero
      • div_()
      • divmod_()
      • downcast_()
      • downcast_ref()
      • drop()
      • emit()
      • eq_()
      • evaluation_time_in_range()
      • explode()
      • filter_()
      • flip()
      • flip_keys()
      • floordiv_()
      • format_()
      • from_json()
      • gate()
      • ge_()
      • getattr_()
      • getitem_()
      • gt_()
      • if_()
      • if_cmp()
      • if_then_else()
      • if_true()
      • index_of()
      • intersection()
      • invert_()
      • is_empty()
      • join()
      • keys_()
      • lag()
      • last_modified_date()
      • last_modified_time()
      • le_()
      • len_()
      • lift()
      • ln()
      • log_()
      • lshift_()
      • lt_()
      • Match
      • match_()
      • max_()
      • mean()
      • merge()
      • min_()
      • mod_()
      • modified()
      • month_of_year()
      • mul_()
      • ne_()
      • neg_()
      • not_()
      • nothing()
      • null_sink()
      • or_()
      • partition()
      • pass_through_node()
      • pos_()
      • pow_()
      • print_()
      • race()
      • rekey()
      • replace()
      • resample()
      • round_()
      • route_by_index()
      • rshift_()
      • sample()
      • schedule()
      • slice_()
      • split()
      • std()
      • str_()
      • step()
      • stop_engine()
      • str_()
      • sub_()
      • substr()
      • sum_()
      • symmetric_difference()
      • take()
      • throttle()
      • to_json()
      • to_window()
      • type_()
      • uncollapse_keys()
      • union()
      • unpartition()
      • valid()
      • values_()
      • var()
      • WindowResult
      • year()
      • zero()
    • Operators Support
      • Standard Python Operators
      • convert
      • combine
      • emit
    • Services
      • get_service_inputs()
      • set_service_output()
    • hgraph.numpy_
      • Numpy Bindings
        • Array
      • Converters
        • as_array()
      • Mathematical Functions
        • cumsum()
      • Statistical Functions
        • corrcoef()
  • Papers
    • HGraph: Functional Reactive Programming in Python
      • Abstract
      • Introduction
      • Functional Programming
      • Primitives
        • Time
        • Time-Series
        • Nodes
        • Wiring
      • Runtime
      • Operators
        • Arrow
        • Flow Control
  • References
  • Specification
    • Specification Index
      • Document Purpose
      • Document Structure
      • Table of Contents
        • Part I: Foundation
        • Part II: Type System
        • Part III: Graph Construction (Wiring)
        • Part IV: Execution
        • Part V: Time-Series Semantics
        • Part VI: Node Specifications
        • Part VII: Standard Library
        • Part VIII: Advanced Features
      • Key Concepts Quick Reference
        • What is HGraph?
        • Core Abstractions
        • Execution Phases
      • Conformance Levels
      • Reading Guide
        • For Language Implementers
        • For Library Developers
        • For Users
      • Reference Implementation
      • Notation Conventions
        • Type Notation
        • Behavioral Notation
      • Document History
    • Part I: Overview
      • 1. Introduction
        • 1.1 What is HGraph?
        • 1.2 Design Goals
        • 1.3 Key Innovation
      • 2. Core Concepts
        • 2.1 Forward Propagation Graph (FPG)
        • 2.2 Time-Series
        • 2.3 Nodes
        • 2.4 Evaluation Model
      • 3. Two-Phase Architecture
        • 3.1 Wiring Phase
        • 3.2 Runtime Phase
      • 4. Execution Modes
        • 4.1 Simulation Mode
        • 4.2 Real-Time Mode
      • 5. Type System Overview
        • 5.1 Scalar Types
        • 5.2 Time-Series Types
      • 6. Hello World Example
        • Explanation:
      • 7. Component Architecture
      • 8. Lifecycle Overview
      • 9. Key Invariants
        • 9.1 Modification Tracking
        • 9.2 Notification Idempotency
        • 9.3 Topological Ordering
        • 9.4 Validity Propagation
      • 10. Reference Locations
      • 11. Next Steps
    • Part II: Type System
      • 1. Type System Architecture
        • 1.1 Overview
        • 1.2 Type Hierarchy
      • 2. Scalar Types
        • 2.1 Atomic Types
        • 2.2 Collection Types
          • 2.2.1 Tuple Types
          • 2.2.2 Set Type
          • 2.2.3 Dict Type
          • 2.2.4 Array Type (NumPy)
        • 2.3 Compound Scalar Types
        • 2.4 Injectable Types
        • 2.5 Scalar Type Variables
      • 3. Time-Series Types
        • 3.1 Base Time-Series Type
        • 3.2 TS[T] - Scalar Time-Series
        • 3.3 TSB[Schema] - Time-Series Bundle
        • 3.4 TSL[T, Size] - Time-Series List
        • 3.5 TSD[K, V] - Time-Series Dictionary
        • 3.6 TSS[T] - Time-Series Set
        • 3.7 TSW[T, Size, MinSize] - Time-Series Window
        • 3.8 REF[T] - Reference Type
      • 4. Type Resolution
        • 4.1 Resolution Process
        • 4.2 Type Matching
        • 4.3 Generic Rank
        • 4.4 Resolution Dictionary
      • 5. Type Parsing
        • 5.1 Entry Point
        • 5.2 Parser Order
      • 6. Type Properties Summary
      • 7. Schema System
        • 7.1 AbstractSchema
        • 7.2 TimeSeriesSchema
        • 7.3 Schema ↔ Scalar Conversion
      • 8. Implementation Notes
        • 8.1 Output Type Variants
        • 8.2 Special Types
      • 9. Next Steps
    • Part III: Wiring System
      • 1. Introduction
      • 2. Decorators
        • 2.1 Decorator Hierarchy
        • 2.2 Decorator Definitions
          • 2.2.1 compute_node
          • 2.2.2 sink_node
          • 2.2.3 graph
          • 2.2.4 push_source_node
          • 2.2.5 pull_source_node
          • 2.2.6 generator
          • 2.2.7 operator
      • 3. Wiring Context
        • 3.1 Context Stack
        • 3.2 Context Architecture
        • 3.3 WiringGraphContext
        • 3.4 Context Management
      • 4. Signatures
        • 4.1 Signature Extraction
        • 4.2 WiringNodeSignature
        • 4.3 Argument Categories
        • 4.4 Special Signature Elements
          • 4.4.1 *args and **kwargs
          • 4.4.2 Unresolved Types
      • 5. Wiring Nodes and Ports
        • 5.1 Wiring Node
        • 5.2 Wiring Port
        • 5.3 Port Connections
      • 6. Type Resolution
        • 6.1 Resolution Process
        • 6.2 Type Variable Resolution
        • 6.3 Resolution Table
        • 6.4 Generic Rank
      • 7. Graph Building
        • 7.1 Graph Builder
        • 7.2 Graph Construction Sequence
        • 7.3 Node ID Assignment
      • 8. Nested Graphs and Expansion
        • 8.1 Graph Expansion
        • 8.2 Nested Graph Semantics
      • 9. Error Handling at Wiring Time
        • 9.1 Wiring Errors
        • 9.2 Error Messages
      • 10. Wiring-Time Evaluation
        • 10.1 Scalar Arguments
        • 10.2 Wiring-Time Functions
      • 11. Special Wiring Constructs
        • 11.1 Feedback Loops
        • 11.2 Switch
        • 11.3 Map Over Collection
      • 12. Builder Creation
        • 12.1 From Wiring to Builders
        • 12.2 Builder Types
      • 13. Implementation Notes
        • 13.1 Additional Decorators
        • 13.2 Complete WiringNodeType Enum
        • 13.3 WiringNodeInstanceContext
      • 14. Reference Locations
      • 14. Next Steps
    • Part IV: Runtime System
      • 1. Introduction
      • 2. Lifecycle
        • 2.1 State Machine
        • 2.2 Lifecycle Methods
        • 2.3 Lifecycle Guarantees
      • 3. Graph
        • 3.1 Graph Structure
        • 3.2 Graph Properties
      • 4. Scheduler
        • 4.1 Scheduling Model
        • 4.2 Scheduling Operations
        • 4.3 Priority Ordering
      • 5. Clock
        • 5.1 Clock Types
        • 5.2 Clock Properties
        • 5.3 Time Semantics
      • 6. Evaluation Loop
        • 6.1 Main Loop
        • 6.2 Evaluation Phases Per Tick
        • 6.3 Node Evaluation
      • 7. Notification System
        • 7.1 Notification Flow
        • 7.2 Notification Idempotency
        • 7.3 Parent Chain Notification
      • 8. Input/Output Binding
        • 8.1 Binding Model
        • 8.2 Binding Operations
        • 8.3 Binding Effects
      • 9. Active/Passive Subscriptions
        • 9.1 Subscription Model
        • 9.2 State Transitions
        • 9.3 Subscription Use Cases
      • 10. Modification Tracking
        • 10.1 Tracking Invariant
        • 10.2 Tracking Implementation
        • 10.3 Modification Propagation
      • 11. Error Handling
        • 11.1 Error Types
        • 11.2 Error Propagation
        • 11.3 Error Outputs
      • 12. Execution Modes
        • 12.1 Simulation Mode
        • 12.2 Real-Time Mode
        • 12.3 Mode Comparison
      • 13. Injectable Types
        • 13.1 Available Injectables
        • 13.2 Usage
        • 13.3 Injection Lifecycle
      • 14. Engine Configuration
        • 14.1 Configuration Options
        • 14.2 run_graph Function
      • 15. Thread Safety
        • 15.1 Threading Model
        • 15.2 Push Source Threading
      • 16. Implementation Notes
        • 16.1 Push Source Node Processing Phase
        • 16.2 Field-Level Modification Tracking (TSB)
        • 16.3 Node Evaluation Guard Conditions
        • 16.4 Node-Level Scheduling (NodeSchedulerImpl)
      • 17. Reference Locations
      • 17. Next Steps
    • Part V: Time-Series Types
      • 1. Introduction
      • 2. Common Properties
        • 2.1 Property Table
        • 2.2 Modification Semantics
      • 3. TS[T] - Scalar Time-Series
        • 3.1 Type Definition
        • 3.2 Properties
        • 3.3 Output Operations
        • 3.4 Input Operations
        • 3.5 Memory Layout
      • 4. TSB[Schema] - Time-Series Bundle
        • 4.1 Type Definition
        • 4.2 Schema Definition
        • 4.3 Properties
        • 4.4 Field Access
        • 4.5 Field Modification
        • 4.6 Memory Layout
      • 5. TSL[T, Size] - Time-Series List
        • 5.1 Type Definition
        • 5.2 Properties
        • 5.3 Element Access
        • 5.4 Modification Tracking
        • 5.5 Memory Layout
      • 6. TSD[K, V] - Time-Series Dictionary
        • 6.1 Type Definition
        • 6.2 Properties
        • 6.3 Key Operations
        • 6.4 Delta Semantics
        • 6.5 Output Operations
        • 6.6 Memory Layout
      • 7. TSS[T] - Time-Series Set
        • 7.1 Type Definition
        • 7.2 Properties
        • 7.3 Set Operations
        • 7.4 Delta Semantics
        • 7.5 Output Operations
      • 8. TSW[T, Size] - Time-Series Window
        • 8.1 Type Definition
        • 8.2 Properties
        • 8.3 Window Access
        • 8.4 Window Behavior
        • 8.5 Memory Layout
      • 9. REF[T] - Time-Series Reference
        • 9.1 Type Definition
        • 9.2 Properties
        • 9.3 Reference Semantics
        • 9.4 Reference Operations
        • 9.5 Two Modification Conditions
        • 9.6 Use Cases
      • 10. Validity Semantics
        • 10.1 Validity Rules
        • 10.2 Validity Propagation
      • 11. Delta Value Semantics
        • 11.1 Delta Types by Time-Series
        • 11.2 Delta Accumulation
      • 12. Input/Output Architecture
        • 12.1 Overview
        • 12.2 Input Properties
        • 12.3 Output Properties
        • 12.4 Active vs Passive Subscriptions
      • 13. Setting Values on Outputs
        • 13.1 Scalar Time-Series (TS[T])
        • 13.2 Time-Series Bundle (TSB)
        • 13.3 Time-Series Dictionary (TSD)
        • 13.4 Time-Series List (TSL)
        • 13.5 Time-Series Set (TSS)
      • 14. Delta Value Creation
        • 14.1 How Delta Values Are Computed
        • 14.2 Delta Composition for Nested Types
        • 14.3 Modification Tracking
        • 14.4 Parent Chain Notification
      • 15. REF Operations and Binding Semantics
        • 15.1 Reference Types
        • 15.2 Binding Operations
          • REF → REF Binding (Observer Pattern)
          • TS → REF Binding (Non-Peered)
          • REF → TS Binding (Dereferencing)
        • 15.3 Peer vs Non-Peer Semantics
          • State Delegation Differences
          • Peering Rules for Collections
        • 15.4 REF Input State Properties
        • 15.5 Reference Observer Pattern
        • 15.6 Dynamic Reference Switching
        • 15.7 UnBound References for Collections
        • 15.8 Empty References
        • 15.9 Binding Summary Table
      • 16. Type Conversion
        • 16.1 Scalar to Time-Series
        • 16.2 Collection to Time-Series
        • 16.3 Time-Series Unwrapping
      • 17. Reference Locations
      • 18. Next Steps
    • Part VI: Node Types
      • 1. Introduction
      • 2. Node Base Properties
        • 2.1 Common Properties
        • 2.2 Node Lifecycle
        • 2.3 Evaluation Trigger
      • 3. Compute Node
        • 3.1 Declaration
        • 3.2 Properties
        • 3.3 Evaluation Semantics
        • 3.4 Return Value Handling
        • 3.5 Multiple Outputs (Bundle)
      • 4. Sink Node
        • 4.1 Declaration
        • 4.2 Properties
        • 4.3 Use Cases
        • 4.4 No Return Value
      • 5. Push Source Node
        • 5.1 Declaration
        • 5.2 Properties
        • 5.3 Sender Pattern
        • 5.4 Implementation Pattern
        • 5.5 Restrictions
      • 6. Pull Source Node
        • 6.1 Declaration
        • 6.2 Properties
        • 6.3 Scheduling Pattern
        • 6.4 Scheduler Access
      • 7. Generator
        • 7.1 Declaration
        • 7.2 Properties
        • 7.3 Execution Pattern
        • 7.4 Time Control
      • 8. Graph
        • 8.1 Declaration
        • 8.2 Properties
        • 8.3 Expansion Behavior
        • 8.4 No Runtime Representation
      • 9. Operator
        • 9.1 Declaration
        • 9.2 Properties
        • 9.3 Overload Resolution
        • 9.4 Generic Rank Calculation
      • 10. Service Infrastructure
        • 10.1 Service Definition
        • 10.2 Service Implementation
        • 10.3 Service Types
        • 10.4 Service Flow
      • 11. Special Nodes
        • 11.1 Const
        • 11.2 Feedback
        • 11.3 Switch
        • 11.4 Map
      • 12. Injectable Parameters
        • 12.1 STATE
        • 12.2 SCHEDULER
        • 12.3 CLOCK
        • 12.4 OUTPUT
      • 13. Node Decorators
        • 13.1 Common Decorator Parameters
        • 13.2 Example
      • 14. Error Handling in Nodes
        • 14.1 Error Output
        • 14.2 Exception Propagation
      • 15. Reference Locations
      • 16. Next Steps
    • Part VII: Operators and Standard Library
      • 1. Introduction
      • 2. Arithmetic Operators
        • 2.1 Binary Arithmetic
        • 2.2 Unary Arithmetic
        • 2.3 Type Signatures
        • 2.4 Example
      • 3. Comparison Operators
        • 3.1 Comparison Functions
        • 3.2 Type Signatures
        • 3.3 Example
      • 4. Logical Operators
        • 4.1 Boolean Operations
        • 4.2 Type Signatures
        • 4.3 Short-Circuit Behavior
      • 5. Flow Control
        • 5.1 Conditional Functions
        • 5.2 if_
        • 5.3 switch_
        • 5.4 gate
        • 5.5 sample
      • 6. Collection Operations
        • 6.1 TSD (Dictionary) Operations
        • 6.2 TSL (List) Operations
        • 6.3 TSS (Set) Operations
        • 6.4 Map Operations
        • 6.5 Reduce Operations
      • 7. Window Operations
        • 7.1 Window Creation
        • 7.2 Window Functions
        • 7.3 Example
      • 8. Temporal Operations
        • 8.1 Time Functions
        • 8.2 Scheduling Functions
        • 8.3 Example
      • 9. Aggregation Functions
        • 9.1 Basic Aggregations
        • 9.2 Statistical Aggregations
        • 9.3 Time-Weighted
      • 10. String Operations
        • 10.1 String Functions
        • 10.2 Example
      • 11. Mathematical Functions
        • 11.1 Basic Math
        • 11.2 Trigonometric
      • 12. Utility Functions
        • 12.1 Type Conversion
        • 12.2 Default Values
        • 12.3 Debugging
        • 12.4 Example
      • 13. Collection Constructors
        • 13.1 const
        • 13.2 nothing
        • 13.3 feedback
      • 14. Higher-Order Functions
        • 14.1 map_
        • 14.2 filter_
        • 14.3 reduce_
        • 14.4 fold_
      • 15. Operator Overloading
        • 15.1 Arithmetic Operators
        • 15.2 Comparison Operators
        • 15.3 Logical Operators
        • 15.4 Indexing
      • 16. Extending Operators
        • 16.1 Creating New Operators
        • 16.2 Adding Overloads
        • 16.3 Overload Resolution
        • 16.4 Generic Rank
        • 16.5 Import Requirements
      • 17. Reference Locations
      • 18. Standard Library Reference Locations
      • 19. Summary
    • Part VIII: Advanced Concepts
      • 1. Introduction
      • 2. Operator Overloading
        • 2.1 The @operator Decorator
        • 2.2 Registering Overloads
        • 2.3 Complete Working Example
        • 2.4 Overload Resolution
        • 2.5 Generic Rank System
        • 2.6 Real-World Example: Number Operators
        • 2.7 Python Operator Mapping
        • 2.8 Import Requirements
      • 3. Custom Resolvers
        • 3.1 AUTO_RESOLVE Sentinel
        • 3.2 Custom Resolver Functions
        • 3.3 Resolver Function Signatures
        • 3.4 Resolution Process
        • 3.5 Resolver Examples
        • 3.6 Unit Test Example
      • 4. Services
        • 4.1 Service Types Overview
        • 4.2 Subscription Service
        • 4.3 Reference Service
        • 4.4 Request-Reply Service
        • 4.5 Multi-Service Implementation
        • 4.6 Service Registration
      • 5. Adaptors
        • 5.1 Single-Client Adaptor
        • 5.2 Multi-Client Service Adaptor
      • 6. Components
        • 6.1 Definition
        • 6.2 With Dynamic Recordable ID
        • 6.3 Complete Record/Replay Example
        • 6.4 Characteristics
        • 6.5 Record/Replay Integration
      • 7. Error Handling
        • 7.1 try_except Pattern
        • 7.2 Complete Working Examples
        • 7.3 exception_time_series
        • 7.4 Parameters
        • 7.5 Exception Output by Node Type
        • 7.6 NodeError Type
      • 8. Reference Locations
      • 9. Next Steps
    • Part IX: Control Flow
      • 1. Introduction
      • 2. switch_ (Dynamic Graph Selection)
        • 2.1 Overview
        • 2.2 Execution Model
        • 2.3 Complete Working Examples
        • 2.4 Parameters
        • 2.5 Key Characteristics
      • 3. map_ (Multiplexed Computation)
        • 3.1 Overview
        • 3.2 Execution Model
        • 3.3 Complete Working Examples
        • 3.4 Input Markers
        • 3.5 Explicit Key Control
        • 3.6 Parameters
        • 3.7 Key Characteristics
      • 4. reduce_ (Collection Aggregation)
        • 4.1 Overview
        • 4.2 Complete Working Examples
        • 4.3 Reduction Strategies
        • 4.4 Tree-Reduce Algorithm
        • 4.5 Parameters
        • 4.6 Constraints
      • 5. mesh_ (Interconnected Map)
        • 5.1 Overview
        • 5.2 Complete Working Examples
        • 5.3 Execution Model
        • 5.4 Parameters
        • 5.5 Accessing Mesh
        • 5.6 Restrictions
      • 6. feedback (Cycle Creation)
        • 6.1 Overview
        • 6.2 Execution Model
        • 6.3 Complete Working Examples
        • 6.4 Parameters
        • 6.5 Best Practices
      • 7. dispatch (Runtime Type Dispatch)
        • 7.1 Overview
        • 7.2 Runtime Selection
        • 7.3 Parameters
        • 7.4 dispatch_ Function
      • 8. nested_graph (Reference-Based Composition)
        • 8.1 Overview
        • 8.2 Behavior
      • 9. lift (Scalar to Time-Series)
        • 9.1 Overview
        • 9.2 Behavior
        • 9.3 Parameters
      • 10. Context (Time-Series Context Managers)
        • 10.1 Overview
        • 10.2 Functions
      • 11. Input Markers
        • 11.1 Available Markers
        • 11.2 Usage
      • 12. Summary Table
      • 13. Reference Locations
      • 14. Next Steps
    • Part X: Data Sources and Record/Replay
      • 1. Introduction
      • 2. Pull Source Nodes
        • 2.1 @pull_source_node Decorator
        • 2.2 Scheduling Pattern
        • 2.3 With Scheduler Access
        • 2.4 Context Wiring Pattern
        • 2.5 Characteristics
      • 3. Push Source Nodes
        • 3.1 @push_source_node Decorator
        • 3.2 Sender Pattern
        • 3.3 Characteristics
      • 4. Generator
        • 4.1 @generator Decorator
        • 4.2 Yield Format
        • 4.3 Real-World Examples
        • 4.4 Execution Model
        • 4.5 Injectable Parameters
        • 4.6 Error Handling
      • 5. Push Queue
        • 5.1 @push_queue Decorator
        • 5.2 Real-World Examples
        • 5.3 Batch Mode
        • 5.4 Elide Mode
        • 5.5 TSD (Time Series Dictionary) Queue
        • 5.6 Integration Patterns
        • 5.7 Parameters
      • 6. const_fn
        • 6.1 Overview
        • 6.2 Real-World Examples
        • 6.3 Characteristics
      • 7. Record/Replay System
        • 7.1 Overview
        • 7.2 API Definition
        • 7.3 Real-World Examples
        • 7.4 DataFrame Storage Backend
        • 7.5 Storage Configuration
      • 8. Source Node Comparison
      • 9. Execution Modes
        • 9.1 Simulation Mode
        • 9.2 Real-Time Mode
        • 9.3 Mode Selection
      • 10. const (Constant Source)
        • 10.1 Operator Signature
        • 10.2 Usage Examples
        • 10.3 Behavior
      • 11. nothing (Null Source)
        • 11.1 Operator Signature
        • 11.2 Usage
        • 11.3 Behavior
      • 12. Reference Locations
      • 13. Summary
hgraph
  • HGraph Concepts
  • View page source

HGraph Concepts

HGraph embodies a number of interesting and potentially unique ideas. In it’s simplest form HGraph is an advanced event processor. This section will describe the key concepts and patterns that make up the framework.

  • Run Loop Concept
    • Life-Cycle
    • Evaluation Loop
    • Nested Graphs
  • Node Based Computation
    • Source Node
      • Pull Source Node
      • Push Source Node
    • Compute / Sink Node
    • Node Scheduling
    • Node Activation
    • Node Outputs
    • Using REF to reduce activations
    • Tracing issues
      • IDE / Python debugger
      • Trace
      • Introspector
  • Typing System
    • Schema Based Types
    • Generics
    • Extending the Type Support
  • Time Series Types
    • Time-series properties
  • Dynamic Graphs
    • Map
      • Knowing the key
      • Manging the key set
      • You can’t touch this
    • Reduce
    • Switch
    • Mesh
  • Services
    • Reference Service
    • Subscription Service
    • Request Reply Service
Previous Next

© Copyright 2026, Howard Henson.

Built with Sphinx using a theme provided by Read the Docs.