common-workflow-lab/wdl-cwl-translator

Design classes and relationships for the OO approach

kinow opened this issue · 0 comments

kinow commented

Now that #107 is merged, we can work on the design of any class hierarchy & relationship needed for the rest of the code.

@Th3nn3ss just spent some time reading the code after your last changes in #107 , and from what I understand so far, I think (@mr-c feel free to chime-in and correct me if I said anything wrong, please 😬 )

  • miniwdl uses its own classes when parsing WDL; so the doc_tree object that you created is an instance of WDL.Document that contains a list of WDL.Task's
  • We can use miniwdl classes/objects
  • Then we convert these into CWL objects, using the classes from cwl_utils

So I think we may need very few classes just for the code that handles parsing the WDL and creating the CWL file.

We suggested to start by sketching the classes and hierarchy & relationships that you have in mind. From your previous work, you should be able to imagine a few possible classes. Don't be afraid in suggesting some initial structure, even if you are not too sure, or if it has some missing links in the relationships (e.g. you are not sure how two classes relate to each other, but you think they must exist and be related some way).

References

@Th3nn3ss good references for Python programming with (and without) OO:

  • Fluent Python (my local library has a copy, perhaps yours has a copy too?)
  • Python 3.9 documentation for classes (check out the other sections too)