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

Migrate to lutaml-model from shale #7

Merged
merged 7 commits into from
Aug 30, 2024
Merged

Conversation

ronaldtse
Copy link
Contributor

Fixes #6.

We still have the following failures inherited from #1 .

Failures:

  1) Ogc::Gml::Curve round-trips Curve-ArcByCenterPoint.xml
     Failure/Error:
       output = Ogc::Gml::Curve.from_xml(input).to_xml(
         pretty: true,
         declaration: true,
         encoding: "utf-8"
       )
     
     NoMethodError:
       undefined method `item_order' for an instance of String
     # ./spec/ogc/gml/curve_spec.rb:23:in `block (3 levels) in <top (required)>'

  2) Ogc::Gml::Curve round-trips Curve-ID_250.xml
     Failure/Error:
       output = Ogc::Gml::Curve.from_xml(input).to_xml(
         pretty: true,
         declaration: true,
         encoding: "utf-8"
       )
     
     NoMethodError:
       undefined method `item_order' for an instance of String
     # ./spec/ogc/gml/curve_spec.rb:23:in `block (3 levels) in <top (required)>'

  3) Ogc::Gml::Curve round-trips Curve-tripartite.xml
     Failure/Error:
       output = Ogc::Gml::Curve.from_xml(input).to_xml(
         pretty: true,
         declaration: true,
         encoding: "utf-8"
       )
     
     NoMethodError:
       undefined method `item_order' for an instance of String
     # ./spec/ogc/gml/curve_spec.rb:23:in `block (3 levels) in <top (required)>'

  4) Ogc::Gml::Polygon round-trips gmlring2.xml
     Failure/Error: expect(output).to be_equivalent_to(input)
     
       expected:
       <gml:Polygon xmlns:gml="http://www.opengis.net/gml/3.2"
                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                    xsi:schemaLocation="http://www.opengis.net/gml/3.2
                                         http://schemas.opengis.net/gml/3.2.1/gml.xsd"
                    gml:id="ID1">
           <gml:exterior>
               <gml:Ring>
                   <gml:curveMember>
                       <gml:LineString srsName="http://www.opengis.net/gml/srs/epsg.xml#4326" srsDimension="2" gml:id="ID2">
                           <gml:posList>0 0 0 1 1 1 1 0 0 0</gml:posList>
                       </gml:LineString>
                   </gml:curveMember>
               </gml:Ring>
           </gml:exterior>
       </gml:Polygon>
       got:
       <?xml version="1.0" encoding="utf-8"?>
       <gml:Polygon xmlns:gml="http://www.opengis.net/gml/3.2" gml:id="ID1">
         <gml:exterior>
           <gml:Ring>
             <gml:curveMember>
               <gml:LineString gml:id="ID2" srsName="http://www.opengis.net/gml/srs/epsg.xml#4326" srsDimension="2">
                 <gml:posList>0 0 0 1 1 1 1 0 0 0</gml:posList>
               </gml:LineString>
             </gml:curveMember>
           </gml:Ring>
         </gml:exterior>
       </gml:Polygon>
       Diff:
       @@ -1,16 +1,13 @@
       -<gml:Polygon xmlns:gml="http://www.opengis.net/gml/3.2"
       -             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       -             xsi:schemaLocation="http://www.opengis.net/gml/3.2
       -                                  http://schemas.opengis.net/gml/3.2.1/gml.xsd"
       -             gml:id="ID1">
       -    <gml:exterior>
       -        <gml:Ring>
       -            <gml:curveMember>
       -                <gml:LineString srsName="http://www.opengis.net/gml/srs/epsg.xml#4326" srsDimension="2" gml:id="ID2">
       -                    <gml:posList>0 0 0 1 1 1 1 0 0 0</gml:posList>
       -                </gml:LineString>
       -            </gml:curveMember>
       -        </gml:Ring>
       -    </gml:exterior>
       +<?xml version="1.0" encoding="utf-8"?>
       +<gml:Polygon xmlns:gml="http://www.opengis.net/gml/3.2" gml:id="ID1">
       +  <gml:exterior>
       +    <gml:Ring>
       +      <gml:curveMember>
       +        <gml:LineString gml:id="ID2" srsName="http://www.opengis.net/gml/srs/epsg.xml#4326" srsDimension="2">
       +          <gml:posList>0 0 0 1 1 1 1 0 0 0</gml:posList>
       +        </gml:LineString>
       +      </gml:curveMember>
       +    </gml:Ring>
       +  </gml:exterior>
        </gml:Polygon>
       
     # ./spec/ogc/gml/polygon_spec.rb:28:in `block (3 levels) in <top (required)>'

  5) Ogc::Gml::Surface round-trips Surface-Curve-ID_250.xml
     Failure/Error:
       output = Ogc::Gml::Surface.from_xml(input).to_xml(
         pretty: true,
         declaration: true,
         encoding: "utf-8"
       )
     
     NoMethodError:
       undefined method `item_order' for an instance of String
     # ./spec/ogc/gml/surface_spec.rb:27:in `block (3 levels) in <top (required)>'

  6) Ogc::Gml::Surface round-trips Surface-PolygonPatch-ExteriorCurve.xml
     Failure/Error:
       output = Ogc::Gml::Surface.from_xml(input).to_xml(
         pretty: true,
         declaration: true,
         encoding: "utf-8"
       )
     
     NoMethodError:
       undefined method `item_order' for an instance of String
     # ./spec/ogc/gml/surface_spec.rb:27:in `block (3 levels) in <top (required)>'

  7) Ogc::Gml::Surface round-trips Surface-PolygonPatch-ExteriorCurveCW.xml
     Failure/Error:
       output = Ogc::Gml::Surface.from_xml(input).to_xml(
         pretty: true,
         declaration: true,
         encoding: "utf-8"
       )
     
     NoMethodError:
       undefined method `item_order' for an instance of String
     # ./spec/ogc/gml/surface_spec.rb:27:in `block (3 levels) in <top (required)>'

