-
Notifications
You must be signed in to change notification settings - Fork 3
Fix for save script error #1107
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
Conversation
I've followed the steps mentioned in the linked issue, and I am not observing the issue when
Just wanted to confirm whether this is the expected behaviour. Thanks |
@warunawickramasingha Yes, this behaviour is as expected. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tested the change and functionally it is working as expected without issues.
However, the newly added code blocks for deriving cut_end
look repetitive and it could have been better if that can be moved into a utility method and reused.
ex:
def _get_cut_end(start, end, width):
return min(start + width, end) if cut.width is not None else end
If time allows, a simple test case covering the scenario at cut_plotter_presenter_test.py
or scripting_helperfunctions_test.py
could have been even better.
Thanks!
fbf1aa0
to
176f17a
Compare
for more information, see https://pre-commit.ci
@warunawickramasingha That is an excellent idea! Since this function might not apply only to the cut integration axes, I've created a general version in alg_workspace_ops so that it can be used in scripting and presenters (and other places). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes and happy to approve!
Description of work:
Prevent addition of
None
values for width when calculating the cut end. For the issue the crash happened when creating a script from a cut plot. However, the same problem could also occur in the cut plot presenter, so I've applied the same fix there as well.To test:
Please follow the instructions in the original issue. In addition, try to use float values in the
width
box.Fixes #1105