diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-05-19 17:45:14 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-05-19 17:45:14 +0200 |
| commit | 62d87e063318cc4c842b1b2d8c184f48aeaf6659 (patch) | |
| tree | 832bf338232c477975bea69f7370ca13f350fb07 /python | |
| parent | 8b94d135429a9f3253cc7f25a1453b412065c4a0 (diff) | |
| download | nissy-core-62d87e063318cc4c842b1b2d8c184f48aeaf6659.tar.gz nissy-core-62d87e063318cc4c842b1b2d8c184f48aeaf6659.zip | |
Refactored checkdata
Relevant changes include:
- Changed the signature of nissy_checkdata().
- Removed expected_distribution.h from tools; this data is now included
in each solver's src/ code.
- Removed distribution check for cocsep; may add back later.
Diffstat (limited to '')
| -rw-r--r-- | python/nissy_module.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/python/nissy_module.c b/python/nissy_module.c index 5f5c0c4..3e5ea08 100644 --- a/python/nissy_module.c +++ b/python/nissy_module.c | |||
| @@ -239,21 +239,23 @@ PyDoc_STRVAR(checkdata_doc, | |||
| 239 | "Checks if the data (pruning table) given is valid or not\n" | 239 | "Checks if the data (pruning table) given is valid or not\n" |
| 240 | "\n" | 240 | "\n" |
| 241 | "Parameters:\n" | 241 | "Parameters:\n" |
| 242 | " - data: a bytearray containing the data for a solver" | 242 | " - solver: the name of the solver\n" |
| 243 | " - data: a bytearray containing the data for a solver\n" | ||
| 243 | "\n" | 244 | "\n" |
| 244 | "Returns: true if the data is valid, false otherwise\n" | 245 | "Returns: true if the data is valid, false otherwise\n" |
| 245 | ); | 246 | ); |
| 246 | PyObject * | 247 | PyObject * |
| 247 | checkdata(PyObject *self, PyObject *args) | 248 | checkdata(PyObject *self, PyObject *args) |
| 248 | { | 249 | { |
| 250 | const char *solver; | ||
| 249 | long long result; | 251 | long long result; |
| 250 | PyByteArrayObject *data; | 252 | PyByteArrayObject *data; |
| 251 | 253 | ||
| 252 | if (!PyArg_ParseTuple(args, "Y", &data)) | 254 | if (!PyArg_ParseTuple(args, "sY", &solver, &data)) |
| 253 | return NULL; | 255 | return NULL; |
| 254 | 256 | ||
| 255 | result = nissy_checkdata( | 257 | result = nissy_checkdata( |
| 256 | data->ob_alloc, (unsigned char *)data->ob_bytes); | 258 | solver, data->ob_alloc, (unsigned char *)data->ob_bytes); |
| 257 | 259 | ||
| 258 | if (check_error(result)) | 260 | if (check_error(result)) |
| 259 | return Py_True; | 261 | return Py_True; |
