ISISComputingGroup / lewis-ess

Let's write intricate simulators!
GNU General Public License v3.0
21 stars 19 forks source link

Decouple adapter construction and device binding #210

Closed MichaelWedel closed 7 years ago

MichaelWedel commented 7 years ago

This fixes #207.

With these changes, device is no longer an argument of Adpater.__init__. This makes it possible to construct an adapter without the need of having a device object available at exactly that point. As a side-effect, it is now also much easier to "re-bind" another device, e.g. to swap out the device at runtime completely seamlessly (from the adapter's point of view). This will make it much easier to implemented #98.

Also, device is now a "proper" member of Adapter, making it less awkward to access the device when writing an interface. The internal _device still works, but maybe we should add a recommendation to the release notes that device is now available and should be used instead.

The user facing documentation has been updated.

MikeHart85 commented 7 years ago

Cannot see any issues with this.... ready to merge if you are :+1: