GMLC-TDC / pyhelics

CFFI Python interface for HELICS
https://python.helics.org
BSD 3-Clause "New" or "Revised" License
3 stars 8 forks source link

Inconsistent naming HELICS property constants #102

Closed trevorhardy closed 2 months ago

trevorhardy commented 3 months ago

Describe the bug When trying to use the Pythonic API, getting the time period requires using the name "TIME_PERIOD" for the property while accessing the same property with the C-API uses the name "HELICS_PROPERTY_TIME_PROPERTY". The naming should be consistent across the APIs.

To Reproduce Steps to reproduce the behavior:

Example of working versions of the C- and Pythonic API are provided in the HELICS-Examples repository.

Environment (please complete the following information):

helics, version v3.4.0

Python HELICS version v3.4.0

HELICS Library version 3.4.0 (2023-01-19)

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

{ "buildflags": " -O3 -DNDEBUG $<$:-std=c++17>", "compiler": "Unix Makefiles Darwin-21.6.0:AppleClang-14.0.0.14000029", "cores": [ "zmq", "zmqss", "tcp", "tcpss", "udp", "ipc", "interprocess", "inproc" ], "cpu": "Apple M1 Max", "cpucount": 10, "cputype": "x86_64", "hostname": "WD86465", "memory": "32768 MB", "os": "Darwin 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000", "version": { "build": "", "major": 3, "minor": 5, "patch": 2, "string": "3.5.2 (2024-04-08)" }, "zmqversion": "ZMQ v4.3.5" }

josephmckinsey commented 3 months ago

Currently, it appears that fed.property[h.HELICS_PROPERTY_TIME_PERIOD] already works as well.

Are you suggesting that we deprecate the string checking on the property accessors?

trevorhardy commented 2 months ago

I think this is user error on my part. I thought I had used the Pythonic API HELICS property access before without having to specify the constant as being in the HELICS library (e.g. "h. ....") but I'm probably mis-remembering. I was able to replicate correct operation using the above constant.