Adding interface class and local interface implementation#90
Adding interface class and local interface implementation#90
Conversation
phil-brad
left a comment
There was a problem hiding this comment.
I think it would be a good idea to add top-level run and inspect functions so that a user can simply do spawn.run(...), which mirrors the the CLI functionality. As a user I would expect to be able to do this. I think with your design of the interface classes, these top-level function can just build and call the appropriate interface class
…ferences introduced
|
Following code errors for me inside import json
import spawn
with open('example_data/example_spec.json') as fp:
spec_dict = json.load(fp)
spawn.inspect(spec_dict)Also as a user, I would expect to be able to do def inspect(spec_dict, outfile=None, format='txt', **kwargs) |
I don't think this is the right way to go as it muddies the interface significantly. However I'd be happy with an additional method, |
|
Also, the definition is flexible, allowing |
|
OK - I've merged this! On the However, I do still feel that there should be a top-level function where config parameters are default arguments. I saw that it could be a dict, but having it as a dict obfuscates the options a little because the user's IDE won't hint and the docstrings for that function can't tell them the options. It means they have to look into the config part of the docs which may not be immediately obvious to them. It's not about code design - which is clearly good, it's about offering a top-level wrapper function that delivers maximum usability. If you look at any major python package then it generally has top-level functions with a long list of default arguments (e.g. Alternatively, I could implement such top-level functions in spawn-wind but leave them out of the core spawn. |
Closes #76