Cast channel_data to float at construction time#2341
Conversation
Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
PR SummaryLow Risk Overview Adds a regression test confirming that integer channel columns are converted to float in both Written by Cursor Bugbot for commit 7b09473. This will update automatically on new commits. Configure here. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2341 +/- ##
==========================================
- Coverage 93.18% 89.72% -3.47%
==========================================
Files 79 79
Lines 12472 12473 +1
==========================================
- Hits 11622 11191 -431
- Misses 850 1282 +432 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
|
||
| self.xarray_dataset = xr.merge(dataarrays).fillna(0) | ||
|
|
||
| if not np.issubdtype(self.xarray_dataset["_channel"].dtype, np.floating): |
There was a problem hiding this comment.
can't you just do astype(float) regardless?
Summary
_channeldata to float inMMM._generate_and_preprocess_model_data()immediately after building the xarray dataset, so all downstream consumers (scalers,pm.Data, budget optimizer, incrementality, sensitivity analysis) always see float data.Closes #2340
📚 Documentation preview 📚: https://pymc-marketing--2341.org.readthedocs.build/en/2341/