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

MAINT: Corrections to some of the parameter types in the docs and a couple lint-related fixes #653

Merged
merged 2 commits into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions pyvo/dal/adhoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def get_adhocservice_by_ivoid(self, ivo_id):

Parameters
----------
ivoid : str
ivo_id : str
the ivoid of the service we want to have.

Returns
Expand Down Expand Up @@ -417,8 +417,6 @@ def create_query(self, id, *, responseformat=None, **keywords):

Parameters
----------
baseurl : str
the base URL for the Datalink service
id : str
the dataset identifier
responseformat : str
Expand Down Expand Up @@ -936,7 +934,7 @@ def input_params(self):
return list(_get_input_params_from_resource(proc_resource).values())


class AxisParamMixin():
class AxisParamMixin:
"""
Stores the axis parameters (pos, band, time and pol) used in SODA
or SIA2 queries
Expand Down
8 changes: 3 additions & 5 deletions pyvo/dal/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,7 @@ def __init__(self, reason=None, cause=None, url=None):
----------
reason : str
a message describing the cause of the error
code : int
the HTTP error code (as an integer)
cause : str
cause : Exception
an exception issued as the underlying cause. A value
of None indicates that no underlying exception was
caught.
Expand Down Expand Up @@ -117,7 +115,7 @@ def __init__(self, cause=None, url=None, reason=None):

Parameters
----------
cause : str
cause : Exception
an exception issued as the underlying cause. A value
of None indicates that no underlying exception was caught.
url
Expand Down Expand Up @@ -150,7 +148,7 @@ def __init__(self, reason=None, code=None, cause=None, url=None):
a message describing the cause of the error
code : int
the HTTP error code (as an integer)
cause : str
cause : Exception
an exception issued as the underlying cause. A value
of None indicates that no underlying exception was
caught.
Expand Down
4 changes: 2 additions & 2 deletions pyvo/dal/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
identify table columns.
"""
__all__ = ["DALService", "DALServiceError", "DALQuery", "DALQueryError",
"DALResults", "Record"]
"DALResults", "Record", "UploadList"]

import os
import shutil
Expand Down Expand Up @@ -311,7 +311,7 @@ def __init__(self, votable, *, url=None, session=None):

Parameters
----------
votable : str
votable : astropy.io.votable.tree.VOTableFile
the service response parsed into an
astropy.io.votable.tree.VOTableFile instance.
url : str
Expand Down
9 changes: 5 additions & 4 deletions pyvo/dal/tap.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,12 @@ def _parse_examples(self, examples_uri, *, depth=0):
try:
root = xml.etree.ElementTree.parse(
io.BytesIO(response.content)).getroot()
exampleElements = root.findall('.//*[@property="query"]')
example_elements = root.findall('.//*[@property="query"]')
except Exception as ex:
raise DALServiceError.from_except(ex, examples_uri)

examples = [TAPQuery(self.baseurl, example.text)
for example in exampleElements]
for example in example_elements]

for continuation in root.findall('.//*[@property="continuation"]'):
examples.extend(
Expand Down Expand Up @@ -468,7 +468,7 @@ def describe(self, width=None):
Print a summary description of this service.

This includes the interface capabilities, and the content description
if it doesn't contains multiple data collections (in other words, it is
if it doesn't contain multiple data collections (in other words, it is
not a TAP service).
"""
if len(self.tables) == 1:
Expand Down Expand Up @@ -1018,7 +1018,8 @@ def fetch_result(self):
if result_uri is None:
self._update()
self.raise_if_error()
raise DALServiceError("No result URI available", self.url)
raise DALServiceError(reason="No result URI available",
url=self.url)

try:
response = self._session.get(self.result_uri, stream=True)
Expand Down
2 changes: 1 addition & 1 deletion pyvo/dal/vosi.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
__all__ = ['CapabilityMixin', 'VOSITables']


class EndpointMixin():
class EndpointMixin:
def _get_endpoint_candidates(self, endpoint):
"""Construct endpoint URLs from base URL and endpoint"""
urlcomp = urlparse(self.baseurl)
Expand Down
Loading