Skip to content

Commit

Permalink
[DM-41830] Fix up linter and ordering issuse
Browse files Browse the repository at this point in the history
  • Loading branch information
cbanek committed Dec 4, 2023
1 parent 95d5e5f commit 5a24979
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 20 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ install_requires =
kubernetes
maproxy
notebook
pyvo
pyvo @ git+https://github.com/astropy/pyvo.git@7682a1809cb2169cc2ffd9313feb6a4abd7f7e37
requests
tornado

Expand Down
16 changes: 9 additions & 7 deletions src/lsst/rsp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,21 @@

__all__ = [
"__version__",
"Forwarder",
"get_catalog",
"get_obstap_service",
"get_tap_service",
"retrieve_query",
"IPythonHandler",
"format_bytes",
"forward_lsst_log",
"Forwarder",
"get_datalink_result",
"get_siav2_service",
"format_bytes",
"get_access_token",
"get_catalog",
"get_digest",
"get_hostname",
"get_node",
"get_pod",
"get_tap_service",
"get_obstap_service",
"retrieve_query",
"get_hostname",
"get_pyvo_auth",
"show_with_bokeh_server",
]
2 changes: 0 additions & 2 deletions src/lsst/rsp/catalog.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import os
import warnings
from typing import Optional

import pyvo
from deprecated import deprecated
Expand Down
16 changes: 9 additions & 7 deletions src/lsst/rsp/service.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
import os

import pyvo
from pyvo.dal import SIA2Service
from pyvo.dal.adhoc import DatalinkResults
from pyvo.dal.sia2 import ObsCoreRecord

from utils import get_pyvo_auth, get_service_url
from .utils import get_pyvo_auth, get_service_url

LSST_CLOUD = [
"https://data.lsst.cloud",
"https://data-int.lsst.cloud",
"https://data-dev.lsst.cloud"
"https://data-int.lsst.cloud",
"https://data-dev.lsst.cloud",
]

USDF = [
"https://usdf-rsp.slac.stanford.edu",
"https://usdf-rsp-dev.slac.stanford.edu"
"https://usdf-rsp-dev.slac.stanford.edu",
]


def get_datalink_result(result) -> DatalinkResults:
def get_datalink_result(result: ObsCoreRecord) -> DatalinkResults:
"""Helper function to return the datalink part of the result."""
return DatalinkResults.from_result_url(result.getdataurl(),session=get_pyvo_auth())
return DatalinkResults.from_result_url(
result.getdataurl(), session=get_pyvo_auth()
)


def get_siav2_service(*args: str) -> SIA2Service:
Expand Down
5 changes: 2 additions & 3 deletions src/lsst/rsp/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import pyvo.auth.authsession
import requests


_NO_K8S = False

try:
Expand Down Expand Up @@ -56,7 +55,7 @@ def get_hostname() -> str:
return os.environ.get("HOSTNAME") or "localhost"


def get_service_url(name: str, env_name=None) -> str:
def get_service_url(name: str, env_name: Optional[str] = None) -> str:
if not env_name:
env_name = name.upper()

Expand Down Expand Up @@ -132,7 +131,7 @@ def jupyter_proxy_url(port: Optional[int] = None) -> str:
# The type: ignore is needed because the alternate form of notebook_url
# (https://docs.bokeh.org/en/latest/docs/reference/io.html#bokeh.io.show)
# isn't in bokeh's type hints.
bokeh.io.show(obj=obj, notebook_url=jupyter_proxy_url) # type:ignore
bokeh.io.show(obj=obj, notebook_url=jupyter_proxy_url)


def get_pod() -> Optional[client.V1Pod]:
Expand Down

0 comments on commit 5a24979

Please sign in to comment.