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

Chore(revit): Refactor material cache to ToHost ToSpeckle singletons #262

Merged

Conversation

oguzhankoral
Copy link
Member

@oguzhankoral oguzhankoral commented Sep 19, 2024

We have now 2 singleton classes ^_____^
I couldn't go further to simplify it more, obviously Revit is different. Materials need to go back and forth between connector and converter.

PS: Refactored (splitted) MaterialConversionToSpeckle class into 2. Because it used in 2 different places and one of the return value was always useless, there was unnecessary conversion always.

@adamhathcock not sure is there a way to register an instance in RevitHostObjectBuilder that will be used only in that function (also in converter) then it will disposed instead using singleton and clearing the dictionary. Let me know if you have elegant way.

Copy link

linear bot commented Sep 19, 2024

Copy link

codecov bot commented Sep 19, 2024

Codecov Report

Attention: Patch coverage is 0% with 64 lines in your changes missing coverage. Please review.

Project coverage is 8.46%. Comparing base (d8f3fa7) to head (6ab98c5).
Report is 1 commits behind head on dev.

Files with missing lines Patch % Lines
.../Raw/MaterialAsRevitMaterialConversionToSpeckle.cs 0.00% 23 Missing ⚠️
...aw/MaterialAsSpeckleMaterialConversionToSpeckle.cs 0.00% 22 Missing ⚠️
.../Raw/Geometry/MeshByMaterialDictionaryToSpeckle.cs 0.00% 6 Missing ⚠️
...hared/ToSpeckle/Raw/MaterialQuantitiesToSpeckle.cs 0.00% 4 Missing ⚠️
...evitShared/Helpers/RevitToSpeckleCacheSingleton.cs 0.00% 3 Missing ⚠️
...tShared/ToHost/Raw/Geometry/MeshConverterToHost.cs 0.00% 3 Missing ⚠️
...ckle.Converters.RevitShared/ServiceRegistration.cs 0.00% 2 Missing ⚠️
...s.RevitShared/Helpers/RevitToHostCacheSingleton.cs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             dev    #262      +/-   ##
========================================
- Coverage   8.46%   8.46%   -0.01%     
========================================
  Files        229     231       +2     
  Lines       4546    4548       +2     
  Branches     553     550       -3     
========================================
  Hits         385     385              
- Misses      4144    4146       +2     
  Partials      17      17              

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

…or-the-mega-singleton-in-revit

# Conflicts:
#	Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Receive/RevitHostObjectBuilder.cs
#	Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Send/RevitRootObjectBuilder.cs
#	Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/MaterialConversionToSpeckle.cs
@oguzhankoral oguzhankoral merged commit fa31283 into dev Sep 25, 2024
5 checks passed
@oguzhankoral oguzhankoral deleted the oguzhan/cnx-511-refactor-the-mega-singleton-in-revit branch September 25, 2024 14:27
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.

3 participants