Skip to content

Commit

Permalink
import viewer explicitely because pyvo.mivot.viewer is no longer the
Browse files Browse the repository at this point in the history
default pyvo.mivot content

code stye

add license
  • Loading branch information
lmichel committed Dec 15, 2024
1 parent 0303a85 commit 3d9dec5
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 15 deletions.
2 changes: 1 addition & 1 deletion pyvo/mivot/tests/test_annotation_seeker.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from pyvo.mivot.seekers.annotation_seeker import AnnotationSeeker
from pyvo.mivot.utils.dict_utils import DictUtils
from pyvo.mivot.version_checker import check_astropy_version
from pyvo.mivot import MivotViewer
from pyvo.mivot.viewer import MivotViewer
from . import XMLOutputChecker


Expand Down
2 changes: 1 addition & 1 deletion pyvo/mivot/tests/test_mivot_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from pyvo.mivot.version_checker import check_astropy_version
from pyvo.mivot.viewer.mivot_instance import MivotInstance
from pyvo.mivot.utils.mivot_utils import MivotUtils
from pyvo.mivot import MivotViewer
from pyvo.mivot.viewer import MivotViewer

fake_hk_dict = {
"dmtype": "EpochPosition",
Expand Down
2 changes: 1 addition & 1 deletion pyvo/mivot/tests/test_mivot_instance_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import pytest
from urllib.request import urlretrieve
from pyvo.mivot.version_checker import check_astropy_version
from pyvo.mivot import MivotViewer
from pyvo.mivot.viewer import MivotViewer
from pyvo.mivot.utils.mivot_utils import MivotUtils


Expand Down
2 changes: 1 addition & 1 deletion pyvo/mivot/tests/test_mivot_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from pyvo.mivot.utils.dict_utils import DictUtils
from pyvo.mivot.utils.exceptions import MappingError
from pyvo.mivot.version_checker import check_astropy_version
from pyvo.mivot import MivotViewer
from pyvo.mivot.viewer import MivotViewer
from astropy import version as astropy_version


Expand Down
2 changes: 1 addition & 1 deletion pyvo/mivot/tests/test_static_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from pyvo.mivot.seekers.annotation_seeker import AnnotationSeeker
from pyvo.mivot.features.static_reference_resolver import StaticReferenceResolver
from pyvo.mivot.version_checker import check_astropy_version
from pyvo.mivot import MivotViewer
from pyvo.mivot.viewer import MivotViewer
from . import XMLOutputChecker


Expand Down
2 changes: 1 addition & 1 deletion pyvo/mivot/tests/test_user_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from astropy.coordinates import SkyCoord
from pyvo.dal.scs import SCSService
from pyvo.mivot.version_checker import check_astropy_version
from pyvo.mivot import MivotViewer
from pyvo.mivot.viewer import MivotViewer
from astropy.io.votable import parse
from pyvo.mivot.utils.dict_utils import DictUtils

Expand Down
2 changes: 1 addition & 1 deletion pyvo/mivot/tests/test_vizier_cs.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import pytest
from urllib.request import urlretrieve
from pyvo.mivot.version_checker import check_astropy_version
from pyvo.mivot import MivotViewer
from pyvo.mivot.viewer import MivotViewer
from pyvo.mivot.utils.exceptions import MivotError


Expand Down
2 changes: 1 addition & 1 deletion pyvo/mivot/tests/test_xml_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from xml.etree.ElementTree import Element as element
from astropy.utils.data import get_pkg_data_filename
from pyvo.mivot.version_checker import check_astropy_version
from pyvo.mivot import MivotViewer
from pyvo.mivot.viewer import MivotViewer
from pyvo.mivot.utils.exceptions import MivotError


Expand Down
1 change: 1 addition & 0 deletions pyvo/mivot/viewer/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from .mivot_instance import MivotInstance
from .mivot_viewer import MivotViewer
9 changes: 5 additions & 4 deletions pyvo/mivot/writer/annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,17 @@

__all__ = ["MivotAnnotations"]


@prototype_feature("MIVOT")
class MivotAnnotations:
"""
This module provides a class to construct, validate, and insert MIVOT
blocks into VOTable files.
blocks into VOTable files.
The MIVOT block, represented as an XML structure, is used for
data model annotations in the IVOA ecosystem.
The main features are:
- Construct the MIVOT block step-by-step with various components.
- Validate the MIVOT block against the MIVOT XML schema (if ``xmlschema`` is installed).
- Embed the MIVOT block into an existing VOTable file.
Expand Down Expand Up @@ -281,7 +282,7 @@ def check_xml(self):
"""
# put here just to improve the test coverage
root = etree.fromstring(self._mivot_block)
mivot_block = XmlUtils.pretty_string(root, clean_ns=False)
mivot_block = XmlUtils.pretty_string(root, clean_namespace=False)
if not xmlschema:
logging.error(
"XML validation skipped: no XML schema found. "
Expand Down
7 changes: 4 additions & 3 deletions pyvo/mivot/writer/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

__all__ = ["MivotInstance"]


@prototype_feature("MIVOT")
class MivotInstance:
"""
Expand All @@ -16,19 +17,19 @@ class MivotInstance:
This class provides methods for incremental construction of a MIVOT instance.
It builds <INSTANCE> elements that can contain <ATTRIBUTE>, <INSTANCE>, and <REFERENCE>.
Support for <COLLECTION> elements is not yet implemented.
The main features are:
- Model-agnostic: The implementation is independent of any specific data model.
- Syntax validation: Ensures basic MIVOT syntax rules are followed.
- Context-agnostic: Ignores context-dependent syntax rules.
attributes
----------
_dmtype : string
Instance type (class VO-DML ID)
_dmrole : string
Role played by the instance in the context where it is used
Role played by the instance in the context where it is used
(given by the VO-DML serialization of the model)
_dmid : string
Free identifier of the instance
Expand Down

0 comments on commit 3d9dec5

Please sign in to comment.