Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Python3 ArmarX
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software
ArmarX
Python3 ArmarX
Commits
e11ce896
Commit
e11ce896
authored
1 month ago
by
Timo Birr
Browse files
Options
Downloads
Plain Diff
Resolved merge conflict
parents
04cab3cf
fa079f60
No related branches found
Branches containing commit
No related tags found
Loading
Pipeline
#22505
passed
1 month ago
Stage: setup-venv
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
armarx_memory/aron/conversion/pythonic_from_to_aron_ice.py
+14
-4
14 additions, 4 deletions
armarx_memory/aron/conversion/pythonic_from_to_aron_ice.py
with
14 additions
and
4 deletions
armarx_memory/aron/conversion/pythonic_from_to_aron_ice.py
+
14
−
4
View file @
e11ce896
...
...
@@ -28,11 +28,21 @@ def pythonic_to_aron_ice(
return
AronDataIceTypes
.
bool
(
value
)
elif
isinstance
(
value
,
np
.
int64
):
return
AronDataIceTypes
.
long
(
int
(
value
))
elif
isinstance
(
value
,
int
)
or
isinstance
(
value
,
np
.
int32
):
assert
'
invalid value - expected int
'
not
in
str
(
AronIceTypes
.
int
(
int
(
value
))),
\
f
'
Casting
{
value
}
to int failed. Did you intend to use np.int64 instead,
'
\
'
but assigned a plain int value, or converted the value somewhere in the meantime?
'
elif
isinstance
(
value
,
np
.
int32
):
return
AronIceTypes
.
int
(
int
(
value
))
elif
isinstance
(
value
,
int
):
# because python is treating int and long the same, we need to differentiate between the two
if
'
invalid value - expected int
'
in
str
(
AronIceTypes
.
int
(
int
(
value
))):
# try to convert it to AronInt -> if it fails this is a long
assert
'
invalid value - expected int
'
not
in
str
(
AronIceTypes
.
long
(
int
(
value
))),
\
f
'
Casting
{
value
}
to long failed. Did you intend to use np.int64 instead,
'
\
'
but assigned a plain int value, or converted the value somewhere in the meantime?
'
return
AronIceTypes
.
long
(
int
(
value
))
else
:
assert
'
invalid value - expected int
'
not
in
str
(
AronIceTypes
.
int
(
int
(
value
))),
\
f
'
Casting
{
value
}
to int failed. Did you intend to use np.int64 instead,
'
\
'
but assigned a plain int value, or converted the value somewhere in the meantime?
'
return
AronIceTypes
.
int
(
int
(
value
))
elif
isinstance
(
value
,
np
.
float64
):
return
AronDataIceTypes
.
double
(
float
(
value
))
elif
isinstance
(
value
,
float
)
or
isinstance
(
value
,
np
.
float32
):
...
...
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