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

BHoM_Engine: add Query.Hash() extension method #2090

Merged
merged 10 commits into from
Oct 24, 2020

Conversation

alelom
Copy link
Member

@alelom alelom commented Oct 20, 2020

Issues addressed by this PR

Closes #2060

Test files

@alelom alelom self-assigned this Oct 20, 2020
@alelom alelom added type:compliance Non-conforming to code guidelines type:feature New capability or enhancement labels Oct 20, 2020
Copy link
Member

@adecler adecler left a comment

Choose a reason for hiding this comment

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

A few minor things but otherwise looks good.

I wonder if it wouldn't make more sense to have the Hash method that takes all the arguments to be in Query though. It kind of feels weird that one is in Query and one is in Compute since the only difference is their number of arguments.

BHoM_Engine/Query/Hash.cs Outdated Show resolved Hide resolved
BHoM_Engine/Compute/Hash.cs Outdated Show resolved Hide resolved
@alelom alelom requested a review from adecler October 21, 2020 08:39
@al-fisher
Copy link
Member

Looks good @alelom - added a small suggested change to one of the descriptions to distinguish

Copy link
Member

@al-fisher al-fisher left a comment

Choose a reason for hiding this comment

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

As discussed @alelom - unexpected behaviour between the two hash methods returning different results for same input
image

@alelom alelom requested a review from al-fisher October 22, 2020 13:24
@alelom
Copy link
Member Author

alelom commented Oct 22, 2020

@al-fisher thanks - fixed in 6ba0075

image

@al-fisher
Copy link
Member

Perfect - this is working as expected now! Thanks

@alelom alelom requested a review from al-fisher October 22, 2020 14:13
@adecler
Copy link
Member

adecler commented Oct 23, 2020

Isn't it a bit problematic that a call to Query.Hash(item) is actually undetermined between the two methods ?

@alelom
Copy link
Member Author

alelom commented Oct 23, 2020

Isn't it a bit problematic that a call to Query.Hash(item) is actually undetermined between the two methods ?

Sorry, I can't see where the problem is – the overload with the closest number of argument is always called by C#, so it's not undetermined?

Am I missing something?
image

@alelom alelom requested a review from al-fisher October 23, 2020 10:31
@al-fisher
Copy link
Member

Thanks for mopping up those descriptions @alelom 😄

@adecler
Copy link
Member

adecler commented Oct 24, 2020

/azp run BHoM_Engine.CheckCore

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@adecler
Copy link
Member

adecler commented Oct 24, 2020

/azp run BHoM_Engine.CheckInstaller

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@adecler
Copy link
Member

adecler commented Oct 24, 2020

@alelom , sorry I was just bothered by this: return Hash(iObj, null, null, null, null, 100);
The fact that you have to provide the default arguments to the method for it to be differentiated from Hash(iObj) is not ideal (for example, what if you change the default value of those arguments later ?).

But that's not a big deal at all so that's fine.

@adecler adecler merged commit 4d73f40 into master Oct 24, 2020
@adecler adecler deleted the BHoM_Engine-2060-addQueryHash branch October 24, 2020 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:compliance Non-conforming to code guidelines type:feature New capability or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BHoM_Engine: add Query.Hash() method
3 participants