hipspy / hips

Python library to handle HiPS
https://hips.readthedocs.io
13 stars 16 forks source link

Update tile_access_url method #52

Closed adl1995 closed 7 years ago

adl1995 commented 7 years ago

Updated the tile_access_url method as mentioned in #51.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.04%) to 85.41% when pulling ac5704015fcc652081fdc9d2a1f4026109b8e592 on adl1995:tile_access_url into 379e4cbcdaea14d80dbb48a7a45dd20e2be2f052 on hipspy:master.

tboch commented 7 years ago

@adl1995 - please modify your test_tile_access_urlfunction to assert the URL of arguments order=9, tile_index=54321 As you know, tiles are grouped in directories by 10,000 items, thus these arguments should return URL http://alasky.u-strasbg.fr/DSS/DSSColor/Norder9/Dir50000/ This test should bring up an issue with your current code.

adl1995 commented 7 years ago

I have updated the code to compute directory number using: np.around(ipix, decimals=-(len(str(ipix)) - 1)). This works for ipix = 54321, which returns 50000. But, for ipix = 448, it returns 400, when instead, it should return 0.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.2%) to 85.542% when pulling 4acfa8dd1307734dc6b1975588c24abeafadb4cb on adl1995:tile_access_url into 379e4cbcdaea14d80dbb48a7a45dd20e2be2f052 on hipspy:master.

tboch commented 7 years ago

@adl1995 - instead of np.around(ipix, decimals=-(len(str(ipix)) - 1)), I suggest using (ipix // 10000) * 10000

adl1995 commented 7 years ago

@tboch Thanks! That worked.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.2%) to 85.542% when pulling f7aa6c9aa4e6bee51dab7801d7910f02b69dc0eb on adl1995:tile_access_url into 379e4cbcdaea14d80dbb48a7a45dd20e2be2f052 on hipspy:master.