From 18836478af1093bfbd7101524ff6a58a172a41d7 Mon Sep 17 00:00:00 2001 From: wpbonelli Date: Tue, 18 Jun 2024 22:44:29 -0400 Subject: [PATCH] docs(snapshots): mention binary snapshot portability issues (#161) NumPy 2.0.0 changes the way arrays with object dtype are pickled: https://numpy.org/devdocs/release/2.0.0-notes.html#highlights --- docs/md/snapshots.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/md/snapshots.md b/docs/md/snapshots.md index 4b8a41b..726e5d9 100644 --- a/docs/md/snapshots.md +++ b/docs/md/snapshots.md @@ -18,4 +18,8 @@ pytest_plugins = [ "modflow_devtools.snapshots" ] ## Disable snapshots -Snapshot comparisons can be disabled by invoked `pytest` with the `--snapshot-disable` flag. \ No newline at end of file +Snapshot comparisons can be disabled by invoked `pytest` with the `--snapshot-disable` flag. + +## Caveats & gotchas + +NumPy major versions may introduce changes to `np.save()`'s binary format, causing binary array snapshot failures for arrays with object dtypes. To avoid this, check object (e.g. string) columns explicitly and then omit them from the comparison array. \ No newline at end of file