Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.io.base
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
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Show more breadcrumbs
bob
bob.io.base
Commits
fd7511d4
There was a problem fetching the pipeline summary.
Commit
fd7511d4
authored
8 years ago
by
André Anjos
Browse files
Options
Downloads
Plain Diff
Merge branch 'improved-testing' into 'master'
Improved testing See merge request
!10
parents
c36aecc1
11109ffd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!10
Improved testing
Pipeline
#
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.rst
+1
-1
1 addition, 1 deletion
README.rst
bob/io/base/test_hdf5.py
+27
-0
27 additions, 0 deletions
bob/io/base/test_hdf5.py
with
28 additions
and
1 deletion
README.rst
+
1
−
1
View file @
fd7511d4
...
...
@@ -4,7 +4,7 @@
.. image:: http://img.shields.io/badge/docs-stable-yellow.png
:target: http://pythonhosted.org/bob.io.base/index.html
.. image:: http://img.shields.io/badge/docs-latest-orange.png
:target: https://www.idiap.ch/software/bob/docs/latest/b
ioidiap
/bob.io.base/master/index.html
:target: https://www.idiap.ch/software/bob/docs/latest/b
ob
/bob.io.base/master/index.html
.. image:: https://gitlab.idiap.ch/bob/bob.io.base/badges/master/build.svg
:target: https://gitlab.idiap.ch/bob/bob.io.base/commits/master
.. image:: https://img.shields.io/badge/gitlab-project-0000c0.svg
...
...
This diff is collapsed.
Click to expand it.
bob/io/base/test_hdf5.py
+
27
−
0
View file @
fd7511d4
...
...
@@ -60,6 +60,18 @@ def read_write_array_check(outfile, dtype):
arrays
.
append
(
nparray
)
read_write_check
(
outfile
,
dtype
.
__name__
+
'
_array
'
,
arrays
)
def
read_write_subarray_check
(
outfile
,
dtype
):
N
=
10
SHAPE
=
(
2
,
3
,
4
,
2
)
#48 elements in arrays
arrays
=
[]
for
k
in
range
(
N
):
data
=
[
random
.
uniform
(
0
,
N
)
for
z
in
range
(
numpy
.
product
(
SHAPE
))]
nparray
=
numpy
.
array
(
data
,
dtype
=
dtype
).
reshape
(
SHAPE
)
usearray
=
nparray
[:,
1
,
1
:
2
,:]
assert
not
usearray
.
flags
.
contiguous
arrays
.
append
(
usearray
)
read_write_check
(
outfile
,
dtype
.
__name__
+
'
_subarray
'
,
arrays
)
def
test_can_create
():
# This test demonstrates how to create HDF5 files from scratch,
...
...
@@ -190,6 +202,21 @@ def test_type_support():
read_write_array_check
(
outfile
,
numpy
.
complex128
)
#read_write_array_check(outfile, numpy.complex256) #no numpy conversion
read_write_subarray_check
(
outfile
,
numpy
.
int8
)
read_write_subarray_check
(
outfile
,
numpy
.
int16
)
read_write_subarray_check
(
outfile
,
numpy
.
int32
)
read_write_subarray_check
(
outfile
,
numpy
.
int64
)
read_write_subarray_check
(
outfile
,
numpy
.
uint8
)
read_write_subarray_check
(
outfile
,
numpy
.
uint16
)
read_write_subarray_check
(
outfile
,
numpy
.
uint32
)
read_write_subarray_check
(
outfile
,
numpy
.
uint64
)
read_write_subarray_check
(
outfile
,
numpy
.
float32
)
read_write_subarray_check
(
outfile
,
numpy
.
float64
)
#read_write_subarray_check(outfile, numpy.float128) #no numpy conversion
read_write_subarray_check
(
outfile
,
numpy
.
complex64
)
read_write_subarray_check
(
outfile
,
numpy
.
complex128
)
#read_write_subarray_check(outfile, numpy.complex256) #no numpy conversion
finally
:
os
.
unlink
(
tmpname
)
...
...
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