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 for #203, errors in simplify full #206

Merged
merged 5 commits into from
Jun 4, 2024
Merged

Conversation

KBGrammer
Copy link
Contributor

Description

Two calls in core.py to get_box and build_c_table_from_solids are missing a required "options" parameter. This has been added as "self.options".

The function point_inside in boolean_solids.py has a variable named "cut_box". This is the same name as a function in boolean_solids.py, cut_box(). The variable has the underscore removed in this function.

Fixes issue

Fixes #203

Checklist

  • I'm making a PR from a feature branch on my fork into GEOUNED-org/GEOUNED/dev branch
  • I have followed PEP8 style guide for Python or run a formatter such as black or ruff format on my code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

Copy link
Member

Choose a reason for hiding this comment

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

To be consistent, let the name of the variable in lines 442 and 481 be cut_box and rename the function in lines 463, 475 and 518 to divide_box

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair enough.

I've made this change. I also noticed that the same issue with a variable sharing the function name cut_box appears in GEOReverse as well, so I've made the same changes there.

@@ -439,7 +439,7 @@ def point_inside(solid):
return point

cut_line = 32
cut_box = 2
cutbox = 2
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
cutbox = 2
cut_box = 2

src/geouned/GEOUNED/core.py Outdated Show resolved Hide resolved
Box = UF.get_box(c)
CT = build_c_table_from_solids(Box, (c.Surfaces, Surfs), option="full")
Box = UF.get_box(c,self.options)
CT = build_c_table_from_solids(Box, (c.Surfaces, Surfs), option="full",options=self.options)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
CT = build_c_table_from_solids(Box, (c.Surfaces, Surfs), option="full",options=self.options)
CT = build_c_table_from_solids(Box, (c.Surfaces, Surfs),options=self.options)

here I would prefer to pass only the self.options class as argument.

Also to avoid mistake the option attribute name of the self.options class should be changed from option to simplification_mode

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unless I'm missing something, it doesn't look like just self.options will work. I believe simplify is contained in self.settings.simplify.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, you are right. The quick review made me make a mistake.

Copy link
Member

@psauvan psauvan left a comment

Choose a reason for hiding this comment

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

see inline comments

@KBGrammer KBGrammer requested a review from psauvan June 3, 2024 15:28
@KBGrammer
Copy link
Contributor Author

I believe I've made the requested changes. I also found a few other instances of the cut_box variable/function name bug in GEOReverse. Those have been updated.

Add missing space to call to UF.get_box()
@KBGrammer
Copy link
Contributor Author

My apologies, there was a missing space in the call to UF.get_box, so it failed the formatting check. Everything else had passed. This has been remedied now.

@KBGrammer KBGrammer requested a review from psauvan June 4, 2024 18:34
@psauvan psauvan merged commit 599fe67 into GEOUNED-org:dev Jun 4, 2024
9 checks passed
psauvan pushed a commit that referenced this pull request Jun 7, 2024
* Patch for #203

* Responding to comments on #206

* Update core.py

Add missing space to call to UF.get_box()

* Replace all get_box calls to have options.enlargeBox, change get_box to refer only to enlargeBox instead of options.enlargeBox

---------

Co-authored-by: AlvaroCubi <55387701+AlvaroCubi@users.noreply.github.com>
Co-authored-by: Grammer, Kyle <grammerkb@ornl.gov>
psauvan pushed a commit that referenced this pull request Jun 17, 2024
* Patch for #203

* Responding to comments on #206

* Update core.py

Add missing space to call to UF.get_box()

---------

Co-authored-by: AlvaroCubi <55387701+AlvaroCubi@users.noreply.github.com>
Co-authored-by: Grammer, Kyle <grammerkb@ornl.gov>
psauvan pushed a commit that referenced this pull request Jun 17, 2024
* Patch for #203

* Responding to comments on #206

* Update core.py

Add missing space to call to UF.get_box()

* Replace all get_box calls to have options.enlargeBox, change get_box to refer only to enlargeBox instead of options.enlargeBox

---------

Co-authored-by: AlvaroCubi <55387701+AlvaroCubi@users.noreply.github.com>
Co-authored-by: Grammer, Kyle <grammerkb@ornl.gov>
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.

4 participants