base-stats,python: Update PyBind11 ScalarInfo fields to readonly
This change keeps the ScalarInfo class consistent with the other Info classes exposed via PyBind11. Change-Id: I4d420d509e4654de844e75f58aeaaf67109775d3 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41693 Reviewed-by: Jason Lowe-Power <power.jg@gmail.com> Maintainer: Jason Lowe-Power <power.jg@gmail.com> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
@@ -149,9 +149,15 @@ pybind_init_stats(py::module_ &m_native)
|
||||
py::class_<Stats::ScalarInfo, Stats::Info,
|
||||
std::unique_ptr<Stats::ScalarInfo, py::nodelete>>(
|
||||
m, "ScalarInfo")
|
||||
.def("value", &Stats::ScalarInfo::value)
|
||||
.def("result", &Stats::ScalarInfo::result)
|
||||
.def("total", &Stats::ScalarInfo::total)
|
||||
.def_property_readonly("value", [](const Stats::ScalarInfo &info) {
|
||||
return info.value();
|
||||
})
|
||||
.def_property_readonly("result", [](const Stats::ScalarInfo &info) {
|
||||
return info.result();
|
||||
})
|
||||
.def_property_readonly("total", [](const Stats::ScalarInfo &info) {
|
||||
return info.total();
|
||||
})
|
||||
;
|
||||
|
||||
py::class_<Stats::VectorInfo, Stats::Info,
|
||||
|
||||
Reference in New Issue
Block a user