Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output values not encoding properly #19

Closed
thclark opened this issue Oct 6, 2020 · 2 comments
Closed

Output values not encoding properly #19

thclark opened this issue Oct 6, 2020 · 2 comments
Assignees
Labels
bug Unintended behaviour in any area of the app

Comments

@thclark
Copy link
Contributor

thclark commented Oct 6, 2020

In the yuriyfoil demo, the following code:

    # Assign to the analysis outputs
    for key, value in zip(('cl', 'cdp', 'cdv', 'cp_x', 'cp'), results):
        # TODO see issue 
        analysis.output_values[key] = value

Results in:

analysis-fa8f9ad9-8c01-4709-8e46-54ee8aada52d ERROR 2020-10-06 22:52:29,699 runner 1 140199177582336 array([0.25859084]) is not of type 'array'

Failed validating 'type' in schema['properties']['cl']:
    {'description': 'Output cl values corresponding to input alpha values',
     'items': {'type': 'number'},
     'title': 'cl',
     'type': 'array'}

On instance['cl']:
    array([0.25859084])

It's fixed by manually casting the numpy arrays to lists:

    # Assign to the analysis outputs
    for key, value in zip(('cl', 'cdp', 'cdv', 'cp_x', 'cp'), results):
        # TODO see issue
        analysis.output_values[key] = value.tolist()

Clearly, the output isn't getting correctly passed through the encoder

@thclark thclark self-assigned this Oct 6, 2020
@thclark thclark added the bug Unintended behaviour in any area of the app label Oct 6, 2020
@thclark
Copy link
Contributor Author

thclark commented Oct 6, 2020

It's to do with the outputs of the validation not being placed into the analysis object that gets returned from the runner:

            self.twine.validate(output_values=analysis.output_values)
            self.twine.validate(output_manifest=analysis.output_manifest)

        except Exception as e:
            analysis_logger.error(str(e))
            raise e

        return analysis

@thclark
Copy link
Contributor Author

thclark commented Oct 27, 2020

Here in twined server are the consequences of not getting properly serialised output. One has to convert it...

@thclark thclark added this to Twined v0.0.x in Twined Ecosystem Roadmap Nov 26, 2020
@thclark thclark closed this as completed May 10, 2021
Twined Ecosystem Roadmap automation moved this from Soon to Done May 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unintended behaviour in any area of the app
Projects
None yet
Development

No branches or pull requests

1 participant