Finished in 53.25 seconds (files took 0.15704 seconds to load)
313 examples, 7 failures

Failed examples:

rspec ./spec/ogc/gml/curve_spec.rb[1:1] # Ogc::Gml::Curve round-trips Curve-ArcByCenterPoint.xml
rspec ./spec/ogc/gml/curve_spec.rb[1:3] # Ogc::Gml::Curve round-trips Curve-ID_250.xml
rspec ./spec/ogc/gml/curve_spec.rb[1:8] # Ogc::Gml::Curve round-trips Curve-tripartite.xml
rspec ./spec/ogc/gml/polygon_spec.rb[1:7] # Ogc::Gml::Polygon round-trips gmlring2.xml
rspec ./spec/ogc/gml/surface_spec.rb[1:1] # Ogc::Gml::Surface round-trips Surface-Curve-ID_250.xml
rspec ./spec/ogc/gml/surface_spec.rb[1:10] # Ogc::Gml::Surface round-trips Surface-PolygonPatch-ExteriorCurve.xml
rspec ./spec/ogc/gml/surface_spec.rb[1:11] # Ogc::Gml::Surface round-trips Surface-PolygonPatch-ExteriorCurveCW.xml

Interestingly, when using lutaml-model, these two specs were automatically fixed:

rspec ./spec/ogc/gml/multi_curve_spec.rb[1:1] # Ogc::Gml::MultiCurve round-trips MultiCurve-1.xml
rspec ./spec/ogc/gml/multi_curve_spec.rb[1:2] # Ogc::Gml::MultiCurve round-trips MultiCurve-2.xml

@ronaldtse
Copy link
Contributor Author

Some of these spec failures are due to a bug in Lutaml::Model regarding item_order that exist in other migrations from Shale:

However, this current gem does not utilize any custom methods. So this has to be a real bug.

@HassanAkbar
Copy link
Member

@ronaldtse After merging PR lutaml/lutaml-model#62 for lutaml-model, there is no more crashing related to item_order. The tests that are failing were also failing on the main branch.

9 Failures on main branch

rspec './spec/ogc/gml/curve_spec.rb[1:1]' # Ogc::Gml::Curve round-trips Curve-ArcByCenterPoint.xml
rspec './spec/ogc/gml/curve_spec.rb[1:3]' # Ogc::Gml::Curve round-trips Curve-ID_250.xml
rspec './spec/ogc/gml/curve_spec.rb[1:8]' # Ogc::Gml::Curve round-trips Curve-tripartite.xml
rspec './spec/ogc/gml/multi_curve_spec.rb[1:1]' # Ogc::Gml::MultiCurve round-trips MultiCurve-1.xml
rspec './spec/ogc/gml/multi_curve_spec.rb[1:2]' # Ogc::Gml::MultiCurve round-trips MultiCurve-2.xml
rspec './spec/ogc/gml/polygon_spec.rb[1:7]' # Ogc::Gml::Polygon round-trips gmlring2.xml
rspec './spec/ogc/gml/surface_spec.rb[1:1]' # Ogc::Gml::Surface round-trips Surface-Curve-ID_250.xml
rspec './spec/ogc/gml/surface_spec.rb[1:10]' # Ogc::Gml::Surface round-trips Surface-PolygonPatch-ExteriorCurve.xml
rspec './spec/ogc/gml/surface_spec.rb[1:11]' # Ogc::Gml::Surface round-trips Surface-PolygonPatch-ExteriorCurveCW.xml

and 7 Failures on current branch

