Skip to content

Commit

Permalink
docs(snapshots): mention binary snapshot portability issues (MODFLOW-…
Browse files Browse the repository at this point in the history
…USGS#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
  • Loading branch information
wpbonelli authored Jun 19, 2024
1 parent 90316a1 commit 1883647
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/md/snapshots.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,8 @@ pytest_plugins = [ "modflow_devtools.snapshots" ]

## Disable snapshots

Snapshot comparisons can be disabled by invoked `pytest` with the `--snapshot-disable` flag.
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.

0 comments on commit 1883647

Please sign in to comment.