Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/python/otsim/io/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ def get_type(typ: str) -> DataType:
return DataType.boolean
elif typ == 'double':
return DataType.double
elif typ == 'vector':
return DataType.vector
else:
return None

Expand Down Expand Up @@ -170,8 +172,11 @@ def action_subscriptions(self: IO, data: typing.Dict, _):
tag = self.tags[k]

if not tag: continue

points.append({'tag': tag, 'value': float(v), 'ts': 0})
if isinstance(v, list):
for i, x in enumerate(v):
points.append({'tag': f'{tag}_{i}', 'value': float(x), 'ts': 0})
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it assumed that the tags are 1-indexed, so these should be tag_1, tag_2, and tag_3, essentially matching the phase #?

Copy link
Copy Markdown
Contributor Author

@Astarry Astarry May 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is essentially whatever meaning the user assigns to the items in the list. Currently three phase+pyDss/opendss puts out a vector with 4 values, 3 phases+neutral, some other simulator could put out neutral, A, B, C, D. I think indexing from 0 is simpler (with associated ot-sim app changes), but I can switch to indexing from 1. I have confirmed functionality with a manual injection of ot-sim config.xml file with 3 phases.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, probably best to just leave it 0-indexed and let the user assign more specific meaning instead of assuming.

else:
points.append({'tag': tag, 'value': float(v), 'ts': 0})
self.metrics.incr_metric('helics_sub_count')

if len(points) > 0:
Expand Down