hipspy / hips

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

Add classmethod create_from_dict in WCSGeometry class #100

Closed adl1995 closed 7 years ago

adl1995 commented 7 years ago

As @cdeil mentioned in #82, I have added a classmethod create_from_dict in WCSGeometry class. Now the user can pass either a dict or a WCSGeometry object itself. There is also a convenience method make in WCSGeometry which creates the object from dict parameters, if required.

adl1995 commented 7 years ago

@tboch I've made the changes, however, Travis CI build is failing. I don't know what's causing this, the line reads: https://travis-ci.org/hipspy/hips/jobs/260162492#L1260

INTERNALERROR> AttributeError: 'NoneType' object has no attribute 'lineno'

The tests do pass locally.

tboch commented 7 years ago

Thanks for letting me know about the failing test, I was about to ask.

Merging now

cdeil commented 7 years ago

Concerning the error you mentioned above, it's not related to our hips package. I'll try to follow up and get it fixed: https://github.com/astropy/astropy/issues/5277#issuecomment-319956530

Locally I see this fail: https://gist.github.com/cdeil/e1383b1270d32c12a87d7954958f9b82 @adl1995 - Can you please fix in a follow-up PR, and also remove the commented out print statement?

I'd also suggest to improve the docstring for this new method. There must be a way for a user to figure out which options they can pass, no? For now, adding a sentence saying that extra options are forwarded to create would be useful, i.e. users can see the list of options there.

One more thing: in http://hips.readthedocs.io/en/latest/api/hips.WCSGeometry.html#hips.WCSGeometry.create you can see that the link to

fov: str or `~astropy.coordinates.Angle`

is broken. The cause is a missing space before the colon, it should be

fov : ...

@adl1995 - Can you please fix that as well in the the same follow-up PR, and generally fix and improve such little things whenever you notice them?