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

Structure_Engine: Transform methods added for structural elements #2361

Merged
merged 9 commits into from
Mar 5, 2021

Conversation

pawelbaran
Copy link
Member

Issues addressed by this PR

Contributes to resolving #2322

Test files

On SharePoint. I have disabled the test of FEMeshes because for some weird reason they slow GH down badly even if a completely unrelated part of the script gets modified - I could not come up with an explanation for that, maybe the reviewer will have an idea 😃 However, this is outside of the scope of this PR, because the above issue does not affect the correctness of the results, so please do not be afraid of enabling the disabled part.

Changelog

  • Transform methods added for Node, Bar, RigidLink, Edge, Opening, Panel and FEMesh

Additional comments

I believe this is the most problematic/sensitive of all transform-related PRs so far, so probably worth @IsakNaslundBh's time for a proper review. I hope the provided test files will make the process a bit less painful.

@pawelbaran pawelbaran added the type:feature New capability or enhancement label Feb 26, 2021
@pawelbaran pawelbaran requested a review from rwemay as a code owner February 26, 2021 16:46
@pawelbaran pawelbaran self-assigned this Feb 26, 2021
@pawelbaran
Copy link
Member Author

Tolerance and UT added @LMarkowski @IsakNaslundBh, the PR is ready to review

Copy link
Contributor

@IsakNaslundBh IsakNaslundBh left a comment

Choose a reason for hiding this comment

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

Generally working great!

Just a comment on passing on the tolerances

Structure_Engine/Modify/Transform.cs Outdated Show resolved Hide resolved
Structure_Engine/Modify/Transform.cs Outdated Show resolved Hide resolved
Structure_Engine/Modify/Transform.cs Outdated Show resolved Hide resolved
Structure_Engine/Modify/Transform.cs Outdated Show resolved Hide resolved
Structure_Engine/Modify/Transform.cs Outdated Show resolved Hide resolved
Structure_Engine/Modify/Transform.cs Outdated Show resolved Hide resolved
@pawelbaran
Copy link
Member Author

I have committed suggestions made by @IsakNaslundBh plus updated the GH script as well as the UTs including the extra test content provided by @IsakNaslundBh too. Should be ready for re-review now 👍

@pawelbaran pawelbaran requested a review from IsakNaslundBh March 3, 2021 11:09
Copy link
Contributor

@IsakNaslundBh IsakNaslundBh left a comment

Choose a reason for hiding this comment

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

Another quick one, see below

Structure_Engine/Modify/Transform.cs Outdated Show resolved Hide resolved
@pawelbaran pawelbaran requested a review from IsakNaslundBh March 3, 2021 15:01
LMarkowski
LMarkowski previously approved these changes Mar 4, 2021
Copy link
Contributor

@LMarkowski LMarkowski left a comment

Choose a reason for hiding this comment

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

Works and looks good to me! As in the physical added the erroneous cases to the UT.

@LMarkowski
Copy link
Contributor

@BHoMBot check unit tests when you'll be upside up again.

@LMarkowski
Copy link
Contributor

@BHoMBot check unit

@bhombot-ci
Copy link

bhombot-ci bot commented Mar 5, 2021

@LMarkowski to confirm, check-unit-tests task is now queued.

@LMarkowski
Copy link
Contributor

LMarkowski commented Mar 5, 2021

One more thought that I forgot to include in the review. The test only includes a validation for Panels and is missing Edges and Openings. Do the two latter methods occur outside the first one? If not, why keep them public? And if they are, is test for only Panel enough for us? For me - it is. But in the future I can imagine those two being 1 missing percent while doing analytics for unit test coverage across the engine.
@rolyhudson @al-fisher what are your thoughts on that foundational-side?

