Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
payno
id06workflow
Commits
c53682b6
Commit
c53682b6
authored
Nov 27, 2018
by
payno
Browse files
[utils][unique value] fix guess unique value when axis is 1, not relative and give the cycle_length
parent
6ac7d907
Pipeline
#6624
passed with stage
in 2 minutes and 31 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
id06workflow/core/test/test_stream_operations.py
View file @
c53682b6
...
...
@@ -71,6 +71,11 @@ class TestOperationStream(unittest.TestCase):
self
.
assertTrue
(
len
(
metadatautils
.
getUnique
(
self
.
experiment
,
kind
=
POSITIONER_METADATA
,
key
=
'obpitch'
))
is
2
)
self
.
assertTrue
(
len
(
metadatautils
.
getUnique
(
self
.
experiment
,
kind
=
POSITIONER_METADATA
,
key
=
'obpitch'
,
axis
=
1
,
cycle_length
=
2
))
is
2
)
self
.
applyDimsDef
()
self
.
assertTrue
(
self
.
experiment
.
dims
.
ndim
is
2
)
self
.
assertTrue
(
self
.
experiment
.
dims
.
shape
==
(
31
,
2
))
...
...
id06workflow/core/utils/metadata.py
View file @
c53682b6
...
...
@@ -75,6 +75,6 @@ def getUnique(experiment, key, kind, relative_prev_val=False, cycle_length=None,
res
.
append
(
value
[
0
])
except
Exception
as
e
:
_logger
.
error
(
"fail to load %s, %s cause %s"
%
(
kind
,
key
,
e
.
message
))
if
cycle_length
is
not
None
and
len
(
res
)
>=
cycle_length
:
if
cycle_length
is
not
None
and
len
(
numpy
.
unique
(
res
)
)
>=
cycle_length
:
break
return
numpy
.
unique
(
res
)
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment