def set_analysis_enabled_state(self,
                                   _message=None,
                                   _timeout=None,
                                   **kwargs):
        if _message is not None:
            if isinstance(_message, MessageWrapper):
                _message = _message._message
            return run_with_retry(
                self._stub.set_analysis_enabled_state, _message, _timeout, [],
                "minknow_api.analysis_configuration.AnalysisConfigurationService"
            )

        unused_args = set(kwargs.keys())

        _message = SetAnalysisEnabledStateRequest()

        if "enable" in kwargs:
            unused_args.remove("enable")
            _message.enable = kwargs['enable']
        else:
            raise ArgumentError(
                "set_analysis_enabled_state requires a 'enable' argument")

        if len(unused_args) > 0:
            raise ArgumentError(
                "Unexpected keyword arguments to set_analysis_enabled_state: '{}'"
                .format(", ".join(unused_args)))

        return run_with_retry(
            self._stub.set_analysis_enabled_state, _message, _timeout, [],
            "minknow_api.analysis_configuration.AnalysisConfigurationService")
Ejemplo n.º 2
0
    def unblock(self, _message=None, _timeout=None, **kwargs):
        if _message is not None:
            if isinstance(_message, MessageWrapper):
                _message = _message._message
            return run_with_retry(self._stub.unblock, _message, _timeout, [], "minknow_api.device.DeviceService")

        unused_args = set(kwargs.keys())

        # check oneof group 'duration'
        oneof_fields = set([
            "duration_in_seconds",
            "duration_in_milliseconds",
        ])

        if len(unused_args & oneof_fields) > 1:
            raise ArgumentError("unblock given multiple conflicting arguments: '{}'".format(", ".join(unused_args & oneof_fields)))

        _message = UnblockRequest()

        if "channels" in kwargs:
            unused_args.remove("channels")
            _message.channels.extend(kwargs['channels'])

        if "duration_in_seconds" in kwargs:
            unused_args.remove("duration_in_seconds")
            _message.duration_in_seconds = kwargs['duration_in_seconds']

        if "duration_in_milliseconds" in kwargs:
            unused_args.remove("duration_in_milliseconds")
            _message.duration_in_milliseconds = kwargs['duration_in_milliseconds']

        if len(unused_args) > 0:
            raise ArgumentError("Unexpected keyword arguments to unblock: '{}'".format(", ".join(unused_args)))

        return run_with_retry(self._stub.unblock, _message, _timeout, [], "minknow_api.device.DeviceService")
    def add_epi2me_workflow(self, _message=None, _timeout=None, **kwargs):
        if _message is not None:
            if isinstance(_message, MessageWrapper):
                _message = _message._message
            return run_with_retry(self._stub.add_epi2me_workflow, _message,
                                  _timeout, [],
                                  "minknow_api.protocol.ProtocolService")

        unused_args = set(kwargs.keys())

        _message = AddEpi2meWorkflowRequest()

        if "run_id" in kwargs:
            unused_args.remove("run_id")
            _message.run_id = kwargs['run_id']
        else:
            raise ArgumentError(
                "add_epi2me_workflow requires a 'run_id' argument")

        if "epi2me_workflow" in kwargs:
            unused_args.remove("epi2me_workflow")
            _message.epi2me_workflow.CopyFrom(kwargs['epi2me_workflow'])
        else:
            raise ArgumentError(
                "add_epi2me_workflow requires a 'epi2me_workflow' argument")

        if len(unused_args) > 0:
            raise ArgumentError(
                "Unexpected keyword arguments to add_epi2me_workflow: '{}'".
                format(", ".join(unused_args)))

        return run_with_retry(self._stub.add_epi2me_workflow, _message,
                              _timeout, [],
                              "minknow_api.protocol.ProtocolService")
    def start_protocol(self, _message=None, _timeout=None, **kwargs):
        if _message is not None:
            if isinstance(_message, MessageWrapper):
                _message = _message._message
            return run_with_retry(self._stub.start_protocol, _message,
                                  _timeout, [],
                                  "minknow_api.protocol.ProtocolService")

        unused_args = set(kwargs.keys())

        _message = StartProtocolRequest()

        if "identifier" in kwargs:
            unused_args.remove("identifier")
            _message.identifier = kwargs['identifier']
        else:
            raise ArgumentError(
                "start_protocol requires a 'identifier' argument")

        if "args" in kwargs:
            unused_args.remove("args")
            _message.args.extend(kwargs['args'])

        if "user_info" in kwargs:
            unused_args.remove("user_info")
            _message.user_info.CopyFrom(kwargs['user_info'])

        if len(unused_args) > 0:
            raise ArgumentError(
                "Unexpected keyword arguments to start_protocol: '{}'".format(
                    ", ".join(unused_args)))

        return run_with_retry(self._stub.start_protocol, _message, _timeout,
                              [], "minknow_api.protocol.ProtocolService")
    def wait_for_finished(self, _message=None, _timeout=None, **kwargs):
        if _message is not None:
            if isinstance(_message, MessageWrapper):
                _message = _message._message
            return run_with_retry(self._stub.wait_for_finished, _message,
                                  _timeout, [],
                                  "minknow_api.protocol.ProtocolService")

        unused_args = set(kwargs.keys())

        _message = WaitForFinishedRequest()

        if "run_id" in kwargs:
            unused_args.remove("run_id")
            _message.run_id = kwargs['run_id']
        else:
            raise ArgumentError(
                "wait_for_finished requires a 'run_id' argument")

        if "state" in kwargs:
            unused_args.remove("state")
            _message.state = kwargs['state']

        if "timeout" in kwargs:
            unused_args.remove("timeout")
            _message.timeout = kwargs['timeout']

        if len(unused_args) > 0:
            raise ArgumentError(
                "Unexpected keyword arguments to wait_for_finished: '{}'".
                format(", ".join(unused_args)))

        return run_with_retry(self._stub.wait_for_finished, _message, _timeout,
                              [], "minknow_api.protocol.ProtocolService")
Ejemplo n.º 6
0
    def store(self, _message=None, _timeout=None, **kwargs):
        if _message is not None:
            if isinstance(_message, MessageWrapper):
                _message = _message._message
            return run_with_retry(self._stub.store, _message, _timeout, [],
                                  "minknow_api.keystore.KeyStoreService")

        unused_args = set(kwargs.keys())

        _message = StoreRequest()

        if "values" in kwargs:
            unused_args.remove("values")
            for key, value in kwargs['values'].items():
                if value.DESCRIPTOR.full_name == 'google.protobuf.Any':
                    _message.values[key].CopyFrom(value)
                else:
                    _message.values[key].Pack(value)
        else:
            raise ArgumentError("store requires a 'values' argument")

        if "lifetime" in kwargs:
            unused_args.remove("lifetime")
            _message.lifetime = kwargs['lifetime']

        if len(unused_args) > 0:
            raise ArgumentError(
                "Unexpected keyword arguments to store: '{}'".format(
                    ", ".join(unused_args)))

        return run_with_retry(self._stub.store, _message, _timeout, [],
                              "minknow_api.keystore.KeyStoreService")
Ejemplo n.º 7
0
    def stream_temperature(self, _message=None, _timeout=None, **kwargs):
        """Streams device temperature for a device. The first message will contain all of the temperatures up
        until the current live point, and then messages after that point will just be updates.

        Temperatures are averaged over a 1 minute period, and the value of each bucket is given in minute intervals

        Since 3.0

        This RPC has no side effects. Calling it will have no effect on the state of the
        system. It is safe to call repeatedly, or to retry on failure, although there is no
        guarantee it will return the same information each time.

        Args:
            _message (minknow_api.statistics_pb2.StreamTemperatureRequest, optional): The message to send.
                This can be passed instead of the keyword arguments.
            _timeout (float, optional): The call will be cancelled after this number of seconds
                if it has not been completed.
                Note that this is the time until the call ends, not the time between returned
                messages.
            acquisition_run_id (str): The acquisition id of the experiment.
            data_selection (minknow_api.statistics_pb2.DataSelection, optional): The desired data selection.

                The units for all values are `seconds since the start of the experiment`.

        Returns:
            iter of minknow_api.statistics_pb2.StreamTemperatureResponse

        Note that the returned messages are actually wrapped in a type that collapses
        submessages for fields marked with ``[rpc_unwrap]``.
        """
        if _message is not None:
            if isinstance(_message, MessageWrapper):
                _message = _message._message
            return run_with_retry(self._stub.stream_temperature, _message,
                                  _timeout, [],
                                  "minknow_api.statistics.StatisticsService")

        unused_args = set(kwargs.keys())

        _message = StreamTemperatureRequest()

        if "acquisition_run_id" in kwargs:
            unused_args.remove("acquisition_run_id")
            _message.acquisition_run_id = kwargs['acquisition_run_id']
        else:
            raise ArgumentError(
                "stream_temperature requires a 'acquisition_run_id' argument")

        if "data_selection" in kwargs:
            unused_args.remove("data_selection")
            _message.data_selection.CopyFrom(kwargs['data_selection'])

        if len(unused_args) > 0:
            raise ArgumentError(
                "Unexpected keyword arguments to stream_temperature: '{}'".
                format(", ".join(unused_args)))

        return run_with_retry(self._stub.stream_temperature, _message,
                              _timeout, [],
                              "minknow_api.statistics.StatisticsService")
Ejemplo n.º 8
0
    def get_calibration(self, _message=None, _timeout=None, **kwargs):
        if _message is not None:
            if isinstance(_message, MessageWrapper):
                _message = _message._message
            return run_with_retry(self._stub.get_calibration, _message, _timeout, [], "minknow_api.device.DeviceService")

        unused_args = set(kwargs.keys())

        _message = GetCalibrationRequest()

        if "first_channel" in kwargs:
            unused_args.remove("first_channel")
            _message.first_channel = kwargs['first_channel']
        else:
            raise ArgumentError("get_calibration requires a 'first_channel' argument")

        if "last_channel" in kwargs:
            unused_args.remove("last_channel")
            _message.last_channel = kwargs['last_channel']
        else:
            raise ArgumentError("get_calibration requires a 'last_channel' argument")

        if len(unused_args) > 0:
            raise ArgumentError("Unexpected keyword arguments to get_calibration: '{}'".format(", ".join(unused_args)))

        return run_with_retry(self._stub.get_calibration, _message, _timeout, [], "minknow_api.device.DeviceService")
Ejemplo n.º 9
0
    def watch(self, _message=None, _timeout=None, **kwargs):
        if _message is not None:
            if isinstance(_message, MessageWrapper):
                _message = _message._message
            return run_with_retry(self._stub.watch, _message, _timeout, [],
                                  "minknow_api.keystore.KeyStoreService")

        unused_args = set(kwargs.keys())

        _message = WatchRequest()

        if "names" in kwargs:
            unused_args.remove("names")
            _message.names.extend(kwargs['names'])
        else:
            raise ArgumentError("watch requires a 'names' argument")

        if "allow_missing" in kwargs:
            unused_args.remove("allow_missing")
            _message.allow_missing = kwargs['allow_missing']

        if len(unused_args) > 0:
            raise ArgumentError(
                "Unexpected keyword arguments to watch: '{}'".format(
                    ", ".join(unused_args)))

        return run_with_retry(self._stub.watch, _message, _timeout, [],
                              "minknow_api.keystore.KeyStoreService")
Ejemplo n.º 10
0
    def stream_encountered_acquisition_output_keys(self,
                                                   _message=None,
                                                   _timeout=None,
                                                   **kwargs):
        """Tracks which barcode names have been encountered

        When a new barcode name is encountered, a list of all encountered barcode names is returned

        Since 4.0

        This RPC has no side effects. Calling it will have no effect on the state of the
        system. It is safe to call repeatedly, or to retry on failure, although there is no
        guarantee it will return the same information each time.

        Args:
            _message (minknow_api.statistics_pb2.StreamEncounteredAcquisitionOutputKeysRequest, optional): The message to send.
                This can be passed instead of the keyword arguments.
            _timeout (float, optional): The call will be cancelled after this number of seconds
                if it has not been completed.
                Note that this is the time until the call ends, not the time between returned
                messages.
            acquisition_run_id (str): The acquisition id of the experiment.

        Returns:
            iter of minknow_api.statistics_pb2.StreamEncounteredAcquisitionOutputKeysResponse

        Note that the returned messages are actually wrapped in a type that collapses
        submessages for fields marked with ``[rpc_unwrap]``.
        """
        if _message is not None:
            if isinstance(_message, MessageWrapper):
                _message = _message._message
            return run_with_retry(
                self._stub.stream_encountered_acquisition_output_keys,
                _message, _timeout, [],
                "minknow_api.statistics.StatisticsService")

        unused_args = set(kwargs.keys())

        _message = StreamEncounteredAcquisitionOutputKeysRequest()

        if "acquisition_run_id" in kwargs:
            unused_args.remove("acquisition_run_id")
            _message.acquisition_run_id = kwargs['acquisition_run_id']
        else:
            raise ArgumentError(
                "stream_encountered_acquisition_output_keys requires a 'acquisition_run_id' argument"
            )

        if len(unused_args) > 0:
            raise ArgumentError(
                "Unexpected keyword arguments to stream_encountered_acquisition_output_keys: '{}'"
                .format(", ".join(unused_args)))

        return run_with_retry(
            self._stub.stream_encountered_acquisition_output_keys, _message,
            _timeout, [], "minknow_api.statistics.StatisticsService")
Ejemplo n.º 11
0
    def stream_bias_voltages(self, _message=None, _timeout=None, **kwargs):
        """Streams when bias voltage changes occur, where the response given will be the acquisition
        index that the voltage changed at, and the voltage itself. The first message will contain
        all of the bias voltage changes up until the current live point, and then messages after
        that period will just be updates

        Will fail with INVALID_ARGUMENT if an unknown acquisition id is given

        Since 3.2

        This RPC has no side effects. Calling it will have no effect on the state of the
        system. It is safe to call repeatedly, or to retry on failure, although there is no
        guarantee it will return the same information each time.

        Args:
            _message (minknow_api.statistics_pb2.StreamBiasVoltagesRequest, optional): The message to send.
                This can be passed instead of the keyword arguments.
            _timeout (float, optional): The call will be cancelled after this number of seconds
                if it has not been completed.
                Note that this is the time until the call ends, not the time between returned
                messages.
            acquisition_run_id (str): The acquisition id of the experiment.

        Returns:
            iter of minknow_api.statistics_pb2.StreamBiasVoltagesResponse

        Note that the returned messages are actually wrapped in a type that collapses
        submessages for fields marked with ``[rpc_unwrap]``.
        """
        if _message is not None:
            if isinstance(_message, MessageWrapper):
                _message = _message._message
            return run_with_retry(self._stub.stream_bias_voltages, _message,
                                  _timeout, [],
                                  "minknow_api.statistics.StatisticsService")

        unused_args = set(kwargs.keys())

        _message = StreamBiasVoltagesRequest()

        if "acquisition_run_id" in kwargs:
            unused_args.remove("acquisition_run_id")
            _message.acquisition_run_id = kwargs['acquisition_run_id']
        else:
            raise ArgumentError(
                "stream_bias_voltages requires a 'acquisition_run_id' argument"
            )

        if len(unused_args) > 0:
            raise ArgumentError(
                "Unexpected keyword arguments to stream_bias_voltages: '{}'".
                format(", ".join(unused_args)))

        return run_with_retry(self._stub.stream_bias_voltages, _message,
                              _timeout, [],
                              "minknow_api.statistics.StatisticsService")
Ejemplo n.º 12
0
    def send_user_message(self, _message=None, _timeout=None, **kwargs):
        """Send a log message to any listeners of messages (see get_user_messages)

        Any historical user messages are first sent to the caller,

        Since 1.11

        

        Args:
            _message (minknow_api.log_pb2.SendUserMessageRequest, optional): The message to send.
                This can be passed instead of the keyword arguments.
            _timeout (float, optional): The call will be cancelled after this number of seconds
                if it has not been completed.
            severity (minknow_api.log_pb2.Severity): The severity of the message to send

                note: TRACE messages cannot be sent using this interface (will throw an error).
            user_message (str): The user message to send to any listeners.

        Returns:
            minknow_api.log_pb2.SendUserMessageResponse

        Note that the returned messages are actually wrapped in a type that collapses
        submessages for fields marked with ``[rpc_unwrap]``.
        """
        if _message is not None:
            if isinstance(_message, MessageWrapper):
                _message = _message._message
            return run_with_retry(self._stub.send_user_message,
                                  _message, _timeout,
                                  [],
                                  "minknow_api.log.LogService")

        unused_args = set(kwargs.keys())

        _message = SendUserMessageRequest()

        if "severity" in kwargs:
            unused_args.remove("severity")
            _message.severity = kwargs['severity']
        else:
            raise ArgumentError("send_user_message requires a 'severity' argument")

        if "user_message" in kwargs:
            unused_args.remove("user_message")
            _message.user_message = kwargs['user_message']
        else:
            raise ArgumentError("send_user_message requires a 'user_message' argument")

        if len(unused_args) > 0:
            raise ArgumentError("Unexpected keyword arguments to send_user_message: '{}'".format(", ".join(unused_args)))

        return run_with_retry(self._stub.send_user_message,
                              _message, _timeout,
                              [],
                              "minknow_api.log.LogService")
Ejemplo n.º 13
0
    def start_protocol(self, _message=None, _timeout=None, **kwargs):
        """Initiates a python instance that runs the script specified by the `path` argument.
        `list_protocols` will give back a list of protocol scripts that can be started by this call

        

        Args:
            _message (minknow_api.protocol_pb2.StartProtocolRequest, optional): The message to send.
                This can be passed instead of the keyword arguments.
            _timeout (float, optional): The call will be cancelled after this number of seconds
                if it has not been completed.
            identifier (str): The identifier of the protocol, as provided by list_protocols().
            args (str, optional): The arguments to pass to the protocol.
            user_info (minknow_api.protocol_pb2.ProtocolRunUserInfo, optional): User input describing the protocol.

        Returns:
            minknow_api.protocol_pb2.StartProtocolResponse

        Note that the returned messages are actually wrapped in a type that collapses
        submessages for fields marked with ``[rpc_unwrap]``.
        """
        if _message is not None:
            if isinstance(_message, MessageWrapper):
                _message = _message._message
            return run_with_retry(self._stub.start_protocol,
                                  _message, _timeout,
                                  [],
                                  "minknow_api.protocol.ProtocolService")

        unused_args = set(kwargs.keys())

        _message = StartProtocolRequest()

        if "identifier" in kwargs:
            unused_args.remove("identifier")
            _message.identifier = kwargs['identifier']
        else:
            raise ArgumentError("start_protocol requires a 'identifier' argument")

        if "args" in kwargs:
            unused_args.remove("args")
            _message.args.extend(kwargs['args'])

        if "user_info" in kwargs:
            unused_args.remove("user_info")
            _message.user_info.CopyFrom(kwargs['user_info'])

        if len(unused_args) > 0:
            raise ArgumentError("Unexpected keyword arguments to start_protocol: '{}'".format(", ".join(unused_args)))

        return run_with_retry(self._stub.start_protocol,
                              _message, _timeout,
                              [],
                              "minknow_api.protocol.ProtocolService")
    def stream_read_length_histogram(self,
                                     _message=None,
                                     _timeout=None,
                                     **kwargs):
        if _message is not None:
            if isinstance(_message, MessageWrapper):
                _message = _message._message
            return run_with_retry(self._stub.stream_read_length_histogram,
                                  _message, _timeout, [],
                                  "minknow_api.statistics.StatisticsService")

        unused_args = set(kwargs.keys())

        _message = StreamReadLengthHistogramRequest()

        if "acquisition_run_id" in kwargs:
            unused_args.remove("acquisition_run_id")
            _message.acquisition_run_id = kwargs['acquisition_run_id']
        else:
            raise ArgumentError(
                "stream_read_length_histogram requires a 'acquisition_run_id' argument"
            )

        if "poll_time_seconds" in kwargs:
            unused_args.remove("poll_time_seconds")
            _message.poll_time_seconds = kwargs['poll_time_seconds']

        if "read_length_type" in kwargs:
            unused_args.remove("read_length_type")
            _message.read_length_type = kwargs['read_length_type']

        if "data_selection" in kwargs:
            unused_args.remove("data_selection")
            _message.data_selection.CopyFrom(kwargs['data_selection'])

        if "bucket_value_type" in kwargs:
            unused_args.remove("bucket_value_type")
            _message.bucket_value_type = kwargs['bucket_value_type']

        if "discard_outlier_percent" in kwargs:
            unused_args.remove("discard_outlier_percent")
            _message.discard_outlier_percent = kwargs[
                'discard_outlier_percent']

        if len(unused_args) > 0:
            raise ArgumentError(
                "Unexpected keyword arguments to stream_read_length_histogram: '{}'"
                .format(", ".join(unused_args)))

        return run_with_retry(self._stub.stream_read_length_histogram,
                              _message, _timeout, [],
                              "minknow_api.statistics.StatisticsService")
Ejemplo n.º 15
0
    def add_epi2me_workflow(self, _message=None, _timeout=None, **kwargs):
        """Links an epi2me workflow reference to a run id.

        Since 1.15

        

        Args:
            _message (minknow_api.protocol_pb2.AddEpi2meWorkflowRequest, optional): The message to send.
                This can be passed instead of the keyword arguments.
            _timeout (float, optional): The call will be cancelled after this number of seconds
                if it has not been completed.
            run_id (str): 
            epi2me_workflow (minknow_api.protocol_pb2.Epi2meWorkflowReference): 

        Returns:
            minknow_api.protocol_pb2.AddEpi2meWorkflowResponse

        Note that the returned messages are actually wrapped in a type that collapses
        submessages for fields marked with ``[rpc_unwrap]``.
        """
        if _message is not None:
            if isinstance(_message, MessageWrapper):
                _message = _message._message
            return run_with_retry(self._stub.add_epi2me_workflow,
                                  _message, _timeout,
                                  [],
                                  "minknow_api.protocol.ProtocolService")

        unused_args = set(kwargs.keys())

        _message = AddEpi2meWorkflowRequest()

        if "run_id" in kwargs:
            unused_args.remove("run_id")
            _message.run_id = kwargs['run_id']
        else:
            raise ArgumentError("add_epi2me_workflow requires a 'run_id' argument")

        if "epi2me_workflow" in kwargs:
            unused_args.remove("epi2me_workflow")
            _message.epi2me_workflow.CopyFrom(kwargs['epi2me_workflow'])
        else:
            raise ArgumentError("add_epi2me_workflow requires a 'epi2me_workflow' argument")

        if len(unused_args) > 0:
            raise ArgumentError("Unexpected keyword arguments to add_epi2me_workflow: '{}'".format(", ".join(unused_args)))

        return run_with_retry(self._stub.add_epi2me_workflow,
                              _message, _timeout,
                              [],
                              "minknow_api.protocol.ProtocolService")
