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

GUI: gmodeler fix adding tool #4309

Merged
merged 2 commits into from
Sep 13, 2024
Merged

Conversation

landam
Copy link
Member

@landam landam commented Sep 12, 2024

This PR fixes two regressions introduced recently.

Steps to reproduce

  1. Open graphical modeler
  2. Add some tool (tested on v.buffer)
  3. Fill required params (in the case of v.buffer: input and output)
  4. Press OK

Adding new tool fails with:

Traceback (most recent call last):
  File "/home/martin/src/grass/dist.x86_64-pc-linux-gnu/gui/wxpython/gui_core/forms.py", line 828, in OnOK
    cmd = self.OnApply(event)
          ^^^^^^^^^^^^^^^^^^^
  File "/home/martin/src/grass/dist.x86_64-pc-linux-gnu/gui/wxpython/gui_core/forms.py", line 841, in OnApply
    self.get_dcmd(
  File "/home/martin/src/grass/dist.x86_64-pc-linux-gnu/gui/wxpython/gmodeler/panels.py", line 507, in GetOptData
    data = dataClass(
           ^^^^^^^^^^
  File "/home/martin/src/grass/dist.x86_64-pc-linux-gnu/gui/wxpython/gmodeler/model.py", line 1380, in __init__
    self._defineShape(width, height, x, y)
  File "/home/martin/src/grass/dist.x86_64-pc-linux-gnu/gui/wxpython/gmodeler/model.py", line 1580, in _defineShape
    ogl.EllipseShape(self, width, height)
TypeError: EllipseShape.__init__() takes 3 positional arguments but 4 were given

This regression was introduced by 2cf98da.

After fixing this issue a new regression appears:

Traceback (most recent call last):
  File "/home/martin/src/grass/dist.x86_64-pc-linux-gnu/gui/wxpython/gui_core/forms.py", line 828, in OnOK
    cmd = self.OnApply(event)
          ^^^^^^^^^^^^^^^^^^^
  File "/home/martin/src/grass/dist.x86_64-pc-linux-gnu/gui/wxpython/gui_core/forms.py", line 841, in OnApply
    self.get_dcmd(
  File "/home/martin/src/grass/dist.x86_64-pc-linux-gnu/gui/wxpython/gmodeler/panels.py", line 536, in GetOptData
    data.Update()
  File "/home/martin/src/grass/dist.x86_64-pc-linux-gnu/gui/wxpython/gmodeler/model.py", line 1555, in Update
    self._setPen()
  File "/home/martin/src/grass/dist.x86_64-pc-linux-gnu/gui/wxpython/gmodeler/model.py", line 1538, in _setPen
    self.SetPen(self._getPen())
                ^^^^^^^^^^^^^^
  File "/home/martin/src/grass/dist.x86_64-pc-linux-gnu/gui/wxpython/gmodeler/model.py", line 1508, in _getPen
    if rel.GetTo().IsParameterized():
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'ModelDataSingle' object has no attribute 'IsParameterized'

This regression was introduced by f99780c.

This PR fixes both issues in the modeler. @echoix BTW, there are similar modifications (removed __init__ and kept self) in 2cf98da related to ColumnSorterMixin. I didn't checked it, but possibly it's introducing similar regression.

@landam landam requested a review from echoix September 12, 2024 09:07
@landam landam self-assigned this Sep 12, 2024
@landam landam added the bug Something isn't working label Sep 12, 2024
@github-actions github-actions bot added GUI wxGUI related Python Related code is in Python labels Sep 12, 2024
@landam landam added this to the 8.5.0 milestone Sep 12, 2024
@echoix
Copy link
Member

echoix commented Sep 12, 2024

This mentions ColumnSorterMixin #4277

@echoix
Copy link
Member

echoix commented Sep 12, 2024

I see the subtle difference with the change in the model file.
It wasn't included in my PR initially, but ended up there after review:
#4045 (comment)

I still don't see the difference with the __init__ though... Unless that class ends up having a __call__ attribute.

@echoix echoix merged commit 2c1df9f into OSGeo:main Sep 13, 2024
26 checks passed
Mahesh1998 pushed a commit to Mahesh1998/grass that referenced this pull request Sep 19, 2024
* revert 2cf98da

* fix regression introduced in f99780c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working GUI wxGUI related Python Related code is in Python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants