Skip to content

fix: field bus forwarder CIM profile, argument order, and mrid option (GPY-003)#222

Open
craigpnnl wants to merge 2 commits into
developfrom
fix/gpy-003-field-proxy-forwarder
Open

fix: field bus forwarder CIM profile, argument order, and mrid option (GPY-003)#222
craigpnnl wants to merge 2 commits into
developfrom
fix/gpy-003-field-proxy-forwarder

Conversation

@craigpnnl

Copy link
Copy Markdown
Contributor

Summary

Three related fixes to the field bus proxy forwarder, all surfaced during the GPY-003 investigation.

  • FieldProxyForwarder imported cimgraph.data_profile.cimhub_ufls unconditionally at module scope. That profile no longer exists in the pinned cim-graph release, so any import of the module raised ModuleNotFoundError. Replaced it with a configurable cim_profile constructor parameter (default cimhub_2023), resolved dynamically via importlib.import_module, mirroring the pattern already used in agents.py. Verified cimhub_2023 exposes both DistributionArea and Substation, which is everything the constructor needs.
  • The CLI in forwarder.py called FieldProxyForwarder(username, password, connection_url, None) against a constructor signature of (connection_url, username, password, mrid). Username landed in the connection_url slot, and no mrid was ever passed, so substation discovery could not work even once the import bug above is fixed. The call now passes each value by keyword into the correct slot.
  • The CLI had no way to supply an mrid at all. Added a --mrid click option (with a GRIDAPPSD_FIELD_BUS_MRID environment fallback, matching the existing option style) and threaded it into the corrected constructor call.

Added a unit smoke test that imports the forwarder module and asserts the resolved default CIM profile exposes DistributionArea and Substation, so a future profile default swap that regresses this cannot merge silently. The test does not instantiate FieldProxyForwarder and does not stand up any broker or Blazegraph instance, since the constructor connects to live infrastructure.

Test plan

  • New test test_field_proxy_forwarder_cim_profile.py passes
  • Full field-bus test suite passes (excluding the Docker-dependent Artemis test, which needs a live container)
  • start-field-bus-forwarder --help shows the new --mrid option
  • No version fields touched (pixi.toml, both pyproject.toml files)
  • Working tree clean; the compute_req_log.txt side effect from importing gridappsd (tracked separately as GPY-004) was restored, not committed

Replace the module-level import of cimgraph.data_profile.cimhub_ufls,
which no longer exists in the pinned cim-graph release, with a
configurable cim_profile constructor parameter defaulting to
cimhub_2023, mirroring the resolution pattern already used in
agents.py. Verified against the pinned cim-graph package that
cimhub_2023 exposes both DistributionArea and Substation.

Adds a unit smoke test asserting the module imports cleanly and the
default profile exposes DistributionArea and Substation.
…tion

The forwarder CLI called FieldProxyForwarder(username, password,
connection_url, None) against a constructor signature of
(connection_url, username, password, mrid), so username landed in the
connection_url slot and no mrid was ever supplied, which broke
substation discovery. Fixed the call to pass each value into the
correct keyword slot.

Also add a --mrid click option (with a GRIDAPPSD_FIELD_BUS_MRID
environment fallback, matching the existing option style) so the CLI
has a way to supply the mrid the constructor requires.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant