remove np object, make default str

This commit is contained in:
Timothy Pogue 2022-10-24 12:23:54 -06:00
parent 4d2b7a74f1
commit 51be45547f

View File

@ -211,10 +211,10 @@ def record_params(config: Dict[str, Any], full_path: Path) -> None:
}
with open(params_record_path, "w") as handle:
rapidjson.dump(run_params, handle, indent=4, default=np_encoder,
number_mode=rapidjson.NM_NATIVE)
def np_encoder(self, object):
if isinstance(object, np.generic):
return object.item()
rapidjson.dump(
run_params,
handle,
indent=4,
default=str,
number_mode=rapidjson.NM_NATIVE
)