Skip to content

Python API function, helicsFederateGetTag, does not pass error object to C API function. #118

@nathantgray

Description

@nathantgray

Describe the bug

Using the helicsFederateGetTag Python API function fails because the error object was not passed to the C function.
This can be fixed easily by adding the error object as is done in the helicsFederateSetTag function. However, other C API GetTag functions do not require the error argument, which suggests that it may be an error for the C API to require it.

To Reproduce

Use the helicsFederateGetTag function.

Steps to reproduce the behavior:

  1. Modify the helics user guide example such as fundamental_combo.
  2. Add tags to the ChargerConfig.json.
  "tags": {
    "Level": 3
  }, 
  1. Add a line to Charger.py to get the tag using helicsFederateGetTag(fed, "Level")
    logger.debug(f"Charger Level: {h.helicsFederateGetTag(fed, "Level")}")
  2. Run the case.
    TypeError: 'char *(*)(void *, char *, HelicsError *)' expects 3 arguments, got 2
    Environment (please complete the following information):
  • Operating System: Ubuntu Linux via Windows Subsystem for Linux (WSL)
  • Installation: pip install helics
  • helics and pyhelics version:
helics --version
helics, version 3.6.1

Python HELICS version 3.6.1

HELICS Library version 3.6.1 (2025-02-24)

Share the output of the following:

$ python -c "import helics as h; import json; print(json.dumps(h.helicsGetSystemInfo(), indent=4, sort_keys=True))"

as h; import json; print(json.dumps(h.helicsGetSystemInfo(), indent=4, sort_keys=True))"
{
"buildflags": " -static-libstdc++ -static-libgcc -O3 -DNDEBUG -static-libstdc++ -static-libgcc $<$<COMPILE_LANGUAGE:CXX>:-std=c++17>",
"compiler": "Unix Makefiles Linux-6.8.0-1017-azure:GNU-8.3.1",
"cores": [
"zmq",
"zmqss",
"tcp",
"tcpss",
"udp",
"ipc",
"interprocess",
"inproc"
],
"cpu": " 13th Gen Intel(R) Core(TM) i7-1355U",
"cpucount": 12,
"cputype": "x86_64",
"hostname": "WE50488",
"memory": "15815 MB",
"os": "Linux 5.15.167.4-microsoft-standard-WSL2 #1 SMP Tue Nov 5 00:21:55 UTC 2024",
"version": {
"build": "",
"major": 3,
"minor": 6,
"patch": 0,
"string": "3.6.0 (2024-12-09)"
},
"zmqversion": "ZMQ v4.3.5"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions