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

Fix distinct causes assigned properties to be lost #355

Conversation

IsakNaslundBh
Copy link
Contributor

Issues addressed by this PR

Closes #126

Finally fixing this old issue of better handling merging of properties on "same" object being pushed in, most common case being highlighted in the issue (Node with and without constraints).

Done by instead of call to Distinct, a call to GroupBy is made, after CopyBHoMProperties and any CopyPropertiesModules is called, making sure all relevant properties are merged over.

Also, update to how the ID assignment from any duplicate objects is made, as simply can rely on the group, rather then trying to re-fetch from the list based on another call with the comparer. This should be a bit more efficient than previous implementation.

Test files

Have added new PushTest doing exactly what is highlighted in the issue. Was failing before, but working after changes.

Also, added a new test to check that all pushed objects have ids assigned. Was working before as well, but wanted to add this additional case as I made some changes to how it was handled.

Changelog

Additional comments

@IsakNaslundBh IsakNaslundBh added the type:bug Error or unexpected behaviour label Mar 6, 2023
@IsakNaslundBh IsakNaslundBh self-assigned this Mar 6, 2023
@IsakNaslundBh
Copy link
Contributor Author

@BHoMBot check compliance

@bhombot-ci
Copy link

bhombot-ci bot commented Mar 6, 2023

@IsakNaslundBh to confirm, the following actions are now queued:

  • check code-compliance
  • check documentation-compliance
  • check project-compliance
  • check branch-compliance
  • check dataset-compliance
  • check copyright-compliance

@IsakNaslundBh
Copy link
Contributor Author

@BHoMBot check compliance

@bhombot-ci
Copy link

bhombot-ci bot commented Mar 6, 2023

@IsakNaslundBh to confirm, the following actions are now queued:

  • check code-compliance
  • check documentation-compliance
  • check project-compliance
  • check branch-compliance
  • check dataset-compliance
  • check copyright-compliance

@IsakNaslundBh
Copy link
Contributor Author

@BHoMBot check unit-tests

@bhombot-ci
Copy link

bhombot-ci bot commented Mar 6, 2023

@IsakNaslundBh to confirm, the following actions are now queued:

  • check unit-tests

@IsakNaslundBh
Copy link
Contributor Author

@BHoMBot check unit-tests

@bhombot-ci
Copy link

bhombot-ci bot commented Mar 6, 2023

@IsakNaslundBh to confirm, the following actions are now queued:

  • check unit-tests

@IsakNaslundBh
Copy link
Contributor Author

@BHoMBot check unit-tests

@bhombot-ci
Copy link

bhombot-ci bot commented Mar 6, 2023

@IsakNaslundBh to confirm, the following actions are now queued:

  • check unit-tests

@IsakNaslundBh
Copy link
Contributor Author

@BHoMBot check unit-tests

@bhombot-ci
Copy link

bhombot-ci bot commented Mar 6, 2023

@IsakNaslundBh to confirm, the following actions are now queued:

  • check unit-tests

Also adding the steel materials to the input objects for obejcts to be pushed in the DuplicateObjects_EnsureAllOutputHaveIds test. They should have been there in the first palce, but got missed when writing the test.
Copy link
Member

@alelom alelom left a comment

Choose a reason for hiding this comment

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

Approving based on review of code changes and unit-tests. The code changes make sense and effectively fix a problem introduced by the "push at the same time" feature. Unit tests cover this fix well.

@IsakNaslundBh
Copy link
Contributor Author

@BHoMBot check compliance
@BHoMBot check required

@bhombot-ci
Copy link

bhombot-ci bot commented Mar 7, 2023

@IsakNaslundBh to confirm, the following actions are now queued:

  • check code-compliance
  • check documentation-compliance
  • check project-compliance
  • check branch-compliance
  • check dataset-compliance
  • check copyright-compliance
  • check code-compliance
  • check documentation-compliance
  • check project-compliance
  • check core
  • check null-handling
  • check serialisation
  • check versioning
  • check installer

There are 34 requests in the queue ahead of you.

@bhombot-ci
Copy link

bhombot-ci bot commented Mar 7, 2023

The check code-compliance has already been run previously and recorded as a successful check. This check has not been run again at this time.

@bhombot-ci
Copy link

bhombot-ci bot commented Mar 7, 2023

The check documentation-compliance has already been run previously and recorded as a successful check. This check has not been run again at this time.

@bhombot-ci
Copy link

bhombot-ci bot commented Mar 7, 2023

The check project-compliance has already been run previously and recorded as a successful check. This check has not been run again at this time.

@FraserGreenroyd
Copy link
Contributor

@BHoMBot check core
@BHoMBot check versioning

@bhombot-ci
Copy link

bhombot-ci bot commented Mar 8, 2023

@FraserGreenroyd to confirm, the following actions are now queued:

  • check core
  • check versioning

@FraserGreenroyd
Copy link
Contributor

@BHoMBot check versioning

@bhombot-ci
Copy link

bhombot-ci bot commented Mar 8, 2023

@FraserGreenroyd to confirm, the following actions are now queued:

  • check versioning

@FraserGreenroyd
Copy link
Contributor

@BHoMBot check serialisation
@BHoMBot check null-handling

2 similar comments
@IsakNaslundBh
Copy link
Contributor Author

@BHoMBot check serialisation
@BHoMBot check null-handling

@FraserGreenroyd
Copy link
Contributor

@BHoMBot check serialisation
@BHoMBot check null-handling

@bhombot-ci
Copy link

bhombot-ci bot commented Mar 8, 2023

@FraserGreenroyd to confirm, the following actions are now queued:

  • check serialisation
  • check null-handling

@IsakNaslundBh
Copy link
Contributor Author

@BHoMBot check ready-to-merge

1 similar comment
@FraserGreenroyd
Copy link
Contributor

@BHoMBot check ready-to-merge

@bhombot-ci
Copy link

bhombot-ci bot commented Mar 8, 2023

@FraserGreenroyd to confirm, the following actions are now queued:

  • check ready-to-merge

@IsakNaslundBh IsakNaslundBh merged commit 7124839 into develop Mar 8, 2023
@IsakNaslundBh IsakNaslundBh deleted the BHoM_Adapter-#126-FixDistinctCausesAssignedProeprtiesToBeLost branch March 8, 2023 14:16
@bhombot-ci bhombot-ci bot mentioned this pull request Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Error or unexpected behaviour
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BHoM_Adapter: Distinct method in Replace causes assigned properties of coincident objects to be lost
3 participants