mirror of
https://github.com/clearml/clearml
synced 2025-01-31 17:17:00 +00:00
22 lines
488 B
Python
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)
|