-
Notifications
You must be signed in to change notification settings - Fork 5
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
Adapter_Engine: Avoid signature duplication for AdapterId() methods #287
Conversation
I will not approve not to give a false impression that this PR has been tested extensively, but can confirm that Revit_Toolkit works perfectly fine on this branch. |
See my reply there. |
@BHoMBot check versioning |
@IsakNaslundBh to confirm, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for not reviewing... Been swamped!
Code changes generally look fine to me just looking here at github, but have not tested it yet.
Would assume this would require versioning, some PreviousVersion attributes to both of the updated methods!
/azp run BHoM_Adapter.CheckInstaller |
Azure Pipelines successfully started running 1 pipeline(s). |
Thanks, actually only one method has been modified (AdapterId), the other (AdapterIds) is new. Will add versioning for it. |
Co-authored-by: Isak Näslund <isak.naslund@burohappold.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works for Lusas, both Push/Pull for various objects.
I am running in to an issue when pushing to MidasCivil though on this line:
BHoM_Adapter/BHoM_Adapter/CRUD/IRead.cs
Line 100 in e80ed0b
IEnumerable<IBHoMObject> objects = IRead(type, null as List<object>, actionConfig); |
System.MissingMethodException: 'Method not found: '!!0 BH.Engine.Adapter.Query.AdapterId(BH.oM.Base.IBHoMObject, System.Type)'.'
Basically it's the first read before it pushes (so should just be empty).
System.MissingMethodException
HResult=0x80131513
Message=Method not found: '!!0 BH.Engine.Adapter.Query.AdapterId(BH.oM.Base.IBHoMObject, System.Type)'.
Source=MidasCivil_Adapter
StackTrace:
at BH.Adapter.MidasCivil.MidasCivilAdapter.ReadBars(List`1 ids)
at BH.Adapter.MidasCivil.MidasCivilAdapter.IRead(Type type, IList ids, ActionConfig actionConfig)
at BH.Adapter.BHoMAdapter.Read(Type type, String tag, ActionConfig actionConfig) in C:\Users\pnugent\Documents\GitHub\BHoM_Adapter\BHoM_Adapter\CRUD\IRead.cs:line 100
Script is here if you want to give it a try and debug:
https://burohappold.sharepoint.com/:f:/r/sites/BHoM/02_Current/12_Scripts/01_Issue/Archive/MidasCivil_Toolkit/MidasCivil_Toolkit-%23263/Elements?csf=1&web=1&e=erZTfB
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested for both Lusas and Midas, able to Push/Pull a number of different objects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works fine now!
Need to get BHoM/SAP2000_Toolkit#209 merged first, then this should be good to go!
/azp run BHoM_Adapter.CheckInstaller |
Azure Pipelines successfully started running 1 pipeline(s). |
This reverts commit 255eacf.
This reverts commit 23f7baf.
Co-authored-by: Isak Näslund <isak.naslund@burohappold.com>
…HoM/BHoM_Adapter into BHoM_Adapter-#284-twoIdMethods
d412f39
/azp run BHoM_Adapter.CheckInstaller |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-approving
Due to merge conflicts. See version history on that PR. #287
Replaced with #290 due to: |
Due to merge conflicts. See version history on that PR. #287
Dependant PRs
Issues addressed by this PR
Closes #284
Closes #288
This PR revises the two methods that get the
AdapterId
of a specific fragment Type out of a given BHoMObject.Both methods are useful and need to be maintained, but due to the conflict explained in #284 they had to be renamed/revised.
We have:
AdapterId(this BHoMObject, ...)
that returnsobject
. This gathers all IDs that implement a certain fragment type. If multiple IDs are found, a List is returned. If one Id is found, only that is returned.This method was renamed to
AdapterIds<T>(this BHoMObject, ...)
(note the s).<T>
. This method will return an error if multiple IDs are found. This method was slightly modified to expose more useful errors/warnings and better distinguish its function from the other one. The method was not renamed.There are only 2 Toolkits that requires alignment (SAP2000/ETABS) because they have a reference to the renamed method (1).
All other Adapter Toolkits needs to be tested to make sure that the functionality is still working as expected.
Test files
Needs testing of existing functionality on all Adapters.
Changelog
Additional comments