(Edit: Same situation with CeilingTile in #2352)

@pawelbaran
Copy link
Member Author

@LMarkowski the methods for Edge and Opening are public to reflect the general philosophy of the BHoM (if something does not strongly need to be private, keep it public). I have not added type-specific tests for them (same as for CeilingTile) because they are being tested in the Panel transforms (and Ceiling, respectively).

Not sure if adding those tests as separate entities would bring any value - but can do, if you like, this should not be much of an effort.

@LMarkowski
Copy link
Contributor

@pawelbaran as said I think test for panels is enough for me as well validation-wise. My only concern are missing UTs. They could be done even by transforming exploded panels. The question is if it's worth it.

@FraserGreenroyd
Copy link
Contributor

@pawelbaran as said I think test for panels is enough for me as well validation-wise. My only concern are missing UTs. They could be done even by transforming exploded panels. The question is if it's worth it.

It's always worth it, but it might not be valid to bring it in in this PR. The question is more accurately as whether it's worth it for this PR, not worth it overall.

@pawelbaran
Copy link
Member Author

If it is worth it overall, I will add the UT's in right now - exploding the panels and kicking them in will take a minute, literally.

@LMarkowski
Copy link
Contributor

The question is more accurately as whether it's worth it for this PR, not worth it overall.

@FraserGreenroyd Well, having some time put in adding missing tests I'd say we should enforce adding the UT every time we add a new public method. Reduce backlog.

(What about private ones though 🤔)

@FraserGreenroyd
Copy link
Contributor

@FraserGreenroyd Well, having some time put in adding missing tests I'd say we should enforce adding the UT every time we add a new public method. Reduce backlog.

Yup, agreed. That's why Environments/MEP are enforcing new Unit Tests on PRs (@pawelbaran found that when I requested changes on his MEP version of this PR solely for a missing unit test!). I believe structures are doing the same but @IsakNaslundBh can confirm that. I definitely recommend it though!

(What about private ones though 🤔)

Private methods don't get exposed but are used by public methods to aid calculations, so the unit tests of public methods will be good enough (for now, we might change that later mind).

@pawelbaran
Copy link
Member Author

Oke, I have added the missing UTs and updated the GH script.

@pawelbaran
Copy link
Member Author

@BHoMBot check all

@bhombot-ci
Copy link

bhombot-ci bot commented Mar 5, 2021

@pawelbaran to confirm, check-code-compliance, check-documentation-compliance, check-project-compliance, check-branch-compliance, check-dataset-compliance, if applicable check-copyright-compliance, check-serialisation, check-versioning, check-unit-tests, check-core, check-installer, and check-ready-to-merge tasks are now queued.

@pawelbaran
Copy link
Member Author

/azp run BHoM_Engine.CheckInstaller

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@LMarkowski LMarkowski left a comment

Choose a reason for hiding this comment

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

Now it's perfect! Thank you.
RTM as soon as we have an approval from @BHoMBot

@pawelbaran
Copy link
Member Author

pawelbaran commented Mar 5, 2021

RTM as soon as we have an approval from @BHoMBot

You mean never?

image

@bhombot-ci
Copy link

bhombot-ci bot commented Mar 5, 2021

Please be advised that the check with reference 2039032949 has more than 50 annotations of notes. API limitations restrict annotations to 50. You may need to rerun this check to obtain the next set when you make changes. At the time of reporting this check, there are 290 additional annotations waiting, made up of 290 errors and 0 warnings.

@pawelbaran
Copy link
Member Author

@BHoMBot you fool

@bhombot-ci
Copy link

bhombot-ci bot commented Mar 5, 2021

@pawelbaran sorry, I didn't understand.
Was that comment an instruction for me? If so, could you state again what check you would like me to do?
For example, if you would like me to fix the CSProject file(s) comment:

"@BHoMBot fix project file"

@pawelbaran
Copy link
Member Author

@BHoMBot check installer

@bhombot-ci
Copy link

bhombot-ci bot commented Mar 5, 2021

@pawelbaran to confirm, check-installer task is now queued.

@FraserGreenroyd
Copy link
Contributor

@FraserGreenroyd
Copy link
Contributor

Ok, bot issues aside, this is now ready for @IsakNaslundBh to give a decision from his changes requested and go for merge at that point 😄

Copy link
Contributor

@IsakNaslundBh IsakNaslundBh left a comment

Choose a reason for hiding this comment

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

Have not tested after the changes, but trust @LMarkowski s test!

Issues I have raised have been resolved!

@FraserGreenroyd
Copy link
Contributor

@BHoMBot check ready-to-merge

@bhombot-ci
Copy link

bhombot-ci bot commented Mar 5, 2021

@FraserGreenroyd to confirm, the task for checking if this Pull Request is ready to merge is now queued.

@IsakNaslundBh IsakNaslundBh merged commit c4ef330 into master Mar 5, 2021
@IsakNaslundBh IsakNaslundBh deleted the Structure_Engine-#2322-RigidBodyTransforms branch March 5, 2021 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New capability or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants