Files
clearml/examples/frameworks/fire/fire_class_cmd.py
eugen-ajechiloae-clearml 296cb7d899 Add Python Fire support (#550)
2022-02-07 13:38:11 +02:00

22 lines
488 B
Python

# 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")
fire.Fire(BrokenCalculator)