Utilise model metadata to resolve model output type and shape #1184
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
For models such as eos78ao (Mordred Descriptor), Ersilia is not able to resolve the model's datatype in its API schema to a
numeric_array
because of the presence of Null values for some of the descriptors in the model output. We know that the model outputs, in the ideal case, consist of only integer and float values, therefore the the datatype field should be set tonumeric_array
.Changes
In this PR, a private method
_get_schema_type_for_simple_run_api_case
has been implemented to ascertain the model's output type and shape using model metadata fields such asOutput Type
andOutput Shape
. This method sets the fieldtype
in model's API schema tonumeric_array
, ifOutput Type
is set to Float andOutput Shape
is set to List in the model's metadata. This implementation currently only covers a single model API case, ie, therun
API.Status
Before this change, the API schema for the model eos78ao looked as follows:
After this change, the API schema looks as follows:
This issue is related to ersilia-os/zaira-chem#42