You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Python bindings, merged in #184, are non-functional. Some immediate issues:
get_energy_consumption_measures() does not actually return any consumption measures; it returns an empty list. This is because it just calls generate_topology() and iterates over the generated Topology's record_buffer, which is empty as the topology was just generated (Topology::new() does record_buffer =vec![]).
The PR claimed to add Python documentation, but it merely added an empty Sphinx harness.
The supplied Makefile does not work as intended: make install fails due to $(eval TARGET_WHEEL := $(shell ls ../target/wheels/scaphandre-${PACKAGE_VERSION}-*.whl)) looking for the wheel in the parent directory's target/ instead of its own target/, where maturin build was just run.
Even the string representation of the class is broken: from scaphandre import Scaphandre; s = Scaphandre(); print(s); results in AttributeError, because the dataclass (which includes all fields in the generated __repr__() unless one specifies repr=False) is defined with sensor_name: str whilst the __init__() sets self.name.
Furthermore, the bindings deviate from Scaphandre itself: why is the sensor called _scaphandre instead of sensor, for instance? Given that these are "official" bindings, I think they should have a structure similar to the Rust implementation, or at least be more clearly defined and documented.
I guess all of this ties in with #50; since it's not clear how to use Scaphandre as a Rust crate, making bindings to another language is potentially even less clear. Most of these issues are easily fixable, though, but I do question why these bindings were merged in the first place.
Anyway, I hope this is of help. :-)
The text was updated successfully, but these errors were encountered:
The Python bindings, merged in #184, are non-functional. Some immediate issues:
get_energy_consumption_measures()
does not actually return any consumption measures; it returns an empty list. This is because it just callsgenerate_topology()
and iterates over the generated Topology'srecord_buffer
, which is empty as the topology was just generated (Topology::new()
doesrecord_buffer =vec![]
).make install
fails due to$(eval TARGET_WHEEL := $(shell ls ../target/wheels/scaphandre-${PACKAGE_VERSION}-*.whl))
looking for the wheel in the parent directory'starget/
instead of its owntarget/
, wherematurin build
was just run.from scaphandre import Scaphandre; s = Scaphandre(); print(s);
results inAttributeError
, because the dataclass (which includes all fields in the generated__repr__()
unless one specifiesrepr=False
) is defined withsensor_name: str
whilst the__init__()
setsself.name
._scaphandre
instead ofsensor
, for instance? Given that these are "official" bindings, I think they should have a structure similar to the Rust implementation, or at least be more clearly defined and documented.I guess all of this ties in with #50; since it's not clear how to use Scaphandre as a Rust crate, making bindings to another language is potentially even less clear. Most of these issues are easily fixable, though, but I do question why these bindings were merged in the first place.
Anyway, I hope this is of help. :-)
The text was updated successfully, but these errors were encountered: