Пример #1
0
    def ports_setup(self):
        port_type = PortsSpecSchema.port_type
        input_ports = {
            'points_df_in': {
                port_type: [cudf.DataFrame, dask_cudf.DataFrame]
            }
        }

        output_ports = {
            'distance_df': {
                port_type: [cudf.DataFrame, dask_cudf.DataFrame]
            },
            'distance_abs_df': {
                PortsSpecSchema.port_type:  [cudf.DataFrame, dask_cudf.DataFrame]
            }
        }
        input_connections = self.get_connected_inports()
        if 'points_df_in' in input_connections:
            types = input_connections['points_df_in']
            # connected, use the types passed in from parent
            return NodePorts(inports={'points_df_in': {port_type: types}},
                             outports={'distance_df': {port_type: types},
                                       'distance_abs_df': {port_type: types},
                                       })
        else:
            return NodePorts(inports=input_ports, outports=output_ports)
Пример #2
0
 def ports_setup(self):
     port_type = PortsSpecSchema.port_type
     if self.instance is not None:
         inports = self.instance.input_ports
         outports = self.instance.output_ports
     else:
         try:
             p_inports = self.instanceClass.input_ports
             p_outports = self.instanceClass.output_ports
             feeder = FeedProperty(self.conf)
             inports = p_inports.fget(feeder)
             outports = p_outports.fget(feeder)
         except Exception:
             inports = None
             outports = None
     o_inports = {}
     o_outports = {}
     if inports is not None:
         for k in inports.keys():
             o_inports[k] = {port_type: NmTensor}
     if outports is not None:
         for k in outports.keys():
             o_outports[k] = {port_type: NmTensor}
     if issubclass(self.instanceClass, TrainableNM):
         # added the port for tying the weights
         o_inports[self.INPUT_NM] = {port_type: TrainableNM}
         o_outports[self.OUTPUT_NM] = {port_type: TrainableNM}
     elif issubclass(self.instanceClass, LossNM):
         o_outports[self.OUTPUT_NM] = {port_type: LossNM}
     elif issubclass(self.instanceClass, DataLayerNM):
         o_outports[self.OUTPUT_NM] = {port_type: DataLayerNM}
     return NodePorts(inports=o_inports, outports=o_outports)
Пример #3
0
 def ports_setup(self):
     input_ports = {}
     output_ports = {
         'points_df_out': {
             PortsSpecSchema.port_type: pd.DataFrame
         }
     }
     return NodePorts(inports=input_ports, outports=output_ports)
Пример #4
0
 def ports_setup(self):
     port_type = PortsSpecSchema.port_type
     dy = PortsSpecSchema.dynamic
     o_inports = {}
     o_inports[self.INPUT_PORT_NAME] = {port_type: str}
     o_inports['input_tensor'] = {port_type: NmTensor, dy: True}
     # if hasattr(self, 'inputs'):
     #     for inp in self.inputs:
     #         if inp['to_port'] in (self.INPUT_PORT_NAME,):
     #             continue
     #         # TODO: Move TaskGrah rewire logic here instead of in
     #         #     chartEngine.tsx ChartEngine._fixNeMoPorts
     #         o_inports[inp['from_node'].uid+'@'+inp['from_port']] = {
     #             port_type: NmTensor}
     o_outports = {}
     o_outports[self.OUTPUT_PORT_NAME] = {port_type: list}
     return NodePorts(inports=o_inports, outports=o_outports)
Пример #5
0
    def ports_setup(self):
        input_ports = {
            'df1': {
                PortsSpecSchema.port_type:
                [cudf.DataFrame, dask_cudf.DataFrame]
            },
            'df2': {
                PortsSpecSchema.port_type:
                [cudf.DataFrame, dask_cudf.DataFrame]
            }
        }
        output_ports = {'max_diff': {PortsSpecSchema.port_type: float}}

        connections = self.get_connected_inports()
        for key in input_ports:
            if key in connections:
                # connected
                types = connections[key]
                input_ports[key].update({PortsSpecSchema.port_type: types})
        return NodePorts(inports=input_ports, outports=output_ports)
 def ports_setup(self):
     ptype = self.conf.get('port_type', list)
     inports = {'inlist': {PortsSpecSchema.port_type: ptype}}
     outports = {'sum': {PortsSpecSchema.port_type: float}}
     return NodePorts(inports=inports, outports=outports)
 def ports_setup(self):
     ptype = self.conf.get('port_type', list)
     output_ports = {'numlist': {PortsSpecSchema.port_type: ptype}}
     return NodePorts(outports=output_ports)