Commit 2d69959
authored
Replace pandas-based LP file writing with polars implementation (#496)
* Replace pandas-based LP file writing with polars implementation
- Remove pandas-based LP writing functions and replace with polars versions
- Rename polars functions to remove '_polars' suffix for consistent API
- Create separate get_printers_scalar() for non-LP functions (highspy, gurobi, mosek)
- Update get_printers() to handle polars dataframes for LP writing
- Consolidate "lp" and "lp-polars" io_api options to use same implementation
- Remove unused imports and cleanup handle_batch function
* fix: restore NaN validation in polars-based variable bounds checking
The polars migration broke NaN validation because check_has_nulls_polars
only checked for null values, not NaN values. In polars, these are distinct
concepts. This fix enhances the validation to detect both null and NaN values
in numeric columns while avoiding type errors on non-numeric columns.
Fixes failing tests in test_inconsistency_checks.py that expected ValueError
to be raised when variables have NaN bounds.1 parent 12b0da3 commit 2d69959
3 files changed
+63
-428
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
8 | 12 | | |
9 | 13 | | |
10 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
363 | 363 | | |
364 | 364 | | |
365 | 365 | | |
366 | | - | |
| 366 | + | |
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
370 | | - | |
| 370 | + | |
371 | 371 | | |
372 | 372 | | |
373 | 373 | | |
374 | 374 | | |
375 | | - | |
376 | | - | |
| 375 | + | |
| 376 | + | |
377 | 377 | | |
| 378 | + | |
378 | 379 | | |
379 | 380 | | |
380 | | - | |
381 | | - | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
382 | 395 | | |
383 | 396 | | |
384 | 397 | | |
| |||
0 commit comments