Package schrodinger :: Package application :: Package glide :: Package packages :: Module sp_filter :: Class CutoffCalculatorClient
[hide private]
[frames] | no frames]

Class CutoffCalculatorClient

      object --+    
               |    
CutoffCalculator --+
                   |
                  CutoffCalculatorClient

Subclass of CutoffCalculator which acts as a proxy to a remote CutoffCalculator, connecting via HTTP. If the connection fails, CutoffCalculatorClient falls back to computing the cutoffs on its own using locally available information.

Instance Methods [hide private]
float
__init__(self, host, port, server_id, timeout=3.1, batch_size=1, **kwds)
x.__init__(...) initializes x; see help(type(x)) for signature
 
addPoseRemote(self, pose)
Add the latest pose to a local queue; if the batch size (specified while constructing the CutoffCalculatorClient) is reached, post the poses to the server and empty the queue.
dict
post(self)
POST the current batch to the cutoff calculator server.
 
addPoseAndUpdateCutoff(self, pose)
Add a pose to the calculator and update the new cutoff.

Inherited from CutoffCalculator: addPoses, checkScore, computeInitialCutoff, getCutoffs, getScores

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, host, port, server_id, timeout=3.1, batch_size=1, **kwds)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • host (str) - server hostname or IP address
  • port (int) - server port
  • server_id (str) - uuid used to ensure we are talking to the right server.
  • timeout - time in seconds before giving up on a connection. The default value follows the recommendation from http://docs.python-requests.org/en/master/user/advanced/#timeouts ("slightly larger than a multiple of 3, which is the default TCP packet retransmission window").
  • batch_size (int) - number of poses to process between connections
Returns: float
Overrides: object.__init__

addPoseRemote(self, pose)

 

Add the latest pose to a local queue; if the batch size (specified while constructing the CutoffCalculatorClient) is reached, post the poses to the server and empty the queue.

Parameters:
  • pose (Pose) - pose to add

post(self)

 

POST the current batch to the cutoff calculator server.

Returns: dict
dictionary of data from the server (cutoff and next_cutoff)

addPoseAndUpdateCutoff(self, pose)

 

Add a pose to the calculator and update the new cutoff.

Parameters:
  • pose - current pose
Overrides: CutoffCalculator.addPoseAndUpdateCutoff
(inherited documentation)