Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
calng
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
calibration
calng
Commits
43e78f05
Commit
43e78f05
authored
6 months ago
by
David Hammer
Browse files
Options
Downloads
Patches
Plain Diff
Arbiter kernels get notified of new geometry
parent
dc270d84
No related branches found
No related tags found
2 merge requests
!120
DetectorAssembler: go to ERROR if trying to match without geometry
,
!118
Draft: MID: put arbiter on manager scene
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/calng/FrameSelectionArbiter.py
+11
-1
11 additions, 1 deletion
src/calng/FrameSelectionArbiter.py
src/calng/arbiter_kernels/base_kernel.py
+9
-4
9 additions, 4 deletions
src/calng/arbiter_kernels/base_kernel.py
with
20 additions
and
5 deletions
src/calng/FrameSelectionArbiter.py
+
11
−
1
View file @
43e78f05
...
@@ -143,7 +143,10 @@ class BaseFrameSelectionArbiter(TrainMatcher.TrainMatcher):
...
@@ -143,7 +143,10 @@ class BaseFrameSelectionArbiter(TrainMatcher.TrainMatcher):
self
,
on_success
=
{
"
state
"
:
"
PASSIVE
"
}
self
,
on_success
=
{
"
state
"
:
"
PASSIVE
"
}
)
)
geom_utils
.
subscribe_to_geometry_bound
(
self
,
self
.
get
(
"
geometryDevice
"
))
self
.
_geometry
=
None
geom_utils
.
subscribe_to_geometry_bound
(
self
,
self
.
get
(
"
geometryDevice
"
),
on_geometry
=
self
.
_on_geometry
)
def
_guess_number_of_frames
(
self
,
sources
):
def
_guess_number_of_frames
(
self
,
sources
):
# TODO: robust frame deduction
# TODO: robust frame deduction
...
@@ -256,6 +259,9 @@ class SimpleFrameSelectionArbiter(BaseFrameSelectionArbiter):
...
@@ -256,6 +259,9 @@ class SimpleFrameSelectionArbiter(BaseFrameSelectionArbiter):
self
.
info
[
"
trainId
"
]
=
train_id
self
.
info
[
"
trainId
"
]
=
train_id
self
.
rate_out
.
update
()
self
.
rate_out
.
update
()
def
_on_geometry
(
self
,
geometry
):
self
.
kernel
.
on_new_geometry
(
geometry
)
@KARABO_CLASSINFO
(
"
AdvancedFrameSelectionArbiter
"
,
deviceVersion
)
@KARABO_CLASSINFO
(
"
AdvancedFrameSelectionArbiter
"
,
deviceVersion
)
class
AdvancedFrameSelectionArbiter
(
BaseFrameSelectionArbiter
):
class
AdvancedFrameSelectionArbiter
(
BaseFrameSelectionArbiter
):
...
@@ -509,3 +515,7 @@ class AdvancedFrameSelectionArbiter(BaseFrameSelectionArbiter):
...
@@ -509,3 +515,7 @@ class AdvancedFrameSelectionArbiter(BaseFrameSelectionArbiter):
kernel_prefix
=
f
"
frameSelection.selections.
{
name
}
"
kernel_prefix
=
f
"
frameSelection.selections.
{
name
}
"
if
conf
.
has
(
kernel_prefix
):
if
conf
.
has
(
kernel_prefix
):
kernel
.
reconfigure
(
conf
[
kernel_prefix
])
kernel
.
reconfigure
(
conf
[
kernel_prefix
])
def
_on_geometry
(
self
,
geometry
):
for
kernel
in
self
.
_selection_kernels
.
values
()
kernel
.
on_new_geometry
(
geometry
)
This diff is collapsed.
Click to expand it.
src/calng/arbiter_kernels/base_kernel.py
+
9
−
4
View file @
43e78f05
...
@@ -13,10 +13,6 @@ class BaseArbiterKernel:
...
@@ -13,10 +13,6 @@ class BaseArbiterKernel:
self
.
_name
=
name
self
.
_name
=
name
self
.
reconfigure
(
config
)
self
.
reconfigure
(
config
)
@property
def
geometry
(
self
):
return
self
.
_device
.
_geometry
@staticmethod
@staticmethod
def
extend_device_schema
(
schema
,
prefix
):
def
extend_device_schema
(
schema
,
prefix
):
"""
Should add configurability to the arbiter (matcher) the kernel will be
"""
Should add configurability to the arbiter (matcher) the kernel will be
...
@@ -38,6 +34,15 @@ class BaseArbiterKernel:
...
@@ -38,6 +34,15 @@ class BaseArbiterKernel:
def
reconfigure
(
self
,
config
):
def
reconfigure
(
self
,
config
):
pass
pass
@property
def
geometry
(
self
):
"""
Same as BaseCorrectionAddon.geometry
"""
return
self
.
_device
.
_geometry
def
on_new_geometry
(
self
,
geometry
):
"""
Same as BaseCorrectionAddon.on_new_geometry
"""
pass
class
Assign
(
BaseArbiterKernel
):
class
Assign
(
BaseArbiterKernel
):
def
consider
(
self
,
tid
,
src
,
nframes
,
mask
,
out
):
def
consider
(
self
,
tid
,
src
,
nframes
,
mask
,
out
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment