Skip to content

Commit ce4dd0c

Browse files
authored
Merge pull request #158 from GATEOverflow/dev
Merge from GO
2 parents cae4667 + 3a8179d commit ce4dd0c

File tree

3 files changed

+27
-5
lines changed

3 files changed

+27
-5
lines changed

mlc/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def main():
152152
action_parser.add_argument('extra', nargs=argparse.REMAINDER, help='Extra options (e.g., -v)')
153153

154154
# Script specific subcommands
155-
for action in ['docker', 'experiment']:
155+
for action in ['docker', 'experiment', 'doc']:
156156
action_parser = subparsers.add_parser(action, help=f'{action.capitalize()} a target.')
157157
action_parser.add_argument('target', choices=['script', 'run'], help='Target type (script).')
158158
# the argument given after target and before any extra options like --tags will be stored in "details"
@@ -247,7 +247,7 @@ def main():
247247
if args.target == "repo":
248248
run_args['repo'] = args.details
249249

250-
if args.command in ['docker', 'experiment']:
250+
if args.command in ['docker', 'experiment', 'doc']:
251251
if args.target == "run":
252252
run_args['target'] = 'script' #allowing run to be used for docker run instead of docker script
253253
args.target = "script"

mlc/script_action.py

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ def search(self, i):
5353
if not i.get('target_name'):
5454
i['target_name'] = "script"
5555
res = self.parent.search(i)
56-
#print(res)
5756
return res
5857

5958
find = search
@@ -235,6 +234,8 @@ def call_script_module_function(self, function_name, run_args):
235234
result = automation_instance.test(run_args) # Pass args to the run method
236235
elif function_name == "experiment":
237236
result = automation_instance.experiment(run_args) # Pass args to the experiment method
237+
elif function_name == "doc":
238+
result = automation_instance.doc(run_args) # Pass args to the doc method
238239
else:
239240
return {'return': 1, 'error': f'Function {function_name} is not supported'}
240241

@@ -284,6 +285,7 @@ def docker(self, run_args):
284285
"""
285286
return self.call_script_module_function("docker", run_args)
286287

288+
287289
def run(self, run_args):
288290
"""
289291
####################################################################################################################
@@ -306,11 +308,12 @@ def run(self, run_args):
306308
"""
307309
return self.call_script_module_function("run", run_args)
308310

311+
309312
def test(self, run_args):
310313
"""
311314
####################################################################################################################
312315
Target: Script
313-
Action: Run
316+
Action: test
314317
####################################################################################################################
315318
316319
The `test` action validates scripts that are configured with a `tests` section in `meta.yaml`.
@@ -322,10 +325,29 @@ def test(self, run_args):
322325
"""
323326
return self.call_script_module_function("test", run_args)
324327

328+
329+
def doc(self, run_args):
330+
"""
331+
####################################################################################################################
332+
Target: Script
333+
Action: doc
334+
####################################################################################################################
335+
336+
The `doc` action creates automatic README for scripts from the contents in `meta.yaml`.
337+
338+
Example Command:
339+
340+
mlc doc script --tags=detect,os
341+
342+
"""
343+
return self.call_script_module_function("doc", run_args)
344+
345+
325346
def help(self, run_args):
326347
# Internal function to call the help function in script automation module.py
327348
return self.call_script_module_function("help", run_args)
328349

350+
329351
def list(self, args):
330352
"""
331353
####################################################################################################################

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "mlcflow"
7-
version = "1.0.16"
7+
version = "1.0.18"
88

99

1010
description = "An automation interface for ML applications"

0 commit comments

Comments
 (0)