-
Notifications
You must be signed in to change notification settings - Fork 16
DM-5192 Implement Python API to support Firefly actions. #130
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
Conversation
|
The test file, firefly/test/python/demo-notebook.ipynb, can be run by setting PYTHONPATH = where firefly/python/display/FireflyClient.py is located. |
Clean up |
in the test files you should use relative paths to the data. The put come documentation at the top saying which directly to expect to start notebook in. |
Review Complete. Code looks good. Good Job. |
Copied from DM-5192 (I couldn't put all of these in comments on code diffs since many are legacy issues): Here are some style comments on the FireflyClient.py module, drawn in part from the DM Python Style Guide. I'm still thinking about the method signatures in detail and will comment a little later on those.
|
This is another comment not on the specific diffs in this pull request: As far as the API goes: I know that the Javascript API is organized around Actions. Python users will want to get information back from Firefly. So a simple |
I like the naming of Similarly, |
"source": [ | ||
"import os\n", | ||
"\n", | ||
"from FireflyClient import *\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use from FireflyClient import FireflyClient
. I also wonder if the module should be named fireflyClient.py
-- I couldn't tell for sure from reading the DM Python Style guide.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also they may be trying to get away from camel casing. At one time they decided they wanted to do it like they but I remember some discussion. Might be worth asking Tim Jenness
I think you are right about the naming. However, the names where made to be similar to the afw.display api. We should probably make better name and be aware they they will be different. Maybe down the road we can improve the afw.display names. |
if not retval: | ||
a= algorithm if algorithm.lower() in FireflyClient.stretchAlgorithmDict else 'linear' | ||
retval= FireflyClient.createRV('zscale',1,2,a,25,600,120) | ||
return retval | ||
|
||
|
||
@staticmethod |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make this a @classmethod
since it references the class
Another comment on legacy code: The methods for specifying the stretch of the image look very forbidding to the astronomer, especially |
"outputs": [], | ||
"source": [ | ||
"#file= fc.uploadFile('./data/c.fits')\n", | ||
"file= fc.uploadFile('/hydra/cm/firefly/src/firefly/test/python/data/wise-1b-1.fits')\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The user might be using standalone firefly-exec.war
so please use a relative path: .data/wise-1b-1.fits
Review complete. The region functionality is very nice! |
An extra note. Tim Jenness confirmed that LSST will move towards more Pythonic lowercase_and_underscores instead of camelCase. The DM Python style guide needs updating. So we should rename |
…t/python from fftools to be under firefly and firefly/test
…the target or the plot center.
…eated. update python code per code review comments.
c203fdb
to
b4dcf18
Compare
Fixed some region/footprint related issues in Javascript implementation,