Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cellcomplex
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
Admin message
GitLab upgrade completed. Current version is 17.11.4.
Show more breadcrumbs
MOSAIC
cellcomplex
Commits
cac357d8
Commit
cac357d8
authored
2 years ago
by
CERUTTI Guillaume
Browse files
Options
Downloads
Patches
Plain Diff
also avoid deprecation warnings for ragged sequences array
parent
e63e2f07
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!4
NumPy warnings + verbosity updates
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/cellcomplex/utils/array_dict.py
+6
-1
6 additions, 1 deletion
src/cellcomplex/utils/array_dict.py
with
6 additions
and
1 deletion
src/cellcomplex/utils/array_dict.py
+
6
−
1
View file @
cac357d8
import
warnings
import
numpy
as
np
from
scipy
import
ndimage
as
nd
...
...
@@ -10,6 +12,7 @@ def isiterable(obj):
def
make_values_array
(
values
,
has_keys
:
bool
=
False
):
warnings
.
filterwarnings
(
"
error
"
,
category
=
np
.
VisibleDeprecationWarning
)
is_ragged
=
False
try
:
if
isinstance
(
values
,
dict
):
...
...
@@ -23,7 +26,7 @@ def make_values_array(values, has_keys:bool=False):
vls
=
np
.
array
(
list
(
values
))
else
:
vls
=
np
.
array
([
values
])
except
ValueError
:
except
(
ValueError
,
np
.
VisibleDeprecationWarning
)
:
is_ragged
=
True
if
isinstance
(
values
,
dict
):
vls
=
np
.
array
(
list
(
values
.
values
()),
dtype
=
object
)
...
...
@@ -36,6 +39,8 @@ def make_values_array(values, has_keys:bool=False):
vls
=
np
.
array
(
list
(
values
),
dtype
=
object
)
else
:
vls
=
np
.
array
([
values
],
dtype
=
object
)
warnings
.
resetwarnings
()
return
vls
,
is_ragged
...
...
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