Introducing MultiNodeObservation class#588
Conversation
- Updated NodeObservation class to allow creation of multiple observations by passing lists for node and item parameters. - Implemented auto-assignment of item indices when only nodes are provided and their count matches the number of data columns. - Added validation to ensure that the lengths of node, item, and name lists match when provided. - Enhanced documentation for NodeObservation to reflect new functionality. - Added unit tests to verify the new behavior, including auto-assignment and error handling for mismatched lengths.
…error handling for node input
ryan-kipawa
left a comment
There was a problem hiding this comment.
General comment: why is there no MultiPointObservation?
I am sort of questioning if we need such an abstraction. Do users need list-like functionality on a collection of observations, or is this more a convenience for constructing many observations from a single source?
One disadvantage I see is that it only works for collections of observations that share the same time index. If it's as a convenience function, then I wonder if it fits better as a static method or something like that on NodeObesrvation?
It is just for convenience, after our previous discussions on user-friendliness and a potential use case of one model vs multiple sensors. |
…prove node handling
Introduces
MultiNodeObservationclass to streamline creation of multiple node observations from a single data source, significantly improving the user experience for network model workflows.Changes
New Features
MultiNodeObservationclass: Creates multipleNodeObservationobjects from a single DataFrame or Dataset"S"→"S_0","S_1") and explicit name listsAPI Improvements
MultiNodeObservationto module docstring alongside existing observation typesobservation()patternsUsage Examples
Before (manual creation)
After (streamlined)
Benefits
Technical Details
listfor familiar collection behaviorNodeObservationfunctionalityThis enhancement makes network data handling more intuitive and reduces the cognitive load for users working with multi-node datasets.