Ejemplo n.º 16
0
    def remove(self, _message=None, _timeout=None, **kwargs):
        """Remove a value from the store.

        

        Args:
            _message (minknow_api.keystore_pb2.RemoveRequest, optional): The message to send.
                This can be passed instead of the keyword arguments.
            _timeout (float, optional): The call will be cancelled after this number of seconds
                if it has not been completed.
            names (str): The names of the values you wish to remove.
            allow_missing (bool, optional): Whether to allow missing values.

                If set, names that are not present in the store will be ignored, but any present values will
                still be removed. Otherwise, missing values will cause an error to be returned (in which case
                nothing will be removed).

                Defaults to 'false'

        Returns:
            minknow_api.keystore_pb2.RemoveResponse

        Note that the returned messages are actually wrapped in a type that collapses
        submessages for fields marked with ``[rpc_unwrap]``.
        """
        if _message is not None:
            if isinstance(_message, MessageWrapper):
                _message = _message._message
            return run_with_retry(self._stub.remove, _message, _timeout, [],
                                  "minknow_api.keystore.KeyStoreService")

        unused_args = set(kwargs.keys())

        _message = minknow_api.keystore_pb2.RemoveRequest()

        if "names" in kwargs:
            unused_args.remove("names")
            _message.names.extend(kwargs['names'])
        else:
            raise ArgumentError("remove requires a 'names' argument")

        if "allow_missing" in kwargs:
            unused_args.remove("allow_missing")
            _message.allow_missing = kwargs['allow_missing']

        if len(unused_args) > 0:
            raise ArgumentError(
                "Unexpected keyword arguments to remove: '{}'".format(
                    ", ".join(unused_args)))

        return run_with_retry(self._stub.remove, _message, _timeout, [],
                              "minknow_api.keystore.KeyStoreService")
Ejemplo n.º 17
0
    def send_ping(self, _message=None, _timeout=None, **kwargs):
        """Send a ping to the configured ping server (see system config for ping server url)

        The tracking_id and context_data section of the ping are filled in automatically by MinKNOW.

        The ping is queued internally for sending immediately, if MinKNOW fails to send the message it
        stores the message to send when possible.

        Since 1.11

        

        Args:
            _message (minknow_api.log_pb2.SendPingRequest, optional): The message to send.
                This can be passed instead of the keyword arguments.
            _timeout (float, optional): The call will be cancelled after this number of seconds
                if it has not been completed.
            ping_data (str): The json data to send as a ping.

                note: if this string is not a valid json object, an error will be raised.

        Returns:
            minknow_api.log_pb2.SendPingResponse

        Note that the returned messages are actually wrapped in a type that collapses
        submessages for fields marked with ``[rpc_unwrap]``.
        """
        if _message is not None:
            if isinstance(_message, MessageWrapper):
                _message = _message._message
            return run_with_retry(self._stub.send_ping,
                                  _message, _timeout,
                                  [],
                                  "minknow_api.log.LogService")

        unused_args = set(kwargs.keys())

        _message = SendPingRequest()

        if "ping_data" in kwargs:
            unused_args.remove("ping_data")
            _message.ping_data = kwargs['ping_data']
        else:
            raise ArgumentError("send_ping requires a 'ping_data' argument")

        if len(unused_args) > 0:
            raise ArgumentError("Unexpected keyword arguments to send_ping: '{}'".format(", ".join(unused_args)))

        return run_with_retry(self._stub.send_ping,
                              _message, _timeout,
                              [],
                              "minknow_api.log.LogService")
Ejemplo n.º 18
0
    def unlock_channel_states(self, _message=None, _timeout=None, **kwargs):
        """Re-activates channels that have been turned-off with force_channels_to_state.
        Note that 'turning off' refers to channel states only, everything else is still applied on the channel
        (e.g. mux changes, saturation, commands etc)
        No action is taken if the channel is already active.
        Has to be called while acquiring data, fails otherwise.
        NOTE:
        Calls to lock_channel_states and unlock_channel_states cannot be done in the same time.
        If any of these two is called while any of these is already running, the grpc will return
        with an error.

        

        Args:
            _message (minknow_api.data_pb2.UnlockChannelStatesRequest, optional): The message to send.
                This can be passed instead of the keyword arguments.
            _timeout (float, optional): The call will be cancelled after this number of seconds
                if it has not been completed.
            channels (int): The channels to activate (active = they will be considered for channel state evaluation in the future).
                Channels are indexed from 1.

        Returns:
            minknow_api.data_pb2.UnlockChannelStatesResponse

        Note that the returned messages are actually wrapped in a type that collapses
        submessages for fields marked with ``[rpc_unwrap]``.
        """
        if _message is not None:
            if isinstance(_message, MessageWrapper):
                _message = _message._message
            return run_with_retry(self._stub.unlock_channel_states, _message,
                                  _timeout, [], "minknow_api.data.DataService")

        unused_args = set(kwargs.keys())

        _message = UnlockChannelStatesRequest()

        if "channels" in kwargs:
            unused_args.remove("channels")
            _message.channels.extend(kwargs['channels'])
        else:
            raise ArgumentError(
                "unlock_channel_states requires a 'channels' argument")

        if len(unused_args) > 0:
            raise ArgumentError(
                "Unexpected keyword arguments to unlock_channel_states: '{}'".
                format(", ".join(unused_args)))

        return run_with_retry(self._stub.unlock_channel_states, _message,
                              _timeout, [], "minknow_api.data.DataService")
Ejemplo n.º 19
0
    def set_analysis_enabled_state(self,
                                   _message=None,
                                   _timeout=None,
                                   **kwargs):
        """Enable or disable analysis entirely.

        This RPC is idempotent. It may change the state of the system, but if the requested
        change has already happened, it will not fail because of this, make any additional
        changes or return a different value.

        Args:
            _message (minknow_api.analysis_configuration_pb2.SetAnalysisEnabledStateRequest, optional): The message to send.
                This can be passed instead of the keyword arguments.
            _timeout (float, optional): The call will be cancelled after this number of seconds
                if it has not been completed.
            enable (bool): 

        Returns:
            minknow_api.analysis_configuration_pb2.SetAnalysisEnabledStateResponse

        Note that the returned messages are actually wrapped in a type that collapses
        submessages for fields marked with ``[rpc_unwrap]``.
        """
        if _message is not None:
            if isinstance(_message, MessageWrapper):
                _message = _message._message
            return run_with_retry(
                self._stub.set_analysis_enabled_state, _message, _timeout, [],
                "minknow_api.analysis_configuration.AnalysisConfigurationService"
            )

        unused_args = set(kwargs.keys())

        _message = SetAnalysisEnabledStateRequest()

        if "enable" in kwargs:
            unused_args.remove("enable")
            _message.enable = kwargs['enable']
        else:
            raise ArgumentError(
                "set_analysis_enabled_state requires a 'enable' argument")

        if len(unused_args) > 0:
            raise ArgumentError(
                "Unexpected keyword arguments to set_analysis_enabled_state: '{}'"
                .format(", ".join(unused_args)))

        return run_with_retry(
            self._stub.set_analysis_enabled_state, _message, _timeout, [],
            "minknow_api.analysis_configuration.AnalysisConfigurationService")
Ejemplo n.º 20
0
    def get_read_length_types(self, _message=None, _timeout=None, **kwargs):
        """Gets a list of the types of read-length values for which a histogram is available

        Since 3.2

        This RPC has no side effects. Calling it will have no effect on the state of the
        system. It is safe to call repeatedly, or to retry on failure, although there is no
        guarantee it will return the same information each time.

        Args:
            _message (minknow_api.statistics_pb2.GetReadLengthTypesRequest, optional): The message to send.
                This can be passed instead of the keyword arguments.
            _timeout (float, optional): The call will be cancelled after this number of seconds
                if it has not been completed.
            acquisition_run_id (str): The acquisition id of the experiment.

        Returns:
            minknow_api.statistics_pb2.GetReadLengthTypesResponse

        Note that the returned messages are actually wrapped in a type that collapses
        submessages for fields marked with ``[rpc_unwrap]``.
        """
        if _message is not None:
            if isinstance(_message, MessageWrapper):
                _message = _message._message
            return run_with_retry(self._stub.get_read_length_types, _message,
                                  _timeout, [],
                                  "minknow_api.statistics.StatisticsService")

        unused_args = set(kwargs.keys())

        _message = GetReadLengthTypesRequest()

        if "acquisition_run_id" in kwargs:
            unused_args.remove("acquisition_run_id")
            _message.acquisition_run_id = kwargs['acquisition_run_id']
        else:
            raise ArgumentError(
                "get_read_length_types requires a 'acquisition_run_id' argument"
            )

        if len(unused_args) > 0:
            raise ArgumentError(
                "Unexpected keyword arguments to get_read_length_types: '{}'".
                format(", ".join(unused_args)))

        return run_with_retry(self._stub.get_read_length_types, _message,
                              _timeout, [],
                              "minknow_api.statistics.StatisticsService")
Ejemplo n.º 21
0
    def get_one(self, _message=None, _timeout=None, **kwargs):
        """Get a single value.

        This is a convenient alternative to get() when you only want a single value. If you want
        multiple values, it is more efficient to request them all in a single get() call.

        If the requested value is not in the store, this will return an error.

        This RPC has no side effects. Calling it will have no effect on the state of the
        system. It is safe to call repeatedly, or to retry on failure, although there is no
        guarantee it will return the same information each time.

        Args:
            _message (minknow_api.keystore_pb2.GetOneRequest, optional): The message to send.
                This can be passed instead of the keyword arguments.
            _timeout (float, optional): The call will be cancelled after this number of seconds
                if it has not been completed.
            name (str): The name of the value to fetch.

        Returns:
            minknow_api.keystore_pb2.GetOneResponse

        Note that the returned messages are actually wrapped in a type that collapses
        submessages for fields marked with ``[rpc_unwrap]``.
        """
        if _message is not None:
            if isinstance(_message, MessageWrapper):
                _message = _message._message
            return run_with_retry(self._stub.get_one, _message, _timeout, [],
                                  "minknow_api.keystore.KeyStoreService")

        unused_args = set(kwargs.keys())

        _message = minknow_api.keystore_pb2.GetOneRequest()

        if "name" in kwargs:
            unused_args.remove("name")
            _message.name = kwargs['name']
        else:
            raise ArgumentError("get_one requires a 'name' argument")

        if len(unused_args) > 0:
            raise ArgumentError(
                "Unexpected keyword arguments to get_one: '{}'".format(
                    ", ".join(unused_args)))

        return run_with_retry(self._stub.get_one, _message, _timeout, [],
                              "minknow_api.keystore.KeyStoreService")
Ejemplo n.º 22
0
    def list_protocol_output_dir_files(self,
                                       _message=None,
                                       _timeout=None,
                                       **kwargs):
        if _message is not None:
            if isinstance(_message, MessageWrapper):
                _message = _message._message
            return run_with_retry(self._stub.list_protocol_output_dir_files,
                                  _message, _timeout, [],
                                  "minknow_api.manager.ManagerService")

        unused_args = set(kwargs.keys())

        _message = ListProtocolOutputDirFilesRequest()

        if "path" in kwargs:
            unused_args.remove("path")
            _message.path = kwargs['path']

        if len(unused_args) > 0:
            raise ArgumentError(
                "Unexpected keyword arguments to list_protocol_output_dir_files: '{}'"
                .format(", ".join(unused_args)))

        return run_with_retry(self._stub.list_protocol_output_dir_files,
                              _message, _timeout, [],
                              "minknow_api.manager.ManagerService")
Ejemplo n.º 23
0
    def set_saturation_config(self, _message=None, _timeout=None, **kwargs):
        if _message is not None:
            if isinstance(_message, MessageWrapper):
                _message = _message._message
            return run_with_retry(self._stub.set_saturation_config, _message, _timeout, [], "minknow_api.device.DeviceService")

        unused_args = set(kwargs.keys())

        _message = SetSaturationConfigRequest()

        if "thresholds" in kwargs:
            unused_args.remove("thresholds")
            _message.settings.thresholds.CopyFrom(kwargs['thresholds'])

        if "software_saturation" in kwargs:
            unused_args.remove("software_saturation")
            _message.settings.software_saturation.CopyFrom(kwargs['software_saturation'])

        if "user_threshold_saturation" in kwargs:
            unused_args.remove("user_threshold_saturation")
            _message.settings.user_threshold_saturation.CopyFrom(kwargs['user_threshold_saturation'])

        if len(unused_args) > 0:
            raise ArgumentError("Unexpected keyword arguments to set_saturation_config: '{}'".format(", ".join(unused_args)))

        return run_with_retry(self._stub.set_saturation_config, _message, _timeout, [], "minknow_api.device.DeviceService")
Ejemplo n.º 24
0
    def reset_position(self, _message=None, _timeout=None, **kwargs):
        if _message is not None:
            if isinstance(_message, MessageWrapper):
                _message = _message._message
            return run_with_retry(self._stub.reset_position, _message,
                                  _timeout, [],
                                  "minknow_api.manager.ManagerService")

        unused_args = set(kwargs.keys())

        _message = ResetPositionRequest()

        if "positions" in kwargs:
            unused_args.remove("positions")
            _message.positions.extend(kwargs['positions'])

        if "force" in kwargs:
            unused_args.remove("force")
            _message.force = kwargs['force']

        if len(unused_args) > 0:
            raise ArgumentError(
                "Unexpected keyword arguments to reset_position: '{}'".format(
                    ", ".join(unused_args)))

        return run_with_retry(self._stub.reset_position, _message, _timeout,
                              [], "minknow_api.manager.ManagerService")
    def get_basecaller_configuration(self,
                                     _message=None,
                                     _timeout=None,
                                     **kwargs):
        if _message is not None:
            if isinstance(_message, MessageWrapper):
                _message = _message._message
            return run_with_retry(
                self._stub.get_basecaller_configuration, _message, _timeout,
                [],
                "minknow_api.analysis_configuration.AnalysisConfigurationService"
            )

        unused_args = set(kwargs.keys())

        _message = GetBasecallerConfigurationRequest()

        if len(unused_args) > 0:
            raise ArgumentError(
                "Unexpected keyword arguments to get_basecaller_configuration: '{}'"
                .format(", ".join(unused_args)))

        return run_with_retry(
            self._stub.get_basecaller_configuration, _message, _timeout, [],
            "minknow_api.analysis_configuration.AnalysisConfigurationService")
