-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Right now custom type encoding and decoding is only possible to achieve with inheriting from the reader/writer classes and overriding the specific private functions. It would be ideal to have hooks (enc_hook and dec_hook) for full and easy user control. Challengingly we might have two use cases to support which are (1) the pre-processing of the single CSV field data into something ready to be converted to builtins and (2) actual encoding/decoding hooks over specific types including those that may be recursively found. It would also be ideal if the definition of these hooks could exist at class use time instead of class definition time. Such as:
with (
open("/mypath/file.tsv", "w") as handle,
TsvWriter(handle, MyMetric).with_encoder(???) as writer
):
passSimilarly for the reader:
with (
open("/mypath/file.tsv", "r") as handle,
TsvReader(handle, MyMetric).with_decoder(???) as reader
):
passMetadata
Metadata
Assignees
Labels
No labels