Skip to content

Commit

Permalink
Merge pull request #41 from alercebroker/maintenance
Browse files Browse the repository at this point in the history
Maintenance
  • Loading branch information
ignacioreyes authored Jun 28, 2024
2 parents 7c55758 + 4ed1f5c commit 53d8bea
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 29 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![image](https://github.com/alercebroker/alerce_client_new/workflows/Tests/badge.svg)![image](https://codecov.io/gh/alercebroker/alerce_client_new/branch/master/graph/badge.svg?token=ZUHW7C308N)![image](https://readthedocs.org/projects/alerce/badge/?version=latest)
![image](https://github.com/alercebroker/alerce_client/workflows/Tests/badge.svg)![image](https://codecov.io/gh/alercebroker/alerce_client/branch/master/graph/badge.svg)![image](https://readthedocs.org/projects/alerce/badge/?version=latest)


Welcome to ALeRCE Python Client.
Expand Down
10 changes: 6 additions & 4 deletions alerce/crossmatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def catshtm_conesearch(self, ra, dec, radius, catalog_name="all", format="pandas
----------
ra : :py:class:`float`
Right ascension in Degrees.
def : :py:class:`float`
dec : :py:class:`float`
Declination in Degrees.
catalog_name : :py:class:`str`
catsHTM Catalog name, `"all"` can be used to query all available catalogs. List of available catalogs can be found in `here <https://alerceapi.readthedocs.io/en/latest/catshtm.html#id1>`_.
Expand Down Expand Up @@ -153,7 +153,7 @@ def catshtm_crossmatch(self, ra, dec, radius, catalog_name="all", format="pandas
----------
ra : :py:class:`float`
Right ascension in Degrees.
def: :py:class:`float`
dec: :py:class:`float`
Declination in Degrees.
catalog_name : :py:class:`str`
catsHTM Catalog name, `"all"` can be used to query all available catalogs. List of available catalogs can be found in `here <https://alerceapi.readthedocs.io/en/latest/catshtm.html#id1>`_.
Expand Down Expand Up @@ -203,8 +203,10 @@ def catshtm_redshift(self, ra, dec, radius, format="votable", verbose=False):
Parameters
----------
oid : :py:class:`str`
object ID in ALeRCE DBs.
ra : :py:class:`float`
Right ascension in Degrees.
dec: :py:class:`float`
Declination in Degrees.
radius : :py:class:`float`
catsHTM conesearch radius in arcsec.
format : :py:class:`str`
Expand Down
1 change: 0 additions & 1 deletion alerce/direct.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@


class AlerceDirect(Client):

"""Handles direct request to the database using the available http API"""

def __init__(self, **kwargs):
Expand Down
5 changes: 2 additions & 3 deletions alerce/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def to_json(self):
pass

@abc.abstractmethod
def to_csv(self, index=None, sort=None):
def to_csv(self):
pass

def result(self, index=None, sort=None):
Expand Down Expand Up @@ -82,7 +82,6 @@ def to_csv(self):


class ResultCsv(Result):

"""Object that holds a csv type result"""

def __init__(self, csv_result_byte, **kwargs):
Expand Down Expand Up @@ -143,7 +142,7 @@ def load_config_from_object(self, object):

def _validate_format(self, format):
format = format.lower()
if not format in self.allowed_formats:
if format not in self.allowed_formats:
raise FormatValidationError(
"Format '%s' not in %s" % (format, self.allowed_formats), code=500
)
Expand Down
10 changes: 5 additions & 5 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@
html_theme_options = {"logo": "img/logo.png"}

intersphinx_mapping = {
"pandas":("https://pandas.pydata.org/pandas-docs/stable/",None),
"astropy":("http://docs.astropy.org/en/stable/",None),
'python': ('https://docs.python.org/3', None),
"pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None),
"astropy": ("http://docs.astropy.org/en/stable/", None),
"python": ("https://docs.python.org/3", None),
}

master_doc = 'index'
master_doc = "index"

source_suffix = '.rst'
source_suffix = ".rst"
28 changes: 14 additions & 14 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
from setuptools import setup, find_packages
from setuptools import setup, find_packages

with open("requirements.txt") as f:
required_packages = f.readlines()

# read the contents of your README file
from os import path

this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, "README.md"), encoding="utf-8") as f:
long_description = f.read()
__version__ = "1.2.0"

__version__ = "1.2.1"

setup(
name='alerce',
version=__version__,
description='ALeRCE Client',
long_description_content_type="text/markdown",
long_description=long_description,
author='ALeRCE Team',
author_email='[email protected]',
packages=find_packages(),
install_requires=required_packages,
name="alerce",
version=__version__,
description="ALeRCE Client",
long_description_content_type="text/markdown",
long_description=long_description,
author="ALeRCE Team",
author_email="[email protected]",
packages=find_packages(),
install_requires=required_packages,
)

4 changes: 3 additions & 1 deletion tests/test_direct.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@ def test_query_format_votable(mock_request):
@patch.object(Session, "request")
def test_query_format_error(mock_request):
mock_request.return_value.status_code = 200
mock_request.return_value.content.decode.return_value = "mjd,oid,oid\n1,5,5\n2,6,6\n"
mock_request.return_value.content.decode.return_value = (
"mjd,oid,oid\n1,5,5\n2,6,6\n"
)
r = alerce.send_query("", format="json")
expected_result = '[{"mjd":1,"oid":5,"oid_1":5},{"mjd":2,"oid":6,"oid_1":6}]'
assert r == expected_result
Expand Down

0 comments on commit 53d8bea

Please sign in to comment.