src.serviceManager module¶
-
class
src.serviceManager.
ServiceManager
¶ Bases:
PyQt5.QtCore.QObject
Handles the connections to the microservices (KNN,Projector,Transformer)
- Parameters
QObject (QObject) – So that we can use signals/slots
-
KNNprogressSignal
¶
-
ProjectorprogressSignal
¶
-
TransformerprogressSignal
¶
-
addPointsToValidationKNN
(points)¶ Add transformed points to the validation kNN to validate precision when later requested.
- Parameters
points ([[float]]) – transformed points in 2D/3D
-
changeProjector
(name)¶ Change the active projector and transformer types.
- Parameters
name (string) – name of projection method
- Returns
returns true if projector type was changed (false if already correct)
- Return type
bool
-
clearValidationKNN
()¶ Clear validation kNN buffer with all transformed points of previous transformation.
-
densityRequestSignal
¶
-
getKNNProgress
()¶ Send a gRPC message to KNN to get the progress
-
getKNNRequest
(sentence)¶ Send a gRPC message to KNN to get the result of KNN request
- Parameters
sentence (string) – The linalg expression of the request. For example, king - man + woman
-
getPoints
(filePath, m)¶ Slot for the getPoints timer, retrieves the points from the transformer
- Parameters
filePath (string) – The path to the file we want to transform (note doesnt have to be the same one as the one which the model was projected on (WIP))
m (bytes) – the pickle result for python of the model
-
getProjectorModel
()¶ Send a gRPC message to Projector to get the current trained model
-
getProjectorProgress
()¶ Send a gRPC message to projector to get the progress
-
getServiceProgress
(serviceType, name, serviceProtos, signal, timer)¶ Send a gRPC message to a service to get the progress
-
getTransformerProgress
()¶ Send a gRPC message to transformer to get the progress
-
isServiceActive
(serviceType)¶ Gives the current active service of a service type.
- Parameters
serviceType (string) – service type as defined as keys in self.stubs
- Returns
the stub of the requested service
- Return type
gRPC stub
-
knnRequestSignal
¶
-
makeDensityRequest
(densityWord)¶
-
newPointsSignal
¶
-
newProjectorModelSignal
¶
-
setupKNNs
()¶ Setup kNN microservices.
-
setupProjectors
()¶ Setup projector microservices.
-
setupService
(serviceType, name, scriptPath, channelAddress, stubFunc, serviceProtos)¶ Create a separate process for the projector (gRPC)
- Parameters
filePath (string) – The path to the file containing the data embedding (which we want to project)
-
setupTransformers
()¶ Start up the transformer microservices.
-
startKNN
(filePath)¶ Actually start the KNN service for a file
- Parameters
filePath (string) – Path to the file with embeddings
-
startProjection
(filePath)¶ Starts the projection on the active projector service.
- Parameters
filePath (string) – The path to the file containing the data embedding (which we want to project)
-
startTransformer
(filePath, m)¶ Gets the projection (gRPC)
- Parameters
filePath (string) – The path to the file we want to transform (note doesnt have to be the same one as the one which the model was projected on (WIP))
m (bytes) – the pickle result for python of the model
-
startValidateProjection
(filePath)¶ Starts validation kNN service to validate the projection.
- Parameters
filePath (string) – Path to the file with embeddings
-
stopTransformer
()¶ Stop the projection