Closed lyuyangh closed 1 year ago
Test is failing for some reason.
Thanks, @odashi! I fixed the tests.
A couple of pointers for what I changed:
Processor.process()
takes deserialized custom_features
and custom_analyses
(according to the README and the integration tests) so the deserialize logic in Processor._custom_analyses()
isn't necessary. That's why I removed it.MachineTranslationTest.test_custom_features()
was failing because dataclasses.asdict()
serializes the two fields to dict
but, as I mentioned above, Processor.process()
expects deserialized objects. I am not sure which fields are actually being used by the processor so I followed the current implementation and included all the fields from FileLoaderMetadata
when creating metadata
. When #575 is implemented, this code probably needs to be updated.Yeah, It looks the original code was weird, because {de}serialization is the IO feature and shouldn't be happened in any inner processes (Processor
here). The change looks good.
Also, in general we shouldn't use dataclasses.asdict
due to its too generic behavior: it expands all nested dataclasses in the object, that possibly brings several breakage into the code.
Overview
We allow
custom_features
andcustom_analyses
to be defined for each system. This information is provided as adict
and it may come from the dataset or the system output file provided by the user. In some cases, it is not deserialized so there is a type mismatch. This PR fixes the issue. Please see #596 for details.Details
References
Blocked by