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

feat(objects): cnx 849 finalized DataObjects #185

Merged
merged 6 commits into from
Dec 4, 2024
Merged

Conversation

clairekuang
Copy link
Member

@clairekuang clairekuang commented Dec 3, 2024

Finalizes interfaces for IDataObject:

  • adds properties dictionary
  • adds additional navisworks, gis, and csi interfaces and corresponding classes
  • removes all builtelements (no longer used)

note: the IDataObject interface does not implement IDisplayValue due to nullability atm. should be evaluated.

Copy link

linear bot commented Dec 3, 2024

Copy link

codecov bot commented Dec 3, 2024

Codecov Report

Attention: Patch coverage is 25.00000% with 9 lines in your changes missing coverage. Please review.

Project coverage is 66.24%. Comparing base (d904c68) to head (81007e0).
Report is 7 commits behind head on dev.

Files with missing lines Patch % Lines
src/Speckle.Objects/Data/Civil3dObject.cs 0.00% 2 Missing ⚠️
src/Speckle.Objects/Data/EtabsObject.cs 0.00% 2 Missing ⚠️
src/Speckle.Objects/Data/ArcgisObject.cs 0.00% 1 Missing ⚠️
src/Speckle.Objects/Data/DataObject.cs 0.00% 1 Missing ⚠️
src/Speckle.Objects/Data/NavisworksObject.cs 0.00% 1 Missing ⚠️
src/Speckle.Objects/Data/RevitObject.cs 0.00% 1 Missing ⚠️
src/Speckle.Objects/Data/TeklaObject.cs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##              dev     #185       +/-   ##
===========================================
+ Coverage   53.68%   66.24%   +12.55%     
===========================================
  Files         233      251       +18     
  Lines        9367    10016      +649     
  Branches     1065     1065               
===========================================
+ Hits         5029     6635     +1606     
+ Misses       4084     3035     -1049     
- Partials      254      346       +92     

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

Dictionary<string, object?> properties { get; }
}

public interface IDataObject : ISpeckleObject, IProperties
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we want IDataObject : IDisplayValue?

Is there any value still in IDisplayValue? or shall we kill it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see your comment (tho you could have made it implement IDisplayValue<IReadOnlyList<Base>?>)

But I'd like to discuss both the nullability, and existence of IDisplayValue

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed with Claire IDataObject : IDisplayValue with the intention of maybe cleaning up and removing this interface in future

/// Should be simple geometry types: Point, Line, Polyline, and Mesh.
/// Null indicates a non-displayable data object.
/// </remarks>
IReadOnlyList<Base>? displayValue { get; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

having this nullable...
is there a semantic difference between null and an empty list?

Thinking where we might be sending empty lists

  • Navisworks groups, Blender empties, Empty Sketchup components/groups?

If not, then I'd suggest we stick with empty lists.

Otherwise all consumers will have to check for null or empty, and presumably handle them both exactly the same way...

Opens opportunity for us to mix and match, and risk having some consumers forget about one of the cases

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed with Claire we should remove the ? from the displayValue

{
public required string name { get; set; }

public required List<Base> displayValue { get; set; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[DetachedProperty] should be on all displayValue properties (also missing from several other classes)

public required string units { get; set; }

IReadOnlyList<ICivilObject> ICivilObject.elements => elements;
IReadOnlyList<Base> ICivilObject.elements => elements;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should double check that the serializer doesn't accidently try and grab this property @adamhathcock

We can set these as [JsonIgnore], but I'd like to understand if there's something else that's nicely guaranteeing that the "hidden" elements prop (explicit interface implementation) is not ever prefered over the "real" .elements property.

@clairekuang clairekuang merged commit 650fad3 into dev Dec 4, 2024
4 checks passed
@clairekuang clairekuang deleted the claire/cnx-849 branch December 4, 2024 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants