astropy/astropy — pull request #2674 by hugobuddel (2014-07-01 14:12:53+00:00)
Title: Instantiate SAMPClient in connect(), not __init__() [#2673]

This commit fixes [#2673] that prevents SAMPIntegratedClient instances to reconnect to the SAMP hub after they have been disconnected. This is achieved by instantiating the SAMPClient in `connect()` instead of `__init__()` of SAMPIntegratedClient.

Although it works, it is rather ugly because the parameters for the SAMPClient still have to be set in `__init__()`; it would be cleaner to move all of those to `connect()`. This is not done in order to preserve backwards compatibility. Some of the parameters are in `connect()` already in order to connect the SAMPHubProxy instance. Supposedly the parameters for the HubProxy could be different from the Client, but does that make sense?

The code can be made substantially simpler if we don't care about backwards compatibility and disregard different settings for the HubProxy and for the Client. This simplification might be feasible since astropy 0.4 would be the first release to include samp support, so there is no compatibility to break. This would require changes to the documentation, which are not necessary now.

This is my first pull request for astropy, so review with care. E.g., the accompanying test uses fixtures, which is not very common in astropy it seems; is this acceptable?