Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
beat.backend.python
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
beat
beat.backend.python
Commits
9b3faba3
Commit
9b3faba3
authored
Jun 18, 2020
by
Amir MOHAMMADI
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes a few warnings and depracations
parent
44b95672
Pipeline
#40554
passed with stage
in 8 minutes and 3 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
4 deletions
+6
-4
beat/backend/python/baseformat.py
beat/backend/python/baseformat.py
+2
-2
beat/backend/python/data.py
beat/backend/python/data.py
+2
-1
beat/backend/python/loader.py
beat/backend/python/loader.py
+2
-1
No files found.
beat/backend/python/baseformat.py
View file @
9b3faba3
...
@@ -358,8 +358,8 @@ def unpack_array(shape, dtype, fd):
...
@@ -358,8 +358,8 @@ def unpack_array(shape, dtype, fd):
# N.B.: this bit of code is optimized to reduce memory usage
# N.B.: this bit of code is optimized to reduce memory usage
data_format
=
ENDIANNESS
+
dtype
.
str
[
1
:]
data_format
=
ENDIANNESS
+
dtype
.
str
[
1
:]
count
=
numpy
.
prod
(
shape_
)
count
=
numpy
.
prod
(
shape_
)
to_read
=
numpy
.
asscalar
(
dtype
.
itemsize
*
count
)
to_read
=
int
(
dtype
.
itemsize
*
count
)
a
=
numpy
.
from
string
(
fd
.
read
(
to_read
),
dtype
=
data_format
,
count
=
count
)
a
=
numpy
.
from
buffer
(
fd
.
read
(
to_read
),
dtype
=
data_format
,
count
=
count
)
return
a
.
reshape
(
shape_
)
return
a
.
reshape
(
shape_
)
elif
issubclass
(
dtype
,
str
):
# it is a string
elif
issubclass
(
dtype
,
str
):
# it is a string
...
...
beat/backend/python/data.py
View file @
9b3faba3
...
@@ -411,7 +411,8 @@ class CachedDataSource(DataSource):
...
@@ -411,7 +411,8 @@ class CachedDataSource(DataSource):
# list of start/end indices to check that there are contiguous
# list of start/end indices to check that there are contiguous
indices
=
[]
indices
=
[]
for
f_data
,
f_chck
in
zip
(
data_filenames
,
checksum_filenames
):
for
f_data
,
f_chck
in
zip
(
data_filenames
,
checksum_filenames
):
expected_chksum
=
open
(
f_chck
,
"rt"
).
read
().
strip
()
with
open
(
f_chck
,
"rt"
)
as
f
:
expected_chksum
=
f
.
read
().
strip
()
current_chksum
=
hashFileContents
(
f_data
)
current_chksum
=
hashFileContents
(
f_data
)
if
expected_chksum
!=
current_chksum
:
if
expected_chksum
!=
current_chksum
:
raise
IOError
(
raise
IOError
(
...
...
beat/backend/python/loader.py
View file @
9b3faba3
...
@@ -82,7 +82,8 @@ def load_module(name, path, uses):
...
@@ -82,7 +82,8 @@ def load_module(name, path, uses):
retval
.
__dict__
[
k
]
=
load_module
(
k
,
v
[
'path'
],
v
[
'uses'
])
retval
.
__dict__
[
k
]
=
load_module
(
k
,
v
[
'path'
],
v
[
'uses'
])
# execute the module code on the context of previously import modules
# execute the module code on the context of previously import modules
exec
(
compile
(
open
(
path
,
"rb"
).
read
(),
path
,
'exec'
),
retval
.
__dict__
)
with
open
(
path
,
"rb"
)
as
f
:
exec
(
compile
(
f
.
read
(),
path
,
'exec'
),
retval
.
__dict__
)
return
retval
return
retval
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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