NCAR / wrf_hydro_py

Python API for the WRF-Hydro model
59 stars 43 forks source link

tests failing because of pathlib.PosixPath types in pickled objects #169

Open kafitzgerald opened 5 years ago

kafitzgerald commented 5 years ago

test_simulation_pickle and test_simulation_sub_obj_pickle are currently failing because deepdiff can't compare the pathlib.PosixPath types within these objects.

Adding exclude_types={pathlib.PosixPath} as an argument to DeepDiff will make the tests pass, but may circumvent intended testing.

jmccreight commented 5 years ago

I wonder if changing them to pathlib.Path objects would do the trick as well.

jmccreight commented 5 years ago

pathlib.Path does not seem to fix.

kafitzgerald commented 5 years ago

Still sorting out details, but just documenting here that the tests fail starting with version 4 of deepdiff thus the fix w/ requiring v3.3.0.

jmccreight commented 5 years ago

ha: https://github.com/seperman/deepdiff/issues/103

jmccreight commented 5 years ago

I assume i subclassed this to avoid waiting forever for this PR, as in the second part: https://github.com/seperman/deepdiff/pull/104

Maybe that's what's breaking.... something changes WRT this subclass: https://github.com/NCAR/wrf_hydro_py/blob/d69f33c574a0453979681d8e30a476558d2697d9/wrfhydropy/core/ensemble_tools.py#L40

jmccreight commented 5 years ago

Fun with subclassing

kafitzgerald commented 5 years ago

Yeah, I think the updates to DeepDiff for v4 now trigger an exception which results in "unprocessed" output before your new function in the subclass deals with the pathlib.PosixPath stuff. I started trying to edit the subclass (unless we want to ignore these, that seems like the way to go), but ran out of time for now.