Skip to content

Conversation

@rsm-gh
Copy link
Contributor

@rsm-gh rsm-gh commented Jul 18, 2024

TopTools_ListIteratorOfListOfShape must be replaced by TopTools_ListOfListOfShape

Summary by Sourcery

This pull request fixes the import issue in TopologyUtils.py by replacing TopTools_ListIteratorOfListOfShape with the correct TopTools_ListOfListOfShape.

  • Bug Fixes:
    • Replaced incorrect usage of TopTools_ListIteratorOfListOfShape with TopTools_ListOfListOfShape in TopologyUtils.py.

TopTools_ListIteratorOfListOfShape must be replaced by TopTools_ListOfListOfShape
@sourcery-ai
Copy link

sourcery-ai bot commented Jul 18, 2024

Reviewer's Guide by Sourcery

This pull request corrects the import of TopTools_ListIteratorOfListOfShape by replacing it with TopTools_ListOfListOfShape in the src/Extend/TopologyUtils.py file. The changes are made in two functions: _map_shapes_and_ancestors and _number_shapes_ancestors.

File-Level Changes

Files Changes
src/Extend/TopologyUtils.py Replaced TopTools_ListIteratorOfListOfShape with TopTools_ListOfListOfShape in two functions to correct the import.

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @rsm-gh - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

@tpaviot
Copy link
Owner

tpaviot commented Jul 22, 2024

which issue this change is supposed to fix?

@rsm-gh
Copy link
Contributor Author

rsm-gh commented Jul 23, 2024

I'll close this merge and I'll push a better one with the description, this is more like a work around.

@rsm-gh rsm-gh closed this Jul 23, 2024
@rsm-gh
Copy link
Contributor Author

rsm-gh commented Jul 23, 2024

@tpaviot, the error is the following:

Python 3.12.4 (main, Jul 15 2024, 12:17:32) [GCC 13.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from OCC.Extend.TopologyUtils import TopologyExplorer
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.12/dist-packages/OCC/Extend/TopologyUtils.py", line 40, in <module>
    from OCC.Core.TopTools import (
ImportError: cannot import name 'TopTools_ListIteratorOfListOfShape' from 'OCC.Core.TopTools' (/usr/local/lib/python3.12/dist-packages/OCC/Core/TopTools.py). Did you mean: 'TopTools_ListOfListOfShape'?
>>> 

And I was facing it on all the versions > 7.5.1.

Strangely, it is working OK now... and I do not see any difference that could fix it... TopTools_ListIteratorOfListOfShape is correctly generated...

class TopTools_ListIteratorOfListOfShape(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, *args):
        _TopTools.TopTools_ListIteratorOfListOfShape_swiginit(self, _TopTools.new_TopTools_ListIteratorOfListOfShape(*args))

    def More(self):
        return _TopTools.TopTools_ListIteratorOfListOfShape_More(self)

    def Next(self):
        return _TopTools.TopTools_ListIteratorOfListOfShape_Next(self)

    def Value(self):
        return _TopTools.TopTools_ListIteratorOfListOfShape_Value(self)

    def ChangeValue(self):
        return _TopTools.TopTools_ListIteratorOfListOfShape_ChangeValue(self)
    __swig_destroy__ = _TopTools.delete_TopTools_ListIteratorOfListOfShape

# Register TopTools_ListIteratorOfListOfShape in _TopTools:
_TopTools.TopTools_ListIteratorOfListOfShape_swigregister(TopTools_ListIteratorOfListOfShape)

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.

2 participants