Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
386ae339
Commit
386ae339
authored
Sep 21, 2015
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bigarray/tests: Factor-out generic read-only BigFile_Data
We'll need this class in tests in the next patch.
parent
acd73f63
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
bigarray/tests/test_basic.py
bigarray/tests/test_basic.py
+6
-5
No files found.
bigarray/tests/test_basic.py
View file @
386ae339
...
@@ -55,6 +55,12 @@ class BigFile_Data(BigFile):
...
@@ -55,6 +55,12 @@ class BigFile_Data(BigFile):
memcpy
(
self
.
datab
[
self
.
blksize
*
blk
:
self
.
blksize
*
(
blk
+
1
)],
buf
)
memcpy
(
self
.
datab
[
self
.
blksize
*
blk
:
self
.
blksize
*
(
blk
+
1
)],
buf
)
# synthetic bigfile that only loads data from numpy array
class
BigFile_Data_RO
(
BigFile_Data
):
def
storeblk
(
self
,
blk
,
buf
):
raise
RuntimeError
(
'tests should not try to change test data'
)
PS
=
2
*
1024
*
1024
# FIXME hardcoded, TODO -> ram.pagesize
PS
=
2
*
1024
*
1024
# FIXME hardcoded, TODO -> ram.pagesize
...
@@ -293,11 +299,6 @@ def test_bigarray_indexing_Nd():
...
@@ -293,11 +299,6 @@ def test_bigarray_indexing_Nd():
# (else data slice will be smaller than buf)
# (else data slice will be smaller than buf)
data
=
arange
(
mul
(
shape
)
+
PS
,
dtype
=
uint32
)
data
=
arange
(
mul
(
shape
)
+
PS
,
dtype
=
uint32
)
# synthetic bigfile that only loads data from numpy array
class
BigFile_Data_RO
(
BigFile_Data
):
def
storeblk
(
self
,
blk
,
buf
):
raise
RuntimeError
(
'tests should not try to change test data'
)
f
=
BigFile_Data_RO
(
data
,
PS
)
f
=
BigFile_Data_RO
(
data
,
PS
)
fh
=
f
.
fileh_open
()
fh
=
f
.
fileh_open
()
...
...
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