clearml/examples/frameworks/fire/fire_class_cmd.py

22 lines
488 B
Python
Raw Normal View History

2022-02-07 11:38:11 +00:00
# ClearML - Example of Python Fire integration, processing commands derived from a class
#
from clearml import Task
import fire
class BrokenCalculator(object):
def __init__(self, offset=1):
self._offset = offset
def add(self, x, y):
return x + y + self._offset
def multiply(self, x, y):
return x * y + self._offset
if __name__ == "__main__":
Task.init(project_name="examples", task_name="Fire class command")
2022-02-07 11:38:11 +00:00
fire.Fire(BrokenCalculator)