Conversation
| DEFAULT_GRADIENT_MODE_SETTINGS = { | ||
| "mode": "X", | ||
| "weight_mode": "linear", | ||
| "pick_mode": "linear", | ||
| "description": "Linear gradient in the X direction", | ||
| "reversed": False, # is the direction of the vector reversed? | ||
| "invert": None, # options: "weight", "distance" | ||
| "mode_settings": {}, | ||
| "weight_mode_settings": {}, | ||
| } |
There was a problem hiding this comment.
moving the constant to recipe model to keep things centralized
| weight_mode: Optional[WeightMode] = None | ||
| reversed: Optional[bool] = None | ||
| invert: Optional[bool] = None | ||
| invert: Optional[InvertOptions] = None |
There was a problem hiding this comment.
fixed invert type to be string to match the settings in gradient_data.py
There was a problem hiding this comment.
merging gradient constants, classes, and settings here from archived gradient_data.py
|
@mogres Found a potential bug when running |
mogres
left a comment
There was a problem hiding this comment.
Looks great!! Thanks for the quick fix!
There was a problem hiding this comment.
It would be nice to still have this test for gradient data with the new validation schema, but that can be a separate PR.
mogres
left a comment
There was a problem hiding this comment.
@mogres Found a potential bug when running
pack -r cellpack/tests/recipes/v2/test_combined_gradient.json. the progress bar shows as incomplete even though the packing ran through, likely a separate bug to fix.2025-10-21 09:54:44 | root | INFO | pack:55 | pack() | Packing recipe: test_combined_gradient 2025-10-21 09:54:44 | root | INFO | pack:56 | pack() | Outputs will be saved to out/test_combined_gradient/spheresSST Packing test_combined_gradient_1.0.0: 26%|████████████████████▊ | 132/500 [00:00<00:01, 353.48it/s] 2025-10-21 09:54:46 | root | INFO | pack:101 | main() | Workflow completed in 2.0s`
This probably happens because cellPACK is unable to pack all 500 spheres. We can log a warning if the actual number of packed objects is not equal to the request number as an indicator.
mogres
left a comment
There was a problem hiding this comment.
Packed some test gradient recipes and they worked as expected!



Problem
closes #414
Solution
Type of change
Steps to Verify:
pack -r cellpack/tests/recipes/v2/test_combined_gradient.json