fermiPy / fermipy

Fermi-LAT Python Analysis Framework
http://fermipy.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
52 stars 53 forks source link

Undefined names #132

Closed cdeil closed 5 years ago

cdeil commented 7 years ago

There's a few undefined names in Fermipy (i.e. completely broken code):

$ pyflakes fermipy | grep 'undefined'
fermipy/scripts/preprocess_data.py:174:39: invalid syntax
    print "Writing ft1 file list: %s\n" % lstfile
                                      ^
fermipy/batch.py:10: undefined name 'dispatch_jobs' in __all__
fermipy/hpx_utils.py:558: undefined name 'i'
fermipy/hpx_utils.py:773: undefined name 'xrange'
fermipy/hpx_utils.py:878: undefined name 'mult_dhu'
fermipy/plotting.py:386: undefined name 'dataT'
fermipy/plotting.py:1273: undefined name 'fmt'
fermipy/plotting.py:1298: undefined name 'fmt'
fermipy/plotting.py:1305: undefined name 'fmt'
fermipy/roi_model.py:2124: undefined name 'fits_utils'
fermipy/skymap.py:539: undefined name 'Galactic'
fermipy/skymap.py:541: undefined name 'ICRS'
fermipy/skymap.py:672: undefined name 'ew_hpx'
fermipy/tsmap.py:565: undefined name 'logger'
fermipy/tsmap.py:566: undefined name 'logger'
fermipy/tsmap.py:634: undefined name 'logger'
fermipy/tsmap.py:635: undefined name 'logger'
fermipy/utils.py:1043: undefined name 'unicode'
fermipy/utils.py:1259: undefined name 'basestring'
fermipy/jobs/file_archive.py:814: undefined name 'argparse'
fermipy/jobs/job_archive.py:372: undefined name 'key'
fermipy/jobs/job_archive.py:506: undefined name 'table_file'
fermipy/scripts/run_tempo.py:68: undefined name 'ROOT'
fermipy/scripts/run_tempo.py:86: undefined name 'ROOT'
fermipy/scripts/run_tempo.py:168: undefined name 'x'
fermipy/scripts/run_tempo.py:169: undefined name 'x'
fermipy/scripts/run_tempo.py:174: undefined name 'x'
fermipy/scripts/run_tempo.py:176: undefined name 'x'
fermipy/scripts/run_tempo.py:179: undefined name 'x'

I'll make a PR for the first one (the trivial issue with print) now. @woodmd - Could you please look at the other ones and either remove that code if unused, or fix it?

cdeil commented 7 years ago

Note: some code is now in gammapy.maps and should be edited there.

cdeil commented 7 years ago

@woodmd - There's also these bugs in gammapy.maps:

$ pyflakes gammapy/maps | grep 'undefined'
gammapy/maps/geom.py:32: undefined name 'center'
gammapy/maps/hpx.py:998: undefined name 'energies'
gammapy/maps/hpx.py:999: undefined name 'energies'
gammapy/maps/hpx.py:1000: undefined name 'energies'
gammapy/maps/hpx.py:1000: undefined name 'energies'
gammapy/maps/hpx.py:1109: undefined name 'mult_dhu'
gammapy/maps/hpxcube.py:50: undefined name 'HPX'
gammapy/maps/hpxcube.py:50: undefined name 'ebins'
gammapy/maps/hpxcube.py:56: undefined name 'ebins'
gammapy/maps/hpxcube.py:99: undefined name 'HpxToWcsMapping'
gammapy/maps/hpxcube.py:196: undefined name 'lat'
gammapy/maps/hpxcube.py:197: undefined name 'lon'
gammapy/maps/hpxcube.py:201: undefined name 'lon'
gammapy/maps/hpxcube.py:201: undefined name 'lat'
gammapy/maps/hpxcube.py:201: undefined name 'egy'
gammapy/maps/hpxcube.py:201: undefined name 'interp_log'
gammapy/maps/hpxcube.py:229: undefined name 'utils'
gammapy/maps/hpxcube.py:231: undefined name 'utils'
gammapy/maps/hpxcube.py:235: undefined name 'map_coordinates'
gammapy/maps/hpxcube.py:275: undefined name 'ew_hpx'
gammapy/maps/hpxmap.py:81: undefined name 'fits_utils'
gammapy/maps/hpxmap.py:222: undefined name 'ew_hpx'
gammapy/maps/hpxmap.py:286: undefined name 'i'

Can you fix them or should I make a reminder issue in the Gammapy tracker? (I probably won't have time this week to do it)

woodmd commented 7 years ago

Yes I can take care of these. The HEALPix classes are far from complete so I will likely be continuing to make substantial changes in gammapy.maps over the next month.