Skip to content

Commit

Permalink
Version 4.5.0 bump
Browse files Browse the repository at this point in the history
  • Loading branch information
minknowbot committed Jan 15, 2022
1 parent cf21fa2 commit e8bfbcb
Show file tree
Hide file tree
Showing 7 changed files with 291 additions and 172 deletions.
11 changes: 11 additions & 0 deletions proto/minknow_api/analysis_configuration.proto
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,17 @@ message BasecallerConfiguration
//
// Since 4.1
LampConfiguration lamp_configuration = 7;

// Enable read splitting in guppy.
//
// Since 4.5
bool enable_read_splitting = 8;

// Override score to use for guppy read splitting. If not specified a default value
// is used from guppy.
//
// Since 4.5
google.protobuf.FloatValue min_score_read_splitting = 9;
}

message SetBasecallerConfigurationRequest
Expand Down
10 changes: 8 additions & 2 deletions proto/minknow_api/manager.proto
Original file line number Diff line number Diff line change
Expand Up @@ -617,8 +617,14 @@ message BasecallerApiResponse {
message GetGuppyInfoRequest {}

message GetGuppyInfoResponse {
// The port Guppy is listening on.
uint32 port = 1;
oneof connection_type {
// The port Guppy is listening on.
uint32 port = 1;

// The path to an ipc file Guppy is using.
// Use "ipc://<ipc_path>" for a guppy connection string.
string ipc_path = 3;
}

// The Guppy server version.
string version = 2;
Expand Down
2 changes: 1 addition & 1 deletion python/minknow_api/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '4.4.0'
__version__ = '4.5.0'
148 changes: 84 additions & 64 deletions python/minknow_api/analysis_configuration_pb2.py

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions python/minknow_api/analysis_configuration_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,13 @@ def set_basecaller_configuration(self, _message=None, _timeout=None, **kwargs):
If no configuration is specified lamp is disabled.
Since 4.1
enable_read_splitting (bool, optional): Enable read splitting in guppy.
Since 4.5
min_score_read_splitting (google.protobuf.wrappers_pb2.FloatValue, optional): Override score to use for guppy read splitting. If not specified a default value
is used from guppy.
Since 4.5
Returns:
minknow_api.analysis_configuration_pb2.SetBasecallerConfigurationResponse
Expand Down Expand Up @@ -457,6 +464,14 @@ def set_basecaller_configuration(self, _message=None, _timeout=None, **kwargs):
unused_args.remove("lamp_configuration")
_message.configs.lamp_configuration.CopyFrom(kwargs['lamp_configuration'])

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

if "min_score_read_splitting" in kwargs:
unused_args.remove("min_score_read_splitting")
_message.configs.min_score_read_splitting.value = kwargs['min_score_read_splitting']

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

Expand Down Expand Up @@ -513,6 +528,13 @@ def preload_basecaller_configuration(self, _message=None, _timeout=None, **kwarg
If no configuration is specified lamp is disabled.
Since 4.1
enable_read_splitting (bool, optional): Enable read splitting in guppy.
Since 4.5
min_score_read_splitting (google.protobuf.wrappers_pb2.FloatValue, optional): Override score to use for guppy read splitting. If not specified a default value
is used from guppy.
Since 4.5
Returns:
minknow_api.analysis_configuration_pb2.SetBasecallerConfigurationResponse
Expand Down Expand Up @@ -560,6 +582,14 @@ def preload_basecaller_configuration(self, _message=None, _timeout=None, **kwarg
unused_args.remove("lamp_configuration")
_message.configs.lamp_configuration.CopyFrom(kwargs['lamp_configuration'])

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

if "min_score_read_splitting" in kwargs:
unused_args.remove("min_score_read_splitting")
_message.configs.min_score_read_splitting.value = kwargs['min_score_read_splitting']

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

Expand Down
31 changes: 31 additions & 0 deletions python/minknow_api/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from google.protobuf import timestamp_pb2
import grpc
import logging
import typing
import minknow_api
import minknow_api.basecaller_service
import minknow_api.manager_service
Expand Down Expand Up @@ -86,6 +87,12 @@ def close(self):
self.channel = None


GuppyConnectionInfo = typing.NamedTuple(
"GuppyConnectionInfo",
[("port", typing.Optional[int]), ("ipc_path", typing.Optional[str]),],
)


class Manager(ServiceBase):
"""A connection to the manager gRPC interface.
Expand Down Expand Up @@ -240,6 +247,30 @@ def guppy_port(self, timeout=DEFAULT_TIMEOUT):
"""
return self.rpc.get_guppy_info(_timeout=timeout).port

def get_guppy_connection_info(self, timeout=DEFAULT_TIMEOUT):
"""Get the port and ipc_path that Guppy is listening to.
This can be used to directly connect to the Guppy server using the pyguppy client.
Guppy only listens on either a port or the ipc path. The default changes based on OS.
Calling code should change its behaviour based on which tuple field is not None.
Args:
timeout (float, optional): The maximum time to wait for the call to complete. Should
usually be left at the default.
Returns:
GuppyConnectionInfo: Either the port or path guppy is listening on.
"""
guppy_info = self.rpc.get_guppy_info(_timeout=timeout)
port = None
ipc_path = None
if guppy_info.port != 0:
port = guppy_info.port
else:
ipc_path = guppy_info.ipc_path
return GuppyConnectionInfo(port, ipc_path)

def describe_host(self, timeout=DEFAULT_TIMEOUT):
"""Get information about the machine running MinKNOW.
Expand Down
231 changes: 126 additions & 105 deletions python/minknow_api/manager_pb2.py

Large diffs are not rendered by default.

0 comments on commit e8bfbcb

Please sign in to comment.