def __init__(self, op_name, script_path): self.op_name = op_name self.script_path = script_path self.name = "" self.fullname = "" self.modeldef = self._init_modeldef() self.reference = modellib.script_model_ref(self.name, script_path)
def __init__(self, script_path, op_name): assert script_path.endswith(op_name), (script_path, op_name) self.script_path = script_path self.op_name = op_name self.name = "" self.fullname = "" self.modeldef = self._init_modeldef() script_base = script_path[: -len(op_name)] self.reference = modellib.script_model_ref(self.name, script_base)
def __init__(self, notebook_path, op_name): self.notebook_path = notebook_path if os.path.isabs(op_name) or op_name.startswith(".."): self.op_name = os.path.basename(op_name) else: self.op_name = op_name self.modeldef = _init_modeldef(self.notebook_path, self.name, self.op_name) script_base = notebook_path[:-len(self.op_name)] self.reference = modellib.script_model_ref(self.name, script_base)
def __init__(self, script_path, op_name): assert script_path[-3:] == ".py", script_path assert script_path.endswith(op_name), (script_path, op_name) self.script_path = script_path if os.path.isabs(op_name) or op_name.startswith(".."): self.op_name = os.path.basename(op_name) else: self.op_name = op_name script_base = script_path[: -len(self.op_name)] self.modeldef = self._init_modeldef() self.reference = modellib.script_model_ref(self.name, script_base)
def __init__(self, op_name, script_path): assert script_path[-3:] == ".py", script_path self.op_name = op_name self.script_path = script_path self.modeldef = self._init_modeldef() self.reference = modellib.script_model_ref(self.name, script_path)