pcdshub / lightpath

LCLS Lightpath Module
https://pcdshub.github.io/lightpath
Other
4 stars 9 forks source link

MAINT: Update to latest pcdsdevices, happi #46

Closed teddyrendahl closed 6 years ago

teddyrendahl commented 6 years ago

Description

This pull request makes lightpath work with happi > 0.5.x and pcdsdevices > 0.3.x. The major changes that affected the lightpath were:

  1. Metadata is no longer tacked on to the device. All references to device.z had to be changed to device.md.z
  2. MPS devices are no longer associated with devices. They will be in the happi database as a separate object
  3. All device loading should be done in happi.

For the actual BeamPath code, I deprecated all the references to the MPS system. In the future, we will just create a small object MPSSummary that manages the entire MPS system for a beamline. These will also be displayed in their own panel in the purpose of the GUI.

The most frustrating change is that the UI used to treat happi.Device objects and pcdsdevices objects the same. Now that the latter has metadata contained in the md attribute, that code does not work. For now I have just decided to remove them from the main lightpath GUI. I think the answer in the end is to have a separate panel where disconnected devices are displayed.

Motivation and Context

Should now be importable in newer releases of pcds-envs

In the end, this PR is a step back in terms of feature set but nothing that was heavily used was taken away. It can be used in the new hutch-python environment. The rest will be addressed during the UI re-release.

How Has This Been Tested?

Updated tests to match new library expectations. Also created a BeamPath in the current mfxpython environment to do a live check.

codecov-io commented 6 years ago

Codecov Report

Merging #46 into master will decrease coverage by 4.89%. The diff coverage is 88%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master      #46     +/-   ##
=========================================
- Coverage   91.68%   86.78%   -4.9%     
=========================================
  Files           6        6             
  Lines         457      386     -71     
=========================================
- Hits          419      335     -84     
- Misses         38       51     +13
Impacted Files Coverage Δ
lightpath/path.py 82.51% <100%> (-7.16%) :arrow_down:
lightpath/controller.py 77.5% <60%> (-11.39%) :arrow_down:
lightpath/ui/gui.py 92.43% <87.5%> (+2.26%) :arrow_up:
lightpath/ui/widgets.py 89.74% <0%> (-10.26%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 191e5df...1220122. Read the comment docs.