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
1 changed files with 7 additions and 7 deletions

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: with open(params_record_path, "w") as handle:
rapidjson.dump(run_params, handle, indent=4, default=np_encoder, rapidjson.dump(
number_mode=rapidjson.NM_NATIVE) run_params,
handle,
indent=4,
def np_encoder(self, object): default=str,
if isinstance(object, np.generic): number_mode=rapidjson.NM_NATIVE
return object.item() )