Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

Add missing properties to packets #147

Merged
merged 2 commits into from
Jul 2, 2024
Merged

Add missing properties to packets #147

merged 2 commits into from
Jul 2, 2024

Conversation

Stoops-ML
Copy link
Collaborator

  • Adds epoch to PositionList
  • Adds outlineColor and outline to Polygon

@Stoops-ML Stoops-ML enabled auto-merge July 2, 2024 06:29
Copy link

codecov bot commented Jul 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.25%. Comparing base (21653db) to head (f80d168).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #147   +/-   ##
=======================================
  Coverage   99.25%   99.25%           
=======================================
  Files          12       12           
  Lines         805      808    +3     
=======================================
+ Hits          799      802    +3     
  Misses          6        6           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Stoops-ML
Copy link
Collaborator Author

I didn't add a test for these new properties, yet the Codecov report is says that the added lines are being hit.

It's because all classes initialise all properties (usually to None). For example, from test_polygon_with_hole() the created polygon is:

p = Polygon(
    positions=PositionList(cartographicDegrees=[30.0, 40.0, 1.0]),
    holes=PositionListOfLists(
        cartographicDegrees=[[20.0, 20.0, 0.0], [10.0, 10.0, 0.0]]
    ),
)

Which creates an object with the following properties:

p = Polygon(
    positions=PositionList(
        interpolationAlgorithm=None,
        interpolationDegree=None,
        delete=None,
        referenceFrame=None,
        cartesian=None,
        cartographicRadians=None,
        cartographicDegrees=[30.0, 40.0, 1.0],
        references=None,
        interval=None,
        epoch=None,
    ),
    show=None,
    arcType=None,
    granularity=None,
    material=None,
    shadows=None,
    distanceDisplayCondition=None,
    classificationType=None,
    zIndex=None,
    holes=PositionListOfLists(
        delete=None,
        referenceFrame=None,
        cartesian=None,
        cartographicRadians=None,
        cartographicDegrees=[[20.0, 20.0, 0.0], [10.0, 10.0, 0.0]],
        references=None,
    ),
    outlineColor=None,
    outline=None,
)

All the properties with None values are removed when calling __str__.

It's somewhat deceiving to say that these lines are actually covered despite having no actual checks for them.

@astrojuanlu
Copy link
Member

Makes sense, thanks for the investigation!

@Stoops-ML Stoops-ML merged commit 7249c24 into main Jul 2, 2024
9 checks passed
@Stoops-ML Stoops-ML deleted the missProps branch July 2, 2024 06:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants