Closed wpbonelli closed 4 months ago
@mwtoews I was mainly wondering what you thought of the optional import decision here. But I think it's probably best to keep using import_optional_dependency()
, will update to do so unless you disagree
@wpbonelli no strong opinions so far, I'm just finding time to look further at the methods. One further idea is to also support compressed array ".npz" using numpy.savez_compressed.
Thanks @mwtoews for the suggestion, savez_compressed()
also allows snapshots of multiple arrays at once. I pushed a commit drafting support for multiple arrays e.g.
def my_test(multi_array_snapshot):
...
arrays = {
"head": ...
"budget": ...
}
assert arrays == multi_array_snapshot
which is consistent with np.load()
returning a dict for multi-array .npz
files.
Looks like with npz files we get inconsistent binary encodings. Strange that it's only npz files and not npy files.
I will merge as-is so we can use this for PRT tests, but would be ideal to support snapshots of multiple arrays eventually.
use_pandas
fixture, originally meant for use in flopy tests for pandas support but never used and probably not needed, as flopyuse_pandas
flags will be removed eventually