From 29c48fb1cbf8d4cb6f5e84464a72b13c816e0bbe Mon Sep 17 00:00:00 2001 From: Ignacio Reyes Date: Fri, 28 Jun 2024 14:45:28 -0400 Subject: [PATCH 1/3] black --- alerce/direct.py | 1 - alerce/utils.py | 1 - docs/source/conf.py | 10 +++++----- setup.py | 26 +++++++++++++------------- tests/test_direct.py | 4 +++- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/alerce/direct.py b/alerce/direct.py index 440a6d8..8d3db8a 100644 --- a/alerce/direct.py +++ b/alerce/direct.py @@ -2,7 +2,6 @@ class AlerceDirect(Client): - """Handles direct request to the database using the available http API""" def __init__(self, **kwargs): diff --git a/alerce/utils.py b/alerce/utils.py index ca0899a..e89ae53 100644 --- a/alerce/utils.py +++ b/alerce/utils.py @@ -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): diff --git a/docs/source/conf.py b/docs/source/conf.py index 7b166c1..01fa608 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -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" diff --git a/setup.py b/setup.py index f95f9d0..4f88391 100644 --- a/setup.py +++ b/setup.py @@ -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" setup( - name='alerce', - version=__version__, - description='ALeRCE Client', - long_description_content_type="text/markdown", - long_description=long_description, - author='ALeRCE Team', - author_email='contact@alerce.online', - 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="contact@alerce.online", + packages=find_packages(), + install_requires=required_packages, ) - diff --git a/tests/test_direct.py b/tests/test_direct.py index d310871..73e6687 100644 --- a/tests/test_direct.py +++ b/tests/test_direct.py @@ -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 From 332eff9656fc97b45274265b4121b4e412feaca5 Mon Sep 17 00:00:00 2001 From: Ignacio Reyes Date: Fri, 28 Jun 2024 15:02:30 -0400 Subject: [PATCH 2/3] minor broken things --- README.md | 2 +- alerce/crossmatch.py | 10 ++++++---- alerce/utils.py | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index f0b62a4..a7f21fb 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/alerce/crossmatch.py b/alerce/crossmatch.py index c6f4e22..53d9b73 100644 --- a/alerce/crossmatch.py +++ b/alerce/crossmatch.py @@ -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 `_. @@ -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 `_. @@ -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` diff --git a/alerce/utils.py b/alerce/utils.py index e89ae53..5982964 100644 --- a/alerce/utils.py +++ b/alerce/utils.py @@ -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): @@ -142,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 ) From 4ed1f5ce3c6d3cfba12534a03a691c938c59e7e6 Mon Sep 17 00:00:00 2001 From: Ignacio Reyes Date: Fri, 28 Jun 2024 15:04:47 -0400 Subject: [PATCH 3/3] version update --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 4f88391..b8529c4 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ 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",