MCPcopy Create free account
hub / github.com/dds-bridge/dds / sequence_to_bounded_int_vector

Function sequence_to_bounded_int_vector

python/src/converters.cpp:33–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33auto sequence_to_bounded_int_vector(
34 const py::sequence& values,
35 const std::size_t expected_size,
36 const int minimum_value,
37 const int maximum_value,
38 const std::string& field_name) -> std::vector<int>
39{
40 const auto result = sequence_to_int_vector(values, expected_size, field_name);
41 for (const int value : result) {
42 if (value < minimum_value || value > maximum_value) {
43 throw py::value_error(
44 field_name + " has invalid value " + std::to_string(value) +
45 " (expected range " + std::to_string(minimum_value) + ".." +
46 std::to_string(maximum_value) + ")");
47 }
48 }
49
50 return result;
51}
52
53auto dict_to_deal(const py::dict& deal_input) -> Deal
54{

Callers 3

register_table_bindingsFunction · 0.85
dict_to_dealFunction · 0.85
pbn_to_dealFunction · 0.85

Calls 1

sequence_to_int_vectorFunction · 0.85

Tested by

no test coverage detected