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

MMODA interface (currently INTEGRAL and POLAR analysis API), initial prototype #2004

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
35 changes: 35 additions & 0 deletions astroquery/oda/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Astro ODA
-------

TODO

https://www.astro.unige.ch/cdci/astrooda_/
https://github.com/oda-hub/oda_api
https://marketplace.eosc-portal.eu/services/astronomical-online-data-analysis-astrooda
"""
from astropy import config as _config


class Conf(_config.ConfigNamespace):
"""
Configuration parameters for `astroquery.oda`.
"""

server = _config.ConfigItem(
['https://www.astro.unige.ch/cdci/astrooda_'],
'frontend base URL')

timeout = _config.ConfigItem(
30,
'Time limit')


conf = Conf()

from .core import ODA, ODAClass

__all__ = ['ODA', 'ODAClass',
'Conf', 'conf',
]
32 changes: 32 additions & 0 deletions astroquery/oda/core.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst

import warnings
from six import BytesIO
from astropy.table import Table
from astropy.io import fits
from astropy import coordinates
from astropy import units as u
from ..query import BaseQuery
from ..utils import commons
from ..utils import async_to_sync
from ..exceptions import InvalidQueryError, NoResultsWarning
from . import conf

__all__ = ['ODA', 'ODAClass']


@async_to_sync
class ODAClass(BaseQuery):

"""
...
"""

URL = conf.server
TIMEOUT = conf.timeout

def query(self):
raise NotImplementedError


ODA = ODAClass()
Empty file.
11 changes: 11 additions & 0 deletions astroquery/oda/tests/setup_package.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst


import os


def get_package_data():
paths = [os.path.join('data', '*.dat'),
os.path.join('data', '*.xml'),
]
return {'astroquery.oda.tests': paths}
15 changes: 15 additions & 0 deletions astroquery/oda/tests/test_oda.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst


import pytest
import requests

from ...oda import ODA
from ...utils import commons


@pytest.mark.remote_data
class TestODA:

def test_basic_example(self):
pass