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

DM-14391 Simplify initialization of display_firefly and firefly_client #11

Merged
merged 6 commits into from May 17, 2018

Conversation

stargaser
Copy link
Contributor

Changes to the display_firefly backend to enable easier initialization. These changes go together with the 2.0.0+ version of firefly_client.

  • set default name to None, to allow firefly_client to auto-initialize the channel.
  • change host to url to track the new initialization of firefly_client.FireflyClient.
  • leave default url unspecified, to allow FireflyClient to initialize from environment variables, as will be provided in LSST Science Platform environments.
  • upon display creation, attempt to launch a browser, which now displays instructions for the user if the browser open is unsuccessful.
  • expose the FireflyClient instance and the browser url as attributes.
  • update the user instructions in the documentation.
  • reorganize the documentation to make it ready for publication on pipelines.lsst.io.

Copy link

@SimonKrughoff SimonKrughoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine, generally. I'm not familiar with FireflyClient so I have to take your word on those bits.

@@ -0,0 +1,273 @@
.. _display_firefly:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think doing a git mv would have let you preserve the diff.

_fireflyClient = firefly_client.FireflyClient(channel=name, **kwargs)
else:
_fireflyClient = firefly_client.FireflyClient(url,
channel=name, **kwargs)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to our standards, I think channel should be aligned with url.

_fireflyClient = firefly_client.FireflyClient(channel=name, **kwargs)
else:
_fireflyClient = firefly_client.FireflyClient(url,
channel=name, **kwargs)
except Exception as e:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typically it's better to trap the exceptions you expect. Trapping a bare exception means you can't tell what actually went wrong when something unexpected happens.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. I'll trap on the two exceptions that are raised, one for a nonsense url and one for a working web server that is not a Firefly url.

@stargaser stargaser merged commit 4bc099d into master May 17, 2018
@ktlim ktlim deleted the tickets/DM-14391 branch August 25, 2018 05:10
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.

None yet

2 participants