Ejemplo n.º 26
0
    def create_directory(self, _message=None, _timeout=None, **kwargs):
        if _message is not None:
            if isinstance(_message, MessageWrapper):
                _message = _message._message
            return run_with_retry(self._stub.create_directory, _message,
                                  _timeout, [],
                                  "minknow_api.manager.ManagerService")

        unused_args = set(kwargs.keys())

        _message = CreateDirectoryRequest()

        if "parent_path" in kwargs:
            unused_args.remove("parent_path")
            _message.parent_path = kwargs['parent_path']

        if "name" in kwargs:
            unused_args.remove("name")
            _message.name = kwargs['name']

        if len(unused_args) > 0:
            raise ArgumentError(
                "Unexpected keyword arguments to create_directory: '{}'".
                format(", ".join(unused_args)))

        return run_with_retry(self._stub.create_directory, _message, _timeout,
                              [], "minknow_api.manager.ManagerService")
    def change_pixel_settings(self, _message=None, _timeout=None, **kwargs):
        if _message is not None:
            if isinstance(_message, MessageWrapper):
                _message = _message._message
            return run_with_retry(
                self._stub.change_pixel_settings, _message, _timeout, [],
                "minknow_api.promethion_device.PromethionDeviceService")

        unused_args = set(kwargs.keys())

        _message = ChangePixelSettingsRequest()

        if "pixels" in kwargs:
            unused_args.remove("pixels")
            for key, value in kwargs['pixels'].items():
                _message.pixels[key].CopyFrom(value)

        if "pixel_default" in kwargs:
            unused_args.remove("pixel_default")
            _message.pixel_default.CopyFrom(kwargs['pixel_default'])

        if len(unused_args) > 0:
            raise ArgumentError(
                "Unexpected keyword arguments to change_pixel_settings: '{}'".
                format(", ".join(unused_args)))

        return run_with_retry(
            self._stub.change_pixel_settings, _message, _timeout, [],
            "minknow_api.promethion_device.PromethionDeviceService")
    def stop(self, _message=None, _timeout=None, **kwargs):
        if _message is not None:
            if isinstance(_message, MessageWrapper):
                _message = _message._message
            return run_with_retry(
                self._stub.stop, _message, _timeout, [],
                "minknow_api.acquisition.AcquisitionService")

        unused_args = set(kwargs.keys())

        _message = StopRequest()

        if "data_action_on_stop" in kwargs:
            unused_args.remove("data_action_on_stop")
            _message.data_action_on_stop = kwargs['data_action_on_stop']

        if "wait_until_ready" in kwargs:
            unused_args.remove("wait_until_ready")
            _message.wait_until_ready = kwargs['wait_until_ready']

        if "keep_power_on" in kwargs:
            unused_args.remove("keep_power_on")
            _message.keep_power_on = kwargs['keep_power_on']

        if len(unused_args) > 0:
            raise ArgumentError(
                "Unexpected keyword arguments to stop: '{}'".format(
                    ", ".join(unused_args)))

        return run_with_retry(self._stub.stop, _message, _timeout, [],
                              "minknow_api.acquisition.AcquisitionService")
Ejemplo n.º 29
0
    def get_pixel_settings(self, _message=None, _timeout=None, **kwargs):
        """Get the pixel settings for the requested pixel's

        This RPC has no side effects. Calling it will have no effect on the state of the
        system. It is safe to call repeatedly, or to retry on failure, although there is no
        guarantee it will return the same information each time.

        Args:
            _message (minknow_api.promethion_device_pb2.GetPixelSettingsRequest, optional): The message to send.
                This can be passed instead of the keyword arguments.
            _timeout (float, optional): The call will be cancelled after this number of seconds
                if it has not been completed.
            pixels (int): The channels (one based) to return data for.
                A sparse map is accepted

        Returns:
            minknow_api.promethion_device_pb2.GetPixelSettingsResponse

        Note that the returned messages are actually wrapped in a type that collapses
        submessages for fields marked with ``[rpc_unwrap]``.
        """
        if _message is not None:
            if isinstance(_message, MessageWrapper):
                _message = _message._message
            return run_with_retry(
                self._stub.get_pixel_settings, _message, _timeout, [],
                "minknow_api.promethion_device.PromethionDeviceService")

        unused_args = set(kwargs.keys())

        _message = GetPixelSettingsRequest()

        if "pixels" in kwargs:
            unused_args.remove("pixels")
            _message.pixels.extend(kwargs['pixels'])
        else:
            raise ArgumentError(
                "get_pixel_settings requires a 'pixels' argument")

        if len(unused_args) > 0:
            raise ArgumentError(
                "Unexpected keyword arguments to get_pixel_settings: '{}'".
                format(", ".join(unused_args)))

        return run_with_retry(
            self._stub.get_pixel_settings, _message, _timeout, [],
            "minknow_api.promethion_device.PromethionDeviceService")
    def start_basecalling(self, _message=None, _timeout=None, **kwargs):
        if _message is not None:
            if isinstance(_message, MessageWrapper):
                _message = _message._message
            return run_with_retry(self._stub.start_basecalling, _message,
                                  _timeout, [],
                                  "minknow_api.basecaller.Basecaller")

        unused_args = set(kwargs.keys())

        _message = StartBasecallingRequest()

        if "input_reads_directories" in kwargs:
            unused_args.remove("input_reads_directories")
            _message.input_reads_directories.extend(
                kwargs['input_reads_directories'])

        if "output_reads_directory" in kwargs:
            unused_args.remove("output_reads_directory")
            _message.output_reads_directory = kwargs['output_reads_directory']

        if "configuration" in kwargs:
            unused_args.remove("configuration")
            _message.configuration = kwargs['configuration']

        if "fast5_out" in kwargs:
            unused_args.remove("fast5_out")
            _message.fast5_out = kwargs['fast5_out']

        if "compress_fastq" in kwargs:
            unused_args.remove("compress_fastq")
            _message.compress_fastq = kwargs['compress_fastq']

        if "disable_events" in kwargs:
            unused_args.remove("disable_events")
            _message.disable_events = kwargs['disable_events']

        if "recursive" in kwargs:
            unused_args.remove("recursive")
            _message.recursive = kwargs['recursive']

        if "barcoding_configuration" in kwargs:
            unused_args.remove("barcoding_configuration")
            _message.barcoding_configuration.CopyFrom(
                kwargs['barcoding_configuration'])

        if "alignment_configuration" in kwargs:
            unused_args.remove("alignment_configuration")
            _message.alignment_configuration.CopyFrom(
                kwargs['alignment_configuration'])

        if len(unused_args) > 0:
            raise ArgumentError(
                "Unexpected keyword arguments to start_basecalling: '{}'".
                format(", ".join(unused_args)))

        return run_with_retry(self._stub.start_basecalling, _message, _timeout,
                              [], "minknow_api.basecaller.Basecaller")