Skip to content

PythonJob: can not pass orm.Computer as input #761

@superstar54

Description

@superstar54
from aiida_workgraph import WorkGraph, task
from aiida import orm, load_profile

load_profile()

@task.pythonjob
def add(x: int, y: int) -> int:
    return x + y


@task.graph
def RemoteAdd(x: int, y: int, computer: orm.Computer) -> int:
    return add(x=x, y=y, computer=computer).result


wg = RemoteAdd.build(x=1, y=2, computer=orm.load_computer('localhost'))
wg.run()

print('\nResult: ', wg.outputs.result.value)
  File "/home/xing/repos/scinode/node-graph/src/node_graph/link.py", line 294, in check_socket_match
    raise TypeError("\n".join(lines))
TypeError: Socket type mismatch:
  graph_inputs.computer [workgraph.annotated<aiida.orm.computers.Computer>] -> add.computer [workgraph.string] is not allowed.

Suggestions:
  • Double-check you are linking the intended sockets 
  • If this conversion is intentional, register an identifier-level promotion 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions