Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
parser-gulp
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
nomad-lab
parser-gulp
Commits
af67ba0f
Commit
af67ba0f
authored
8 years ago
by
Ask Hjorth Larsen
Browse files
Options
Downloads
Patches
Plain Diff
handle empty arrays correctly
parent
94757106
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
parser/parser-gulp/main.py
+5
-2
5 additions, 2 deletions
parser/parser-gulp/main.py
with
5 additions
and
2 deletions
parser/parser-gulp/main.py
+
5
−
2
View file @
af67ba0f
...
...
@@ -319,6 +319,7 @@ class GulpContext(object):
allgroups
.
append
(
thislinegroups
)
def
savearray
(
parser
):
print
(
'
SAVE
'
,
name
)
arr
=
np
.
array
(
allgroups
,
dtype
=
object
)
del
allgroups
[:]
if
name
in
self
.
data
:
...
...
@@ -330,8 +331,10 @@ class GulpContext(object):
pass
else
:
raise
ValueError
(
'
Unknown keyword %s
'
%
conflict
)
if
arr
.
size
>
0
:
self
.
data
[
name
]
=
arr
#if arr.size > 0:
if
arr
.
size
==
0
:
arr
.
shape
=
(
0
,
ngroups
)
self
.
data
[
name
]
=
arr
if
endmatcher
is
None
:
endmatcher
=
r
'
.*
'
...
...
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