-
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #88 from pyvirtobs/vosi-rework
Rework VOSI parsing using astropy xml handling
- Loading branch information
Showing
24 changed files
with
3,416 additions
and
381 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
.. py:module:: pyvo.io | ||
========================= | ||
The pyvo.io Package | ||
========================= | ||
|
||
This package contains io functionallity for pyvo | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
vosi | ||
|
||
.. automodapi:: pyvo.io.vosi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,4 @@ Virtual Observatory (VO) using Python. | |
mod | ||
dal | ||
registry | ||
|
||
io |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
.. py:module:: pyvo.io.vosi | ||
========================= | ||
The pyvo.io.vosi Package | ||
========================= | ||
|
||
This package contains io functionallity for pyvo | ||
|
||
.. automodapi:: pyvo.io.vosi.endpoint | ||
.. automodapi:: pyvo.io.vosi.vodataservice | ||
.. automodapi:: pyvo.io.vosi.voresource | ||
.. automodapi:: pyvo.io.vosi.tapregext | ||
.. automodapi:: pyvo.io.vosi.exceptions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
# Licensed under a 3-clause BSD style license - see LICENSE.rst | ||
from . import uws, vosi |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Licensed under a 3-clause BSD style license - see LICENSE.rst | ||
from .endpoint import parse_tables, parse_capabilities, parse_availability |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# Licensed under a 3-clause BSD style license - see LICENSE.rst | ||
from __future__ import (absolute_import, division, print_function, | ||
unicode_literals) | ||
|
||
from astropy.extern import six | ||
|
||
from astropy.utils.collections import HomogeneousList | ||
from astropy.utils.xml import check as xml_check | ||
from astropy.io.votable.exceptions import vo_raise, vo_warn, warn_or_raise | ||
|
||
from .util import ( | ||
make_add_simplecontent, make_add_complexcontent, Element, ValueMixin) | ||
from . import voresource as vr | ||
from .exceptions import W32, W33, W34, W35 | ||
|
||
__all__ = ["Availability"] | ||
|
||
###################################################################### | ||
# FACTORY FUNCTIONS | ||
def _convert_boolean(value, default=None): | ||
return { | ||
'false': False, | ||
'0': False, | ||
'true': True, | ||
'1': True | ||
}.get(value, default) | ||
|
||
###################################################################### | ||
# ELEMENT CLASSES | ||
class Availability(Element): | ||
def __init__(self, config=None, pos=None, **kwargs): | ||
super(Availability, self).__init__(config=config, pos=pos, **kwargs) | ||
|
||
self._tag_mapping.update({ | ||
"available": make_add_simplecontent( | ||
self, "available", "available", W32), | ||
"upSince": make_add_simplecontent(self, "upSince", "upsince", W33), | ||
"downAt": make_add_simplecontent(self, "downAt", "downat", W34), | ||
"backAt": make_add_simplecontent(self, "backAt", "backat", W35), | ||
"note": make_add_simplecontent(self, "note", "notes") | ||
}) | ||
|
||
self._available = None | ||
self._upsince = None | ||
self._downat = None | ||
self._backat = None | ||
self._notes = HomogeneousList(six.text_type) | ||
|
||
@property | ||
def available(self): | ||
return self._available | ||
|
||
@available.setter | ||
def available(self, available): | ||
self._available = _convert_boolean(available) | ||
|
||
@property | ||
def upsince(self): | ||
return self._upsince | ||
|
||
@upsince.setter | ||
def upsince(self, upsince): | ||
self._upsince = upsince | ||
|
||
@property | ||
def downat(self): | ||
return self._downat | ||
|
||
@downat.setter | ||
def downat(self, downat): | ||
self._downat = downat | ||
|
||
@property | ||
def backat(self): | ||
return self._backat | ||
|
||
@backat.setter | ||
def backat(self, backat): | ||
self._backat = backat | ||
|
||
@property | ||
def notes(self): | ||
return self._notes |
Oops, something went wrong.