Skip to content

Add Packrift box benchmark converter#375

Open
Packrift wants to merge 1 commit into
fontanf:masterfrom
Packrift:packrift-box-converter
Open

Add Packrift box benchmark converter#375
Packrift wants to merge 1 commit into
fontanf:masterfrom
Packrift:packrift-box-converter

Conversation

@Packrift
Copy link
Copy Markdown

Summary

Adds scripts/convert_box_packrift.py to convert Packrift public ecommerce cartonization fixtures into box solver instances.

The script:

  • reads Packrift carton and order fixture CSVs from public URLs by default, or from local CSV paths
  • writes one packingsolver instance per order under data/box/packrift/cartonization-fixtures/<order_id>/
  • converts inch decimals into integer length units using a configurable scale, defaulting to thousandths of an inch
  • writes bins.csv, items.csv, and parameters.csv without committing generated data files to the repository

This follows the direction from #374: keep the data external and make future Packrift benchmark fixtures easy to convert.

Validation

python3 -m py_compile scripts/convert_box_packrift.py
rm -rf /tmp/packrift-packingsolver-test
python3 scripts/convert_box_packrift.py --output-dir /tmp/packrift-packingsolver-test
# generated and schema-checked 4 order instances

git diff --check

@fontanf
Copy link
Copy Markdown
Owner

fontanf commented May 15, 2026

Hi,

Thank you for the contribution

If I understand well, this script writes 4 instances containing 1 to 4 items. Is that right? Or do you have other CSV input files with more and larger instances?

@Packrift
Copy link
Copy Markdown
Author

Packrift commented May 20, 2026

Hi, yes, the default public fixture pair currently creates four small smoke-test instances.

I rechecked the current public CSVs:

  • fixture_cartons.csv: 5 carton rows
  • fixture_orders.csv: 4 order rows
  • generated instances: demo-small, demo-flat, demo-long, and demo-bulk
  • because item_count is mapped to COPIES, those generated instances have 1, 2, 1, and 4 item copies respectively

That small default set is intentional for now so the converter is easy to inspect and validate without adding generated data files to the repository.

The converter itself is not limited to those four examples. It accepts --orders and --cartons as either URLs or local CSV paths, then groups any number of rows by order_id and emits one box instance per order. I do not currently have a larger Packrift order/cartonization CSV published in exactly this schema in that corpus, but I can prepare one as a separate public fixture pack if that would be useful.

Would you prefer this PR to stay as the converter/integration piece only, or should I add/publish a larger Packrift fixture CSV and wire the converter to that in a follow-up?

@fontanf
Copy link
Copy Markdown
Owner

fontanf commented May 21, 2026

The goal is to add new benchmark instances to help evaluate the solver's performances. So I need a CSV file with larger and realistic inputs. You don't need to include it in the PR, you can just give the link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants