Skip to content

Conversation

@PGijsbers
Copy link
Collaborator

Addresses some concerns raised in #718. Mainly:

  • If run_flow_on_task is called, and the flow has no model, it is now automatically reinstantiated if requirements are satisfied.
  • An error with descriptive message is raised if requirements are not satisfied.

Not addressed:

  • Reinstantiating models if versions mismatch but would otherwise seem possible.

…is not possible. Automatically reinstantiate flow model if possible when run_flow_on_task is called.
@PGijsbers PGijsbers requested a review from amueller June 28, 2019 10:25
Copy link
Collaborator

@mfeurer mfeurer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, but it would be great if you could check for the new error message in the unit tests.

self.assertEqual(server_flow.parameters['categories'], '[[0, 1], [0, 1]]')
self.assertEqual(server_flow.model.categories, flow.model.categories)

def test_get_flow_reinstantiate_model(self):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appears to be a simple version of tests.test_flows.test_flows:TestFlow.test_sklearn_to_upload_to_flow. Could you please check that?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it might be good to have such a test next to the one below.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think tests.test_flows.test_flows:TestFlow.test_sklearn_to_upload_to_flow ever actually tests if the model is reinstantiated properly. I think the model is ignored by both assert_flows_equal and _to_xml.
Of course, it is easy to add the check there. But I think it's good to test for this separately from such a complicated flow setup. If this unit test fails, it's very likely due to an error in reinstantiation. If the other test fails, it can be due to any number of reasons, such as serializing subflows, generating xml, etc.


def test_get_flow_reinstantiate_model_no_extension(self):
# Flow 10 is a WEKA flow
self.assertRaises(RuntimeError, openml.flows.get_flow, flow_id=10, reinstantiate=True)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please use the more specific assertRaisesRegex? Then you can check for the new error message you added.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@PGijsbers PGijsbers marked this pull request as ready for review July 8, 2019 16:25
@PGijsbers
Copy link
Collaborator Author

Seem to be random errors with E openml.exceptions.OpenMLServerException: https://test.openml.org/api/v1/xml/task/ returned code 614: Task already exists. and trace...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants