Skip to content
Merged
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
0.4:

- snippet generation: Change XML comments coming abstract instances
- Add change log file
5 changes: 0 additions & 5 deletions mivot_validator/instance_checking/instance_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,6 @@ def _check_membership(actual_instance, enclosing_vodml_instance):
):
print(f"-> found that {actual_type} inherits from {vodml_type}")
return
print(InstanceChecker.inheritence_tree)
print(vodml_type)
print(actual_type)
print(vodml_type in InstanceChecker.inheritence_tree)
print(actual_type in InstanceChecker.inheritence_tree[vodml_type])
raise CheckFailedException(
f"Object type {enclosing_vodml_instance.getroot().get('dmtype')} "
f"has no component with dmrole={actual_role} and dmtype={actual_type} "
Expand Down
2 changes: 1 addition & 1 deletion mivot_validator/instance_checking/snippet_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ def get_concrete_type_by_ref(self, abstract_vodmlid, role, aggregate, extend):
return
else:
self.write_out(
f"<!-- Put here a concrete INSTANCE of {abstract_vodmlid} or left blank -->"
f"<!-- Replace by an INSTANCE of a derived classes of {abstract_vodmlid} if applicable. -->"
)
self.write_out(
f"<INSTANCE dmrole='{role}' dmtype='{self.model_name}:{abstract_vodmlid}'/>"
Expand Down
2 changes: 1 addition & 1 deletion mivot_validator/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.2"
__version__ = "0.4"
2 changes: 1 addition & 1 deletion tests/data/gaia_epoch_propagation_flat_full.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<COOSYS ID="J2000" system="eq_FK5" equinox="J2000" />

<RESOURCE type="meta">
<VODML xmlns:dm-mapping="http://www.ivoa.net/xml/mivot">
<VODML xmlns="http://www.ivoa.net/xml/mivot">
<REPORT status="OK">hand-made mapping</REPORT>
<MODEL name="ivoa" url="https://www.ivoa.net/xml/VODML/IVOA-v1.vo-dml.xml" />
<MODEL name="coords" url="https://www.ivoa.net/xml/STC/20200908/Coords-v1.0.vo-dml.xml" />
Expand Down
7 changes: 7 additions & 0 deletions tests/data/meas.Position.test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
<ATTRIBUTE dmrole="meas:Measure.ucd" dmtype="ivoa:string" ref="@@@@@" value=""/>
<INSTANCE dmrole="meas:Measure.error" dmtype="meas:Error">
<!-- The Error class uses the Uncertainty types to describe measurement errors from various sources." -->
<!-- Replace by an INSTANCE of a derived classes of Uncertainty if applicable. -->
<INSTANCE dmrole="meas:Error.statError" dmtype="meas:Symmetrical">
<!-- Symmetrical uncertainty, constant in all dimensions and directions from the associated Coordinate. ie: PlusMinus in 1D, circular in 2D, spherical in 3D." -->
<ATTRIBUTE dmrole="meas:Symmetrical.radius" dmtype="ivoa:RealQuantity" unit="" ref="@@@@@" value=""/>
</INSTANCE>
<!-- Replace by an INSTANCE of a derived classes of Uncertainty if applicable. -->
<INSTANCE dmrole="meas:Error.sysError" dmtype="meas:Asymmetrical2D">
<!-- 2D Uncertainty with different extent in the positive and negative axis directions from the associated Coordinate. i.e.: an offset rectangle." -->
<COLLECTION dmrole="meas:Asymmetrical2D.plus">
Expand All @@ -29,10 +31,12 @@
<INSTANCE dmrole="coords:PhysicalCoordSys.frame" dmtype="coords:SpaceFrame">
<!-- A SpaceFrame is specified by its reference frame (orientation), and a reference position (origin). Currently only standard reference frames are allowed. An equinox MUST be provided for pre-ICRS reference frames. A planetary ephemeris MAY be provided if relevant. If needed, but not provided, it is assumed to be "DE405".
" -->
<!-- Replace by an INSTANCE of a derived classes of RefLocation if applicable. -->
<INSTANCE dmrole="coords:CustomRefLocation.position" dmtype="coords:CustomRefLocation">
<!-- A custom reference location in phase space (position and velocity). Position and velocity are given as coordinates with an associated SpaceFrame. An epoch MAY be provided to further refine the location." -->
<!-- We define epoch as a primitive data type with the expected form "<type><year>" where type = "J" or "B" for Julian or Besselian respectively, and year is expressed as a decimal year. e.g.: "B1950", "J2000.0" -->
<ATTRIBUTE dmrole="coords:CustomRefLocation.epoch" dmtype="coords:Epoch" ref="@@@@@" value=""/>
<!-- Replace by an INSTANCE of a derived classes of Point if applicable. -->
<INSTANCE dmrole="coords:CustomRefLocation.velocity" dmtype="coords:LonLatPoint">
<!-- A spatial coordinate in a Spherical coordinate space defining a Celestial position in Latitude and Longitude. Any associated CoordSpace MUST conform to this description. If no CoordSpace is provided, a Standard Spherical CoordSpace is assumed. Values for unused/undefined dimensions need not be provided.
" -->
Expand All @@ -43,6 +47,7 @@
<INSTANCE dmrole="coords:PhysicalCoordSys.frame" dmtype="coords:SpaceFrame">
<!-- A SpaceFrame is specified by its reference frame (orientation), and a reference position (origin). Currently only standard reference frames are allowed. An equinox MUST be provided for pre-ICRS reference frames. A planetary ephemeris MAY be provided if relevant. If needed, but not provided, it is assumed to be "DE405".
" -->
<!-- Replace by an INSTANCE of a derived classes of RefLocation if applicable. -->
<INSTANCE dmrole="coords:SpaceFrame.refPosition" dmtype="coords:StdRefLocation">
<!-- An absolute a-priori known location in phase space (position and velocity). Values are selected from the StdRefPosition vocabulary. Considering that the GEOCENTER is really the only place for which we know the absolute location at all times, all other locations require the specification of a planetary ephemeris. LSR[KD] are reserved for spectral and reshift frames. TOPOCENTER (location of the observer) is special in that it assumes that the observing location is available through other means (e.g. a geographic location or an orbit ephemeris). RELOCATABLE is available for simulations. UNKNOWN should only be used if absolutely necessary." -->
<ATTRIBUTE dmrole="coords:StdRefLocation.position" dmtype="ivoa:string" ref="@@@@@" value=""/>
Expand All @@ -57,6 +62,7 @@
<ATTRIBUTE dmrole="coords:LonLatPoint.lat" dmtype="ivoa:Quantity" unit="" ref="@@@@@" value=""/>
<ATTRIBUTE dmrole="coords:LonLatPoint.dist" dmtype="ivoa:Quantity" unit="" ref="@@@@@" value=""/>
</INSTANCE>
<!-- Replace by an INSTANCE of a derived classes of Point if applicable. -->
<INSTANCE dmrole="" dmtype="coords:LonLatPoint">
<!-- A spatial coordinate in a Spherical coordinate space defining a Celestial position in Latitude and Longitude. Any associated CoordSpace MUST conform to this description. If no CoordSpace is provided, a Standard Spherical CoordSpace is assumed. Values for unused/undefined dimensions need not be provided.
" -->
Expand All @@ -67,6 +73,7 @@
<INSTANCE dmrole="coords:PhysicalCoordSys.frame" dmtype="coords:SpaceFrame">
<!-- A SpaceFrame is specified by its reference frame (orientation), and a reference position (origin). Currently only standard reference frames are allowed. An equinox MUST be provided for pre-ICRS reference frames. A planetary ephemeris MAY be provided if relevant. If needed, but not provided, it is assumed to be "DE405".
" -->
<!-- Replace by an INSTANCE of a derived classes of RefLocation if applicable. -->
<INSTANCE dmrole="coords:SpaceFrame.refPosition" dmtype="coords:StdRefLocation">
<!-- An absolute a-priori known location in phase space (position and velocity). Values are selected from the StdRefPosition vocabulary. Considering that the GEOCENTER is really the only place for which we know the absolute location at all times, all other locations require the specification of a planetary ephemeris. LSR[KD] are reserved for spectral and reshift frames. TOPOCENTER (location of the observer) is special in that it assumes that the observing location is available through other means (e.g. a geographic location or an orbit ephemeris). RELOCATABLE is available for simulations. UNKNOWN should only be used if absolutely necessary." -->
<ATTRIBUTE dmrole="coords:StdRefLocation.position" dmtype="ivoa:string" ref="@@@@@" value=""/>
Expand Down
Loading