Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A few little changes, mostly getting pip install git+https://... to work on python2 and 3, and with newer astropy versions #51

Merged
merged 3 commits into from
Oct 5, 2018

Conversation

cjordan
Copy link
Contributor

@cjordan cjordan commented Oct 5, 2018

With these changes, I still couldn't get the test suite to work on my machine:

_______________________________________________________________________________________________________________________________________________ TestAntennaArray.test_unphs2src _______________________________________________________________________________________________________________________________________________

self = <tests.phs_test.TestAntennaArray testMethod=test_unphs2src>

    def test_unphs2src(self):
        self.aa.select_chans([1,2,3])
        self.aa.set_jultime(2454555.)
        src = a.phs.RadioFixedBody('0:00', '20:00')
        src.compute(self.aa)
        self.assertTrue(n.all(
>           self.aa.unphs2src(self.aa.gen_phs(src,0,1),src,0,1) == 1.))
E       AssertionError: False is not true

tests/phs_test.py:369: AssertionError
______________________________________________________________________________________________________________________________________________ TestCulgooraCatalog.test_metadata ______________________________________________________________________________________________________________________________________________

self = <culgoora_test.TestCulgooraCatalog testMethod=test_metadata>

    def setUp(self):
        self.cat = h.CulgooraCatalog()
>       self.cat.fromfile(h.CULGOORAFILE)

tests/catalog_tests/culgoora_test.py:8:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = {}, filename = '/usr/lib/python2.7/site-packages/aipy/_src/culgoora.txt'

    def fromfile(self,filename):
        '''Parses a tab-delimited text file for the Culgoora array.  When both
            80 MHz and 160 MHz measurements are available, catalog entries use
            mfreq=.160 and include a computed spectral index.  When only one
            measurement is available, mfreq is set for that measurement, and index
            is set to 0.'''
>       f = open(filename)
E       IOError: [Errno 2] No such file or directory: '/usr/lib/python2.7/site-packages/aipy/_src/culgoora.txt'

/usr/lib/python2.7/site-packages/aipy/_src/culgoora.py:35: IOError

(and more similar "can't find this text file" errors)

But, I did fix a few simple things.

By the way - not sure if the restriction on astropy should be enforced, but aipy's interface with MIRIAD data works fine for me on python3 and astropy > 3.0. The commit restricting astropy is commit fd08c48. If astropy should not be restricted to be < 2.0, then this should be relaxed to < 3.0 for python2, as python2 has no version >= 3.0.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 47.343% when pulling 34ba75d on cjordan:master into 05472fd on HERA-Team:master.

@pkgw
Copy link
Contributor

pkgw commented Oct 5, 2018

Thanks for the fixes!

To be honest, I am not sure what precisely motivated the astropy version requirement — the commit logs don't spell it out. I am tempted to just drop the restriction altogether.

@pkgw pkgw merged commit 5eff206 into HERA-Team:master Oct 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants