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

Mivot writer #627

Open
wants to merge 43 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
89d8dae
add a clean ns option for the pretty printing
lmichel Nov 24, 2024
5fddfcd
layout changed after a read/write cycle
lmichel Nov 24, 2024
89c6fe3
local copy of the MIVOT XML schema
lmichel Nov 24, 2024
cf7fc92
annotation builder: new class
lmichel Nov 24, 2024
db49366
instance builder: new class
lmichel Nov 24, 2024
4803139
test suite for the annotations builders
lmichel Nov 24, 2024
34aacff
API for writing MIVOT annotations
lmichel Nov 27, 2024
1b6197b
test suite for the MIVOT writer
lmichel Nov 27, 2024
f367116
Doc updated with the split into 2 documents, one for the reader and one
lmichel Nov 28, 2024
7a9cff4
Changelog updated
lmichel Nov 28, 2024
c8b8549
code style
lmichel Nov 28, 2024
3ad6f43
style corrections
lmichel Nov 30, 2024
79c01b8
add PR number in change log
lmichel Nov 30, 2024
9e20fd3
removed
lmichel Nov 30, 2024
55cc826
add PR number
lmichel Nov 30, 2024
a622b32
resolve conflicts
lmichel Nov 30, 2024
be59549
add writer to api index
lmichel Nov 30, 2024
c68dfaa
Merge branch 'main' into mivot-writer
lmichel Nov 30, 2024
f9917ed
fix CI
lmichel Dec 1, 2024
c7cfe7b
Merge branch 'mivot-writer' of github.com:lmichel/pyvo into mivot-writer
lmichel Dec 1, 2024
7e0c918
fix use of mapping exception
lmichel Dec 1, 2024
4b40de5
add package init
lmichel Dec 1, 2024
c0068aa
fix call to MivotInstance dict
lmichel Dec 1, 2024
e9e273e
typo
lmichel Dec 2, 2024
28ee3ed
test MivotViewer.to_dict() output
lmichel Dec 2, 2024
a86c8f2
Fix CI errors
lmichel Dec 1, 2024
d74d094
add missing doctring for clean_ns parameter of pretty_string()
lmichel Dec 2, 2024
150acba
merge after rebase
lmichel Dec 2, 2024
9462516
fix test output in rest file
lmichel Dec 2, 2024
9277c03
flake8
lmichel Dec 2, 2024
b2efc78
Fix CI errors
lmichel Dec 1, 2024
2dee869
Merge branch 'mivot-writer' of github.com:lmichel/pyvo into mivot-writer
lmichel Dec 3, 2024
d36398b
restructuring documentation : toc updated, exposed API
lmichel Dec 13, 2024
1b5f460
Fix code blocks in docstring that were tagged as sphinx reference (one
lmichel Dec 13, 2024
514b48b
remove narrative doc from source files
lmichel Dec 14, 2024
b79706c
replace abbreviation with explicit name (clean_ns)
lmichel Dec 14, 2024
4932477
add explicit definition of the exposed namespaces (__all__)
lmichel Dec 14, 2024
b8021e9
add license
lmichel Dec 14, 2024
0303a85
Make optional parameters mandatory keywords.
lmichel Dec 14, 2024
3d9dec5
import viewer explicitely because pyvo.mivot.viewer is no longer the
lmichel Dec 15, 2024
bff20a5
XML typography more homogeneous, parameter model_url of add_model made
lmichel Dec 15, 2024
bab58f2
fix CI errors
lmichel Dec 15, 2024
d470071
DOC: fix headings
bsipocz Dec 16, 2024
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
Prev Previous commit
Next Next commit
Fix code blocks in docstring that were tagged as sphinx reference (one
back quote)
  • Loading branch information
lmichel committed Dec 13, 2024
commit 1b5f460135130cde7e58369e6845542638180d04
12 changes: 6 additions & 6 deletions pyvo/mivot/writer/annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ def add_templates(self, templates_instance):

Raises
------
MappingError
If `templates_instance` is neither a string nor an instance of `MivotInstance`.
Mappingrror
If ``templates_instance`` is neither a string nor an instance of `MivotInstance`.
"""
if isinstance(templates_instance, MivotInstance):
self._templates.append(templates_instance.xml_string())
Expand All @@ -275,7 +275,7 @@ def add_globals(self, globals_instance):
Raises
------
MappingError
If `globals_instance` is neither a string nor an instance of `MivotInstance`.
If ``globals_instance`` is neither a string nor an instance of `MivotInstance`.
"""
if isinstance(globals_instance, MivotInstance):
self._globals.append(globals_instance.xml_string())
Expand Down Expand Up @@ -312,7 +312,7 @@ def set_report(self, status, message):

Notes
-----
If `status` is False, all components of the MIVOT block except MODEL and REPORT
If ``status`` is False, all components of the MIVOT block except MODEL and REPORT
are cleared.
"""
self._report_status = status
Expand Down Expand Up @@ -358,7 +358,7 @@ def insert_into_votable(self, votable_file, template_id=None, override=False):
Parameters
----------
votable_file : str or VOTableFile
The VOTable to be annotated, either as a file path or a `VOTableFile` instance.
The VOTable to be annotated, either as a file path or a ``VOTableFile`` instance.
template_id : str, optional
The ID of the TABLE to be mapped. Defaults to None.
override : bool
Expand All @@ -367,7 +367,7 @@ def insert_into_votable(self, votable_file, template_id=None, override=False):
Raises
------
MappingError
If a mapping block already exists and `override` is False.
If a mapping block already exists and ``override`` is False.
"""
if not check_astropy_version():
raise AstropyVersionException(f"Astropy version {version.version} "
Expand Down
8 changes: 4 additions & 4 deletions pyvo/mivot/writer/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def __init__(self, dmtype=None, dmrole=None, dmid=None):
Raises
------
MappingError
If `dmtype` is not provided.
If ``dmtype`` is not provided.
"""
if not dmtype:
raise MappingError("Cannot build an instance without dmtype")
Expand Down Expand Up @@ -95,7 +95,7 @@ def add_attribute(self, dmtype=None, dmrole=None, ref=None, value=None, unit=Non
Raises
------
MappingError
If `dmtype` or `dmrole` is not provided, or if both `ref` and `value` are not defined.
If ``dmtype`` or ``dmrole`` is not provided, or if both ``ref`` and ``value`` are not defined.
"""
if not dmtype:
raise MappingError("Cannot add an attribute without dmtype")
Expand Down Expand Up @@ -128,7 +128,7 @@ def add_reference(self, dmrole=None, dmref=None):
Raises
------
MappingError
If `dmrole` or `dmref` is not provided.
If ``dmrole`` or ``dmref`` is not provided.
"""
if not dmref:
raise MappingError("Cannot add a reference without dmref")
Expand All @@ -150,7 +150,7 @@ def add_instance(self, mivot_instance):
Raises
------
MappingError
If `mivot_instance` is not of type `MivotInstance`.
If ``mivot_instance`` is not of type ``MivotInstance``.
"""
if not isinstance(mivot_instance, MivotInstance):
raise MappingError("Instance added must be of type MivotInstance")
Expand Down