bec-widgets 2.5.3__py3-none-any.whl → 2.6.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- .github/ISSUE_TEMPLATE/bug_report.yml +41 -0
- .gitlab/issue_templates/documentation_update_template.md → .github/ISSUE_TEMPLATE/documentation_update.md +10 -0
- .github/ISSUE_TEMPLATE/feature_request.md +3 -2
- .gitlab/merge_request_templates/default.md → .github/pull_request_template.md +8 -3
- .github/scripts/pr_issue_sync/pr_issue_sync.py +342 -0
- .github/scripts/pr_issue_sync/requirements.txt +2 -0
- .github/workflows/sync-issues-pr.yml +40 -0
- CHANGELOG.md +39 -0
- PKG-INFO +1 -1
- bec_widgets/cli/client.py +31 -1
- bec_widgets/examples/jupyter_console/jupyter_console_window.py +1 -1
- bec_widgets/widgets/containers/dock/dock_area.py +9 -4
- bec_widgets/widgets/plots/image/image.py +72 -8
- bec_widgets/widgets/plots/image/setting_widgets/__init__.py +0 -0
- bec_widgets/widgets/plots/image/setting_widgets/image_roi_tree.py +375 -0
- bec_widgets/widgets/plots/roi/image_roi.py +36 -14
- bec_widgets/widgets/plots/waveform/waveform.py +2 -0
- {bec_widgets-2.5.3.dist-info → bec_widgets-2.6.0.dist-info}/METADATA +1 -1
- {bec_widgets-2.5.3.dist-info → bec_widgets-2.6.0.dist-info}/RECORD +23 -20
- pyproject.toml +1 -1
- .github/ISSUE_TEMPLATE/bug_report.md +0 -26
- .gitlab/issue_templates/bug_report_template.md +0 -17
- .gitlab/issue_templates/feature_request_template.md +0 -40
- {bec_widgets-2.5.3.dist-info → bec_widgets-2.6.0.dist-info}/WHEEL +0 -0
- {bec_widgets-2.5.3.dist-info → bec_widgets-2.6.0.dist-info}/entry_points.txt +0 -0
- {bec_widgets-2.5.3.dist-info → bec_widgets-2.6.0.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,41 @@
|
|
1
|
+
name: Bug report
|
2
|
+
description: File a bug report.
|
3
|
+
title: "[BUG]: "
|
4
|
+
labels: ["bug"]
|
5
|
+
|
6
|
+
body:
|
7
|
+
- type: markdown
|
8
|
+
attributes:
|
9
|
+
value: |
|
10
|
+
Bug report:
|
11
|
+
- type: textarea
|
12
|
+
id: description
|
13
|
+
attributes:
|
14
|
+
label: Provide a brief description of the bug.
|
15
|
+
- type: textarea
|
16
|
+
id: expected
|
17
|
+
attributes:
|
18
|
+
label: Describe what you expected to happen and what actually happened.
|
19
|
+
- type: textarea
|
20
|
+
id: reproduction
|
21
|
+
attributes:
|
22
|
+
label: Outline the steps that lead to the bug's occurrence. Be specific and provide a clear sequence of actions.
|
23
|
+
- type: input
|
24
|
+
id: version
|
25
|
+
attributes:
|
26
|
+
label: bec_widgets version
|
27
|
+
description: which version of BEC widgets was running?
|
28
|
+
- type: input
|
29
|
+
id: bec-version
|
30
|
+
attributes:
|
31
|
+
label: bec core version
|
32
|
+
description: which version of BEC core was running?
|
33
|
+
- type: textarea
|
34
|
+
id: extra
|
35
|
+
attributes:
|
36
|
+
label: Any extra info / data? e.g. log output...
|
37
|
+
- type: input
|
38
|
+
id: issues
|
39
|
+
attributes:
|
40
|
+
label: Related issues
|
41
|
+
description: please tag any related issues
|
@@ -1,3 +1,13 @@
|
|
1
|
+
---
|
2
|
+
name: Documentation update request
|
3
|
+
about: Suggest an update to the docs
|
4
|
+
title: '[DOCS]: '
|
5
|
+
type: documentation
|
6
|
+
label: documentation
|
7
|
+
assignees: ''
|
8
|
+
|
9
|
+
---
|
10
|
+
|
1
11
|
## Documentation Section
|
2
12
|
|
3
13
|
[Specify the section or page of the documentation that needs updating]
|
@@ -1,19 +1,24 @@
|
|
1
1
|
## Description
|
2
2
|
|
3
|
-
[Provide a brief description of the changes introduced by this
|
3
|
+
[Provide a brief description of the changes introduced by this pull request.]
|
4
4
|
|
5
5
|
## Related Issues
|
6
6
|
|
7
|
-
[Cite any related issues or feature requests that are addressed or resolved by this
|
7
|
+
[Cite any related issues or feature requests that are addressed or resolved by this pull request. Link the associated issue, for example, with `fixes #123` or `closes #123`.]
|
8
8
|
|
9
9
|
## Type of Change
|
10
10
|
|
11
11
|
- Change 1
|
12
12
|
- Change 2
|
13
13
|
|
14
|
+
## How to test
|
15
|
+
|
16
|
+
- Run unit tests
|
17
|
+
- Open [widget] in designer and play around with the properties
|
18
|
+
|
14
19
|
## Potential side effects
|
15
20
|
|
16
|
-
[Describe any potential side effects or risks of merging this
|
21
|
+
[Describe any potential side effects or risks of merging this PR.]
|
17
22
|
|
18
23
|
## Screenshots / GIFs (if applicable)
|
19
24
|
|
@@ -0,0 +1,342 @@
|
|
1
|
+
import functools
|
2
|
+
import os
|
3
|
+
from typing import Literal
|
4
|
+
|
5
|
+
import requests
|
6
|
+
from github import Github
|
7
|
+
from pydantic import BaseModel
|
8
|
+
|
9
|
+
|
10
|
+
class GHConfig(BaseModel):
|
11
|
+
token: str
|
12
|
+
organization: str
|
13
|
+
repository: str
|
14
|
+
project_number: int
|
15
|
+
graphql_url: str
|
16
|
+
rest_url: str
|
17
|
+
headers: dict
|
18
|
+
|
19
|
+
|
20
|
+
class ProjectItemHandler:
|
21
|
+
"""
|
22
|
+
A class to handle GitHub project items.
|
23
|
+
"""
|
24
|
+
|
25
|
+
def __init__(self, gh_config: GHConfig):
|
26
|
+
self.gh_config = gh_config
|
27
|
+
self.gh = Github(gh_config.token)
|
28
|
+
self.repo = self.gh.get_repo(f"{gh_config.organization}/{gh_config.repository}")
|
29
|
+
self.project_node_id = self.get_project_node_id()
|
30
|
+
|
31
|
+
def set_issue_status(
|
32
|
+
self,
|
33
|
+
status: Literal[
|
34
|
+
"Selected for Development",
|
35
|
+
"Weekly Backlog",
|
36
|
+
"In Development",
|
37
|
+
"Ready For Review",
|
38
|
+
"On Hold",
|
39
|
+
"Done",
|
40
|
+
],
|
41
|
+
issue_number: int | None = None,
|
42
|
+
issue_node_id: str | None = None,
|
43
|
+
):
|
44
|
+
"""
|
45
|
+
Set the status field of a GitHub issue in the project.
|
46
|
+
|
47
|
+
Args:
|
48
|
+
status (str): The status to set. Must be one of the predefined statuses.
|
49
|
+
issue_number (int, optional): The issue number. If not provided, issue_node_id must be provided.
|
50
|
+
issue_node_id (str, optional): The issue node ID. If not provided, issue_number must be provided.
|
51
|
+
"""
|
52
|
+
if not issue_number and not issue_node_id:
|
53
|
+
raise ValueError("Either issue_number or issue_node_id must be provided.")
|
54
|
+
if issue_number and issue_node_id:
|
55
|
+
raise ValueError("Only one of issue_number or issue_node_id must be provided.")
|
56
|
+
if issue_number is not None:
|
57
|
+
issue = self.repo.get_issue(issue_number)
|
58
|
+
issue_id = self.get_issue_info(issue.node_id)[0]["id"]
|
59
|
+
else:
|
60
|
+
issue_id = issue_node_id
|
61
|
+
field_id, option_id = self.get_status_field_id(field_name=status)
|
62
|
+
self.set_field_option(issue_id, field_id, option_id)
|
63
|
+
|
64
|
+
def run_graphql(self, query: str, variables: dict) -> dict:
|
65
|
+
"""
|
66
|
+
Execute a GraphQL query against the GitHub API.
|
67
|
+
|
68
|
+
Args:
|
69
|
+
query (str): The GraphQL query to execute.
|
70
|
+
variables (dict): The variables to pass to the query.
|
71
|
+
|
72
|
+
Returns:
|
73
|
+
dict: The response from the GitHub API.
|
74
|
+
"""
|
75
|
+
response = requests.post(
|
76
|
+
self.gh_config.graphql_url,
|
77
|
+
json={"query": query, "variables": variables},
|
78
|
+
headers=self.gh_config.headers,
|
79
|
+
timeout=10,
|
80
|
+
)
|
81
|
+
if response.status_code != 200:
|
82
|
+
raise Exception(
|
83
|
+
f"Query failed with status code {response.status_code}: {response.text}"
|
84
|
+
)
|
85
|
+
return response.json()
|
86
|
+
|
87
|
+
def get_project_node_id(self):
|
88
|
+
"""
|
89
|
+
Retrieve the project node ID from the GitHub API.
|
90
|
+
"""
|
91
|
+
query = """
|
92
|
+
query($owner: String!, $number: Int!) {
|
93
|
+
organization(login: $owner) {
|
94
|
+
projectV2(number: $number) {
|
95
|
+
id
|
96
|
+
}
|
97
|
+
}
|
98
|
+
}
|
99
|
+
"""
|
100
|
+
variables = {"owner": self.gh_config.organization, "number": self.gh_config.project_number}
|
101
|
+
resp = self.run_graphql(query, variables)
|
102
|
+
return resp["data"]["organization"]["projectV2"]["id"]
|
103
|
+
|
104
|
+
def get_issue_info(self, issue_node_id: str):
|
105
|
+
"""
|
106
|
+
Get the project-related information for a given issue node ID.
|
107
|
+
|
108
|
+
Args:
|
109
|
+
issue_node_id (str): The node ID of the issue. Please note that this is not the issue number and typically starts with "I".
|
110
|
+
|
111
|
+
Returns:
|
112
|
+
list[dict]: A list of project items associated with the issue.
|
113
|
+
"""
|
114
|
+
query = """
|
115
|
+
query($issueId: ID!) {
|
116
|
+
node(id: $issueId) {
|
117
|
+
... on Issue {
|
118
|
+
projectItems(first: 10) {
|
119
|
+
nodes {
|
120
|
+
project {
|
121
|
+
id
|
122
|
+
title
|
123
|
+
}
|
124
|
+
id
|
125
|
+
fieldValues(first: 20) {
|
126
|
+
nodes {
|
127
|
+
... on ProjectV2ItemFieldSingleSelectValue {
|
128
|
+
name
|
129
|
+
field {
|
130
|
+
... on ProjectV2SingleSelectField {
|
131
|
+
name
|
132
|
+
}
|
133
|
+
}
|
134
|
+
}
|
135
|
+
}
|
136
|
+
}
|
137
|
+
}
|
138
|
+
}
|
139
|
+
}
|
140
|
+
}
|
141
|
+
}
|
142
|
+
"""
|
143
|
+
variables = {"issueId": issue_node_id}
|
144
|
+
resp = self.run_graphql(query, variables)
|
145
|
+
return resp["data"]["node"]["projectItems"]["nodes"]
|
146
|
+
|
147
|
+
def get_status_field_id(
|
148
|
+
self,
|
149
|
+
field_name: Literal[
|
150
|
+
"Selected for Development",
|
151
|
+
"Weekly Backlog",
|
152
|
+
"In Development",
|
153
|
+
"Ready For Review",
|
154
|
+
"On Hold",
|
155
|
+
"Done",
|
156
|
+
],
|
157
|
+
) -> tuple[str, str]:
|
158
|
+
"""
|
159
|
+
Get the status field ID and option ID for the given field name in the project.
|
160
|
+
|
161
|
+
Args:
|
162
|
+
field_name (str): The name of the field to retrieve.
|
163
|
+
Must be one of the predefined statuses.
|
164
|
+
|
165
|
+
Returns:
|
166
|
+
tuple[str, str]: A tuple containing the field ID and option ID.
|
167
|
+
"""
|
168
|
+
field_id = None
|
169
|
+
option_id = None
|
170
|
+
project_fields = self.get_project_fields()
|
171
|
+
for field in project_fields:
|
172
|
+
if field["name"] != "Status":
|
173
|
+
continue
|
174
|
+
field_id = field["id"]
|
175
|
+
for option in field["options"]:
|
176
|
+
if option["name"] == field_name:
|
177
|
+
option_id = option["id"]
|
178
|
+
break
|
179
|
+
if not field_id or not option_id:
|
180
|
+
raise ValueError(f"Field '{field_name}' not found in project fields.")
|
181
|
+
|
182
|
+
return field_id, option_id
|
183
|
+
|
184
|
+
def set_field_option(self, item_id, field_id, option_id):
|
185
|
+
"""
|
186
|
+
Set the option of a project item for a single-select field.
|
187
|
+
|
188
|
+
Args:
|
189
|
+
item_id (str): The ID of the project item to update.
|
190
|
+
field_id (str): The ID of the field to update.
|
191
|
+
option_id (str): The ID of the option to set.
|
192
|
+
"""
|
193
|
+
|
194
|
+
mutation = """
|
195
|
+
mutation($projectId: ID!, $itemId: ID!, $fieldId: ID!, $optionId: String!) {
|
196
|
+
updateProjectV2ItemFieldValue(
|
197
|
+
input: {
|
198
|
+
projectId: $projectId
|
199
|
+
itemId: $itemId
|
200
|
+
fieldId: $fieldId
|
201
|
+
value: { singleSelectOptionId: $optionId }
|
202
|
+
}
|
203
|
+
) {
|
204
|
+
projectV2Item {
|
205
|
+
id
|
206
|
+
}
|
207
|
+
}
|
208
|
+
}
|
209
|
+
"""
|
210
|
+
variables = {
|
211
|
+
"projectId": self.project_node_id,
|
212
|
+
"itemId": item_id,
|
213
|
+
"fieldId": field_id,
|
214
|
+
"optionId": option_id,
|
215
|
+
}
|
216
|
+
return self.run_graphql(mutation, variables)
|
217
|
+
|
218
|
+
@functools.lru_cache(maxsize=1)
|
219
|
+
def get_project_fields(self) -> list[dict]:
|
220
|
+
"""
|
221
|
+
Get the available fields in the project.
|
222
|
+
This method caches the result to avoid multiple API calls.
|
223
|
+
|
224
|
+
Returns:
|
225
|
+
list[dict]: A list of fields in the project.
|
226
|
+
"""
|
227
|
+
|
228
|
+
query = """
|
229
|
+
query($projectId: ID!) {
|
230
|
+
node(id: $projectId) {
|
231
|
+
... on ProjectV2 {
|
232
|
+
fields(first: 50) {
|
233
|
+
nodes {
|
234
|
+
... on ProjectV2SingleSelectField {
|
235
|
+
id
|
236
|
+
name
|
237
|
+
options {
|
238
|
+
id
|
239
|
+
name
|
240
|
+
}
|
241
|
+
}
|
242
|
+
}
|
243
|
+
}
|
244
|
+
}
|
245
|
+
}
|
246
|
+
}
|
247
|
+
"""
|
248
|
+
variables = {"projectId": self.project_node_id}
|
249
|
+
resp = self.run_graphql(query, variables)
|
250
|
+
return list(filter(bool, resp["data"]["node"]["fields"]["nodes"]))
|
251
|
+
|
252
|
+
def get_pull_request_linked_issues(self, pr_number: int) -> list[dict]:
|
253
|
+
"""
|
254
|
+
Get the linked issues of a pull request.
|
255
|
+
|
256
|
+
Args:
|
257
|
+
pr_number (int): The pull request number.
|
258
|
+
|
259
|
+
Returns:
|
260
|
+
list[dict]: A list of linked issues.
|
261
|
+
"""
|
262
|
+
query = """
|
263
|
+
query($number: Int!, $owner: String!, $repo: String!) {
|
264
|
+
repository(owner: $owner, name: $repo) {
|
265
|
+
pullRequest(number: $number) {
|
266
|
+
id
|
267
|
+
closingIssuesReferences(first: 50) {
|
268
|
+
edges {
|
269
|
+
node {
|
270
|
+
id
|
271
|
+
body
|
272
|
+
number
|
273
|
+
title
|
274
|
+
}
|
275
|
+
}
|
276
|
+
}
|
277
|
+
}
|
278
|
+
}
|
279
|
+
}
|
280
|
+
"""
|
281
|
+
variables = {
|
282
|
+
"number": pr_number,
|
283
|
+
"owner": self.gh_config.organization,
|
284
|
+
"repo": self.gh_config.repository,
|
285
|
+
}
|
286
|
+
resp = self.run_graphql(query, variables)
|
287
|
+
edges = resp["data"]["repository"]["pullRequest"]["closingIssuesReferences"]["edges"]
|
288
|
+
return [edge["node"] for edge in edges if edge.get("node")]
|
289
|
+
|
290
|
+
|
291
|
+
def main():
|
292
|
+
# GitHub settings
|
293
|
+
token = os.getenv("TOKEN")
|
294
|
+
org = os.getenv("ORG")
|
295
|
+
repo = os.getenv("REPO")
|
296
|
+
project_number = os.getenv("PROJECT_NUMBER")
|
297
|
+
pr_number = os.getenv("PR_NUMBER")
|
298
|
+
|
299
|
+
if not token:
|
300
|
+
raise ValueError("GitHub token is not set. Please set the TOKEN environment variable.")
|
301
|
+
if not org:
|
302
|
+
raise ValueError("GitHub organization is not set. Please set the ORG environment variable.")
|
303
|
+
if not repo:
|
304
|
+
raise ValueError("GitHub repository is not set. Please set the REPO environment variable.")
|
305
|
+
if not project_number:
|
306
|
+
raise ValueError(
|
307
|
+
"GitHub project number is not set. Please set the PROJECT_NUMBER environment variable."
|
308
|
+
)
|
309
|
+
if not pr_number:
|
310
|
+
raise ValueError(
|
311
|
+
"Pull request number is not set. Please set the PR_NUMBER environment variable."
|
312
|
+
)
|
313
|
+
|
314
|
+
project_number = int(project_number)
|
315
|
+
pr_number = int(pr_number)
|
316
|
+
|
317
|
+
gh_config = GHConfig(
|
318
|
+
token=token,
|
319
|
+
organization=org,
|
320
|
+
repository=repo,
|
321
|
+
project_number=project_number,
|
322
|
+
graphql_url="https://api.github.com/graphql",
|
323
|
+
rest_url=f"https://api.github.com/repos/{org}/{repo}/issues",
|
324
|
+
headers={"Authorization": f"Bearer {token}", "Accept": "application/vnd.github+json"},
|
325
|
+
)
|
326
|
+
project_item_handler = ProjectItemHandler(gh_config=gh_config)
|
327
|
+
|
328
|
+
# Get PR info
|
329
|
+
pr = project_item_handler.repo.get_pull(pr_number)
|
330
|
+
|
331
|
+
# Get the linked issues of the pull request
|
332
|
+
linked_issues = project_item_handler.get_pull_request_linked_issues(pr_number=pr_number)
|
333
|
+
print(f"Linked issues: {linked_issues}")
|
334
|
+
|
335
|
+
target_status = "In Development" if pr.draft else "Ready For Review"
|
336
|
+
print(f"Target status: {target_status}")
|
337
|
+
for issue in linked_issues:
|
338
|
+
project_item_handler.set_issue_status(issue_number=issue["number"], status=target_status)
|
339
|
+
|
340
|
+
|
341
|
+
if __name__ == "__main__":
|
342
|
+
main()
|
@@ -0,0 +1,40 @@
|
|
1
|
+
name: Sync PR to Project
|
2
|
+
|
3
|
+
on:
|
4
|
+
pull_request:
|
5
|
+
types: [opened, edited, ready_for_review, converted_to_draft, reopened, synchronize]
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
sync-project:
|
9
|
+
runs-on: ubuntu-latest
|
10
|
+
|
11
|
+
permissions:
|
12
|
+
issues: write
|
13
|
+
pull-requests: read
|
14
|
+
contents: read
|
15
|
+
|
16
|
+
env:
|
17
|
+
PROJECT_NUMBER: 3 # BEC Project
|
18
|
+
ORG: 'bec-project'
|
19
|
+
REPO: 'bec_widgets'
|
20
|
+
TOKEN: ${{ secrets.ADD_ISSUE_TO_PROJECT }}
|
21
|
+
PR_NUMBER: ${{ github.event.pull_request.number }}
|
22
|
+
|
23
|
+
steps:
|
24
|
+
- name: Set up python environment
|
25
|
+
uses: actions/setup-python@v4
|
26
|
+
with:
|
27
|
+
python-version: 3.11
|
28
|
+
|
29
|
+
- name: Checkout repo
|
30
|
+
uses: actions/checkout@v4
|
31
|
+
with:
|
32
|
+
repository: ${{ github.repository }}
|
33
|
+
ref: ${{ github.event.pull_request.head.ref }}
|
34
|
+
|
35
|
+
- name: Install dependencies
|
36
|
+
run: |
|
37
|
+
pip install -r ./.github/scripts/pr_issue_sync/requirements.txt
|
38
|
+
- name: Sync PR to Project
|
39
|
+
run: |
|
40
|
+
python ./.github/scripts/pr_issue_sync/pr_issue_sync.py
|
CHANGELOG.md
CHANGED
@@ -1,6 +1,45 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
3
|
|
4
|
+
## v2.6.0 (2025-05-26)
|
5
|
+
|
6
|
+
### Bug Fixes
|
7
|
+
|
8
|
+
- **image_roi**: Position can be set from rpc
|
9
|
+
([`41b7ca8`](https://github.com/bec-project/bec_widgets/commit/41b7ca8e649d39dd21d09febfa8aabfc8f6f98fc))
|
10
|
+
|
11
|
+
### Chores
|
12
|
+
|
13
|
+
- Migrate issue template to github form syntax
|
14
|
+
([`05489a1`](https://github.com/bec-project/bec_widgets/commit/05489a1c563e20a49fe34d4df97ca0c3c23d8634))
|
15
|
+
|
16
|
+
### Continuous Integration
|
17
|
+
|
18
|
+
- Add pr issue sync
|
19
|
+
([`53377d2`](https://github.com/bec-project/bec_widgets/commit/53377d26e2767b3df7c788330c4d592fc12051ed))
|
20
|
+
|
21
|
+
### Features
|
22
|
+
|
23
|
+
- **image_roi_tree**: Gui roi manager for image widget
|
24
|
+
([`a939c3b`](https://github.com/bec-project/bec_widgets/commit/a939c3b1c4a7bcf1322f2d1d330fdb721ea04d56))
|
25
|
+
|
26
|
+
- **waveform**: Lmfitdialog cleanup after close
|
27
|
+
([`a020f2d`](https://github.com/bec-project/bec_widgets/commit/a020f2dc7e537493ce4aff5d88ea003956624869))
|
28
|
+
|
29
|
+
### Refactoring
|
30
|
+
|
31
|
+
- **image_roi**: Glowing handles for Rectangle roi
|
32
|
+
([`7a531c1`](https://github.com/bec-project/bec_widgets/commit/7a531c17d6a4411550600ddc8bb9d56ee777259d))
|
33
|
+
|
34
|
+
|
35
|
+
## v2.5.4 (2025-05-22)
|
36
|
+
|
37
|
+
### Bug Fixes
|
38
|
+
|
39
|
+
- **dock_area**: Menu to add LogPanel into DockArea is temporary disabled
|
40
|
+
([`d4def09`](https://github.com/bec-project/bec_widgets/commit/d4def09a4ecc024fd7e0e90fd975799066e7bb58))
|
41
|
+
|
42
|
+
|
4
43
|
## v2.5.3 (2025-05-22)
|
5
44
|
|
6
45
|
### Bug Fixes
|
PKG-INFO
CHANGED
bec_widgets/cli/client.py
CHANGED
@@ -602,6 +602,16 @@ class BaseROI(RPCBase):
|
|
602
602
|
ndarray: Pixel data inside the ROI, or (data, coords) if *returnMappedCoords* is True.
|
603
603
|
"""
|
604
604
|
|
605
|
+
@rpc_call
|
606
|
+
def set_position(self, x: "float", y: "float"):
|
607
|
+
"""
|
608
|
+
Sets the position of the ROI.
|
609
|
+
|
610
|
+
Args:
|
611
|
+
x (float): The x-coordinate of the new position.
|
612
|
+
y (float): The y-coordinate of the new position.
|
613
|
+
"""
|
614
|
+
|
605
615
|
|
606
616
|
class CircularROI(RPCBase):
|
607
617
|
"""Circular Region of Interest with center/diameter tracking and auto-labeling."""
|
@@ -701,6 +711,16 @@ class CircularROI(RPCBase):
|
|
701
711
|
ndarray: Pixel data inside the ROI, or (data, coords) if *returnMappedCoords* is True.
|
702
712
|
"""
|
703
713
|
|
714
|
+
@rpc_call
|
715
|
+
def set_position(self, x: "float", y: "float"):
|
716
|
+
"""
|
717
|
+
Sets the position of the ROI.
|
718
|
+
|
719
|
+
Args:
|
720
|
+
x (float): The x-coordinate of the new position.
|
721
|
+
y (float): The y-coordinate of the new position.
|
722
|
+
"""
|
723
|
+
|
704
724
|
|
705
725
|
class Curve(RPCBase):
|
706
726
|
@rpc_call
|
@@ -1418,7 +1438,7 @@ class Image(RPCBase):
|
|
1418
1438
|
self,
|
1419
1439
|
kind: "Literal['rect', 'circle']" = "rect",
|
1420
1440
|
name: "str | None" = None,
|
1421
|
-
line_width: "int | None" =
|
1441
|
+
line_width: "int | None" = 5,
|
1422
1442
|
pos: "tuple[float, float] | None" = (10, 10),
|
1423
1443
|
size: "tuple[float, float] | None" = (50, 50),
|
1424
1444
|
**pg_kwargs,
|
@@ -2652,6 +2672,16 @@ class RectangularROI(RPCBase):
|
|
2652
2672
|
ndarray: Pixel data inside the ROI, or (data, coords) if *returnMappedCoords* is True.
|
2653
2673
|
"""
|
2654
2674
|
|
2675
|
+
@rpc_call
|
2676
|
+
def set_position(self, x: "float", y: "float"):
|
2677
|
+
"""
|
2678
|
+
Sets the position of the ROI.
|
2679
|
+
|
2680
|
+
Args:
|
2681
|
+
x (float): The x-coordinate of the new position.
|
2682
|
+
y (float): The y-coordinate of the new position.
|
2683
|
+
"""
|
2684
|
+
|
2655
2685
|
|
2656
2686
|
class ResetButton(RPCBase):
|
2657
2687
|
"""A button that resets the scan queue."""
|
@@ -114,7 +114,7 @@ class JupyterConsoleWindow(QWidget): # pragma: no cover:
|
|
114
114
|
#
|
115
115
|
sixth_tab = QWidget()
|
116
116
|
sixth_tab_layout = QVBoxLayout(sixth_tab)
|
117
|
-
self.im = Image(popups=
|
117
|
+
self.im = Image(popups=True)
|
118
118
|
self.mi = self.im.main_image
|
119
119
|
sixth_tab_layout.addWidget(self.im)
|
120
120
|
tab_widget.addTab(sixth_tab, "Image Next Gen")
|
@@ -163,8 +163,11 @@ class BECDockArea(BECWidget, QWidget):
|
|
163
163
|
tooltip="Add Circular ProgressBar",
|
164
164
|
filled=True,
|
165
165
|
),
|
166
|
+
# FIXME temporarily disabled -> issue #644
|
166
167
|
"log_panel": MaterialIconAction(
|
167
|
-
icon_name=LogPanel.ICON_NAME,
|
168
|
+
icon_name=LogPanel.ICON_NAME,
|
169
|
+
tooltip="Add LogPanel - Disabled",
|
170
|
+
filled=True,
|
168
171
|
),
|
169
172
|
},
|
170
173
|
),
|
@@ -230,9 +233,11 @@ class BECDockArea(BECWidget, QWidget):
|
|
230
233
|
self.toolbar.widgets["menu_utils"].widgets["progress_bar"].triggered.connect(
|
231
234
|
lambda: self._create_widget_from_toolbar(widget_name="RingProgressBar")
|
232
235
|
)
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
+
# FIXME temporarily disabled -> issue #644
|
237
|
+
self.toolbar.widgets["menu_utils"].widgets["log_panel"].setEnabled(False)
|
238
|
+
# self.toolbar.widgets["menu_utils"].widgets["log_panel"].triggered.connect(
|
239
|
+
# lambda: self._create_widget_from_toolbar(widget_name="LogPanel")
|
240
|
+
# )
|
236
241
|
|
237
242
|
# Icons
|
238
243
|
self.toolbar.widgets["attach_all"].action.triggered.connect(self.attach_all)
|