cms-gem-daq-project / gem-plotting-tools

Repository for GEM commissioning plotting tools
GNU General Public License v3.0
1 stars 26 forks source link

Bug Report: Missing import in getSubArray() #217

Closed bdorney closed 5 years ago

bdorney commented 5 years ago

Brief summary of issue

Missing import statement causes a NameError to be raised.

Types of issue

Expected Behavior

No exception should be thrown

Current Behavior

Stack trace is:

Traceback (most recent call last):
  File "/opt/cmsgemos/bin/testConnectivity.py", line 1210, in <module>
    testConnectivity(args)
  File "/opt/cmsgemos/bin/testConnectivity.py", line 871, in testConnectivity
    dacAnalysis(args, calTree.gemTree, chamber_config, scandate=startTime)
  File "/usr/lib/python2.7/site-packages/gempython/gemplotting/utils/anautilities.py", line 54, in dacAnalysis
    vfatIDArray = getSubArray(vfatArray, ['vfatID','vfatN'])
  File "/usr/lib/python2.7/site-packages/gempython/gemplotting/utils/anautilities.py", line 884, in getSubArray
    dtype2 = np.dtype({name:structArray.dtype.fields[name] for name in fields})
NameError: global name 'np' is not defined

Steps to Reproduce (for bugs)

  1. testConnectivity.py -d 1 6 0x1

Possible Solution (for bugs)

Add:

import numpy as np

To:

https://github.com/cms-gem-daq-project/gem-plotting-tools/blob/a535580d4b83126624e925011502396df1281ac7/utils/anautilities.py#L874-L885

Your Environment

bdorney commented 5 years ago

Closes by #218