rspec './spec/ogc/gml/curve_spec.rb[1:1]' # Ogc::Gml::Curve round-trips Curve-ArcByCenterPoint.xml
rspec './spec/ogc/gml/curve_spec.rb[1:3]' # Ogc::Gml::Curve round-trips Curve-ID_250.xml
rspec './spec/ogc/gml/curve_spec.rb[1:8]' # Ogc::Gml::Curve round-trips Curve-tripartite.xml
rspec './spec/ogc/gml/polygon_spec.rb[1:7]' # Ogc::Gml::Polygon round-trips gmlring2.xml
rspec './spec/ogc/gml/surface_spec.rb[1:1]' # Ogc::Gml::Surface round-trips Surface-Curve-ID_250.xml
rspec './spec/ogc/gml/surface_spec.rb[1:10]' # Ogc::Gml::Surface round-trips Surface-PolygonPatch-ExteriorCurve.xml
rspec './spec/ogc/gml/surface_spec.rb[1:11]' # Ogc::Gml::Surface round-trips Surface-PolygonPatch-ExteriorCurveCW.xml

@ronaldtse
Copy link
Contributor Author

Only one failure left!!

  1) Ogc::Gml::Polygon round-trips gmlring2.xml
     Failure/Error: expect(output).to be_equivalent_to(input)
     
       expected:
       <gml:Polygon xmlns:gml="http://www.opengis.net/gml/3.2"
                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                    xsi:schemaLocation="http://www.opengis.net/gml/3.2
                                         http://schemas.opengis.net/gml/3.2.1/gml.xsd"
                    gml:id="ID1">
           <gml:exterior>
               <gml:Ring>
                   <gml:curveMember>
                       <gml:LineString srsName="http://www.opengis.net/gml/srs/epsg.xml#4326" srsDimension="2" gml:id="ID2">
                           <gml:posList>0 0 0 1 1 1 1 0 0 0</gml:posList>
                       </gml:LineString>
                   </gml:curveMember>
               </gml:Ring>
           </gml:exterior>
       </gml:Polygon>
       got:
       <?xml version="1.0" encoding="utf-8"?>
       <gml:Polygon xmlns:gml="http://www.opengis.net/gml/3.2" gml:id="ID1">
         <gml:exterior>
           <gml:Ring>
             <gml:curveMember>
               <gml:LineString gml:id="ID2" srsName="http://www.opengis.net/gml/srs/epsg.xml#4326" srsDimension="2">
                 <gml:posList>0 0 0 1 1 1 1 0 0 0</gml:posList>
               </gml:LineString>
             </gml:curveMember>
           </gml:Ring>
         </gml:exterior>
       </gml:Polygon>
       Diff:
       @@ -1,16 +1,13 @@
       -<gml:Polygon xmlns:gml="http://www.opengis.net/gml/3.2"
       -             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       -             xsi:schemaLocation="http://www.opengis.net/gml/3.2
       -                                  http://schemas.opengis.net/gml/3.2.1/gml.xsd"
       -             gml:id="ID1">
       -    <gml:exterior>
       -        <gml:Ring>
       -            <gml:curveMember>
       -                <gml:LineString srsName="http://www.opengis.net/gml/srs/epsg.xml#4326" srsDimension="2" gml:id="ID2">
       -                    <gml:posList>0 0 0 1 1 1 1 0 0 0</gml:posList>
       -                </gml:LineString>
       -            </gml:curveMember>
       -        </gml:Ring>
       -    </gml:exterior>
       +<?xml version="1.0" encoding="utf-8"?>
       +<gml:Polygon xmlns:gml="http://www.opengis.net/gml/3.2" gml:id="ID1">
       +  <gml:exterior>
       +    <gml:Ring>
       +      <gml:curveMember>
       +        <gml:LineString gml:id="ID2" srsName="http://www.opengis.net/gml/srs/epsg.xml#4326" srsDimension="2">
       +          <gml:posList>0 0 0 1 1 1 1 0 0 0</gml:posList>
       +        </gml:LineString>
       +      </gml:curveMember>
       +    </gml:Ring>
       +  </gml:exterior>
        </gml:Polygon>
       
     # ./spec/ogc/gml/polygon_spec.rb:28:in `block (3 levels) in <top (required)>'

Finished in 49.38 seconds (files took 0.13208 seconds to load)
313 examples, 1 failure

@ronaldtse
Copy link
Contributor Author

The only remaining diff is:

       -             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       -             xsi:schemaLocation="http://www.opengis.net/gml/3.2
       -                                  http://schemas.opengis.net/gml/3.2.1/gml.xsd"

@ronaldtse ronaldtse merged commit 286c9bc into main Aug 30, 2024
2 of 15 checks passed
@ronaldtse ronaldtse deleted the rt-migrate-to-lutaml-model branch August 30, 2024 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate to lutaml-model from Shale
2 participants