Skip to content

Commit 5953c84

Browse files
committed
Load data from HF
1 parent bad5cba commit 5953c84

3 files changed

Lines changed: 17 additions & 1 deletion

File tree

libCacheSim-python/libcachesim/dataset.py

Whitespace-only changes.

libCacheSim-python/src/pylibcachesim.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,15 @@ PYBIND11_MODULE(_libcachesim, m) { // NOLINT(readability-named-parameter)
144144
.def_readwrite("hv", &request_t::hv)
145145
.def_readwrite("obj_id", &request_t::obj_id)
146146
.def_readwrite("obj_size", &request_t::obj_size)
147-
.def_readwrite("op", &request_t::op);
147+
.def_readwrite("op", &request_t::op)
148+
// __repr__
149+
.def("__repr__", [](const request_t& self) {
150+
return "Request(clock_time=" + std::to_string(self.clock_time) +
151+
", hv=" + std::to_string(self.hv) + ", obj_id=" +
152+
std::to_string(self.obj_id) + ", obj_size=" +
153+
std::to_string(self.obj_size) + ", op=" + std::to_string(self.op) +
154+
")";
155+
});
148156

149157
/**
150158
* @brief Reader structure

scripts/install_python.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail # Enable strict error checking
4+
5+
pip install --upgrade pip
6+
pip install -r requirements.txt
7+
pip install pytest
8+
19
rm -rf ./build
210
cmake -G Ninja -B build
311
ninja -C build

0 commit comments

Comments
 (0)