Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
zolfa-nd2reader
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lorenzo ZOLFANELLI
zolfa-nd2reader
Commits
d98e7acb
Commit
d98e7acb
authored
5 years ago
by
Ruben Verweij
Browse files
Options
Downloads
Patches
Plain Diff
Fixes issue #25, adds unit tests and release 3.2.1
parent
afa38ea0
No related branches found
No related tags found
No related merge requests found
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
docs
+1
-1
1 addition, 1 deletion
docs
nd2reader/__init__.py
+1
-1
1 addition, 1 deletion
nd2reader/__init__.py
setup.py
+1
-1
1 addition, 1 deletion
setup.py
sphinx/conf.py
+2
-2
2 additions, 2 deletions
sphinx/conf.py
tests/test_reader.py
+25
-0
25 additions, 0 deletions
tests/test_reader.py
with
30 additions
and
5 deletions
docs
@
f700c239
Compare
e8e0d21c
...
f700c239
Subproject commit
e8e0d21ccc8121fc30e1296a05dadb8aa9e22efa
Subproject commit
f700c239f8f9d7d1f99a3c10d9f67e2b3b8ef307
This diff is collapsed.
Click to expand it.
nd2reader/__init__.py
+
1
−
1
View file @
d98e7acb
from
nd2reader.reader
import
ND2Reader
from
nd2reader.legacy
import
Nd2
__version__
=
'
3.2.
0
'
__version__
=
'
3.2.
1
'
This diff is collapsed.
Click to expand it.
setup.py
+
1
−
1
View file @
d98e7acb
from
setuptools
import
setup
VERSION
=
'
3.2.
0
'
VERSION
=
'
3.2.
1
'
if
__name__
==
'
__main__
'
:
setup
(
...
...
This diff is collapsed.
Click to expand it.
sphinx/conf.py
+
2
−
2
View file @
d98e7acb
...
...
@@ -44,9 +44,9 @@ author = 'Ruben Verweij'
# built documents.
#
# The short X.Y version.
version
=
'
3.2.
0
'
version
=
'
3.2.
1
'
# The full version, including alpha/beta/rc tags.
release
=
'
3.2.
0
'
release
=
'
3.2.
1
'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
...
...
This diff is collapsed.
Click to expand it.
tests/test_reader.py
+
25
−
0
View file @
d98e7acb
import
unittest
import
numpy
as
np
import
struct
from
pims
import
Frame
from
nd2reader.artificial
import
ArtificialND2
from
nd2reader.exceptions
import
EmptyFileError
from
nd2reader.reader
import
ND2Reader
...
...
@@ -41,3 +43,26 @@ class TestReader(unittest.TestCase):
with
ND2Reader
(
'
test_data/test_nd2_reader.nd2
'
)
as
reader
:
timesteps
=
reader
.
timesteps
self
.
assertEquals
(
len
(
timesteps
),
0
)
def
test_get_frame_2D
(
self
):
# Best test we can do for now:
# test everything up to the actual unpacking of the frame data
with
ArtificialND2
(
'
test_data/test_nd2_reader.nd2
'
)
as
_
:
with
ND2Reader
(
'
test_data/test_nd2_reader.nd2
'
)
as
reader
:
with
self
.
assertRaises
(
struct
.
error
)
as
exception
:
frame
=
reader
.
get_frame_2D
(
c
=
0
,
t
=
0
,
z
=
0
,
x
=
0
,
y
=
0
,
v
=
0
)
self
.
assertEqual
(
str
(
exception
.
exception
),
"
unpack requires a buffer of 8 bytes
"
)
def
test_get_frame_vczyx
(
self
):
# Best test we can do for now:
# test everything up to the actual unpacking of the frame data
with
ArtificialND2
(
'
test_data/test_nd2_reader.nd2
'
)
as
_
:
with
ND2Reader
(
'
test_data/test_nd2_reader.nd2
'
)
as
reader
:
with
self
.
assertRaises
(
struct
.
error
)
as
exception
:
frame
=
reader
.
get_frame_vczyx
(
c
=
0
,
t
=
0
,
z
=
0
,
x
=
0
,
y
=
0
,
v
=
0
)
self
.
assertEqual
(
str
(
exception
.
exception
),
"
unpack requires a buffer of 8 bytes
"
)
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