Skip to content

Commit f553d4d

Browse files
committed
Remove long-dead server-engine code.
This has not been used for ages. Fitting with a remote engine communicating over ssh has been almost always slower.
1 parent 40a429c commit f553d4d

10 files changed

Lines changed: 12 additions & 1568 deletions

File tree

diffpy/pdfgui/control/connection.py

Lines changed: 0 additions & 298 deletions
This file was deleted.

diffpy/pdfgui/control/controlerrors.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,6 @@ class ControlRuntimeError(ControlError):
6161
"""PDFGuiControl exception class -- various irrecoverable runtime error"""
6262
pass
6363

64-
class ControlConnectError(ControlError):
65-
"""PDFGuiControl exception class -- network connection error"""
66-
pass
67-
68-
69-
class ControlAuthError(ControlError):
70-
"""PDFGuiControl exception class -- authentication failed """
71-
pass
72-
7364

7465
class ControlIndexError(ControlError):
7566
"""PDFGuiControl exception class -- index out of bound """

diffpy/pdfgui/control/fitting.py

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,8 @@ def handleEngineException(error, gui=None):
5555

5656
##############################################################################
5757
class Fitting(Organizer):
58-
"""Fitting is the class to control a PdfFit process, which can be either
59-
running on a remote machine or locally. Fitting will start a thread to
60-
interact with the PdfFit server using ssh2 and XMLRPC protocol.
58+
"""Fitting is the class to control a PdfFit process running locally.
59+
Fitting will start a new thread to interact with the PdfFit server.
6160
6261
rw: fitness parameter
6362
tolerancy: accurancy requirement
@@ -117,8 +116,7 @@ def __init__(self, name):
117116
self.stopped = False
118117
self.paused = False
119118

120-
# rpc memeber
121-
self.host = None
119+
# the PDFfit2 server instance.
122120
self.server = None
123121

124122
# public data members
@@ -152,12 +150,8 @@ def __changeStatus(self, fitStatus=None, jobStatus=None):
152150

153151
def _release(self):
154152
"""release resources"""
155-
if self.host: # is not None (running on a remote server)
156-
self.host.releaseServer(self.server)
157-
self.host = None
158-
else:
159-
if self.server: # server has been allocated, we need free the memory
160-
self.server.reset()
153+
if self.server: # server has been allocated, we need free the memory
154+
self.server.reset()
161155

162156
def _getStrId(self):
163157
"""make a string identifier
@@ -320,16 +314,9 @@ def getServer(self):
320314
"""
321315
if self.fitStatus != Fitting.INITIALIZED:
322316
return
323-
324-
self.host = self.controlCenter.getHost()
325-
if self.host is None:
326-
# import directly from local host
327-
from diffpy.pdffit2 import PdfFit
328-
self.server = PdfFit()
329-
else:
330-
# get server without waiting.
331-
self.server = self.host.getServer()
332-
317+
# create a new instance of calculation server
318+
from diffpy.pdffit2 import PdfFit
319+
self.server = PdfFit()
333320
self.__changeStatus(fitStatus=Fitting.CONNECTED)
334321

335322

0 commit comments

Comments
 (0)