@@ -138,65 +138,30 @@ DockerRequirement
138
138
Import CWL
139
139
==========
140
140
141
- CWLToolParser
142
- """""""""""""
141
+ As of release v0.3.0 the existing importing CWL has been replaced by an
142
+ automated deserialization. Each function that inherits from the :class: `Serializable `
143
+ class will have a ``parse_dict `` method.
143
144
144
- .. autoclass :: cwlgen.import_cwl.CWLToolParser
145
- :members:
146
- :private-members:
147
- :special-members:
148
- :exclude-members: __weakref_
149
-
150
- InputsParser
151
- """"""""""""
152
-
153
- .. autoclass :: cwlgen.import_cwl.InputsParser
154
- :members:
155
- :private-members:
156
- :special-members:
157
- :exclude-members: __weakref__
158
-
159
- InputBindingParser
160
- """"""""""""""""""
161
-
162
- .. autoclass :: cwlgen.import_cwl.InputBindingParser
163
- :members:
164
- :private-members:
165
- :special-members:
166
- :exclude-members: __weakref__
167
-
168
- OutputsParser
169
- """""""""""""
170
-
171
- .. autoclass :: cwlgen.import_cwl.OutputsParser
172
- :members:
173
- :private-members:
174
- :special-members:
175
- :exclude-members: __weakref__
145
+ If you're adding a class and want to provide a hint on how to parse a particular
146
+ field, you can add a static ``parse_types `` dictionary onto your class with the
147
+ fieldname and a list of types that you want to try and parse as. If your input
148
+ can be a list (eg: ``T[] ``), or a dictionary with the identifier as the key
149
+ (eg: ``{ $identifier: T } ``, you can let your type be ``[T] `` in the ``parse_types ``
150
+ dict. It will automatically inject this identifier in the constructor.
151
+ See the ``Serializable.parse_dict `` class for more information.
176
152
177
- OutputBindingParser
178
- """""""""""""""""""
153
+ .. code-block :: python
179
154
180
- .. autoclass :: cwlgen.import_cwl.OutputBindingParser
181
- :members:
182
- :private-members:
183
- :special-members:
184
- :exclude-members: __weakref__
155
+ class Workflow :
156
+ parse_types = {
157
+ # Parse inputs as : [InputParameter] or { id: InputParameter }
158
+ " inputs" : [[InputParameter]],
185
159
186
- CWLWorkflowParser
187
- """""""""""""""""
160
+ # will attempt to parse extraParam as a string, then SecondaryType,
161
+ # then (TertiaryType[] || { $identifier: TertiaryType }
162
+ " extraParam" : [str , SecondaryType, [TertiaryType]]
163
+ }
188
164
189
- .. autoclass :: cwlgen.import_cwl.CWLWorkflowParser
190
- :members:
191
- :private-members:
192
- :special-members:
193
- :exclude-members: __weakref__
165
+ .. autofunction :: cwlgen.parse_cwl
194
166
195
- StepsParser
196
- """""""""""
197
-
198
- .. autoclass :: cwlgen.import_cwl.StepsParser
199
- :members:
200
- :private-members:
201
- :special-members:
202
- :exclude-members: __weakref__
167
+ .. autofunction :: cwlgen.parse_cwl_dict
0 commit comments