Skip to content

Commit 02e5adc

Browse files
committed
Merge pull request #1 from CellProfiler/acquisition_date
Include latests commits
2 parents 1ee6f2f + 5e0fd6e commit 02e5adc

File tree

6 files changed

+101
-12
lines changed

6 files changed

+101
-12
lines changed

.coveragerc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[run]
2+
branch = True
3+
erase = True
4+
package = bioformats
5+
[report]
6+
exclude_lines =
7+
# Ignore continue statement in code as it can't be detected as covered
8+
# due to an optimization by the Python interpreter. See coverage issue
9+
# ( https://bitbucket.org/ned/coveragepy/issue/198/continue-marked-as-not-covered )
10+
# and Python issue ( http://bugs.python.org/issue2506 ).
11+
continue
12+
13+
# Ignore coverage of code that requires the module to be executed.
14+
if __name__ == .__main__.:
15+
omit =
16+
*/python?.?/*
17+
*/site-packages/*
18+
*tests/*

.travis.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
language: java
2+
env:
3+
- PYTHON_VERSION="2.7"
4+
before_install:
5+
# Get the tag if it wasn't provided. Travis doesn't provide this if it isn't a tagged build.
6+
- if [ -z $TRAVIS_TAG ]; then TRAVIS_TAG=`git tag --contains` ; fi
7+
- echo $TRAVIS_TAG
8+
# Move out of git directory to build root.
9+
- cd ../..
10+
- pwd
11+
install:
12+
# Download and configure conda.
13+
- wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
14+
- bash miniconda.sh -b -p $HOME/miniconda
15+
- export PATH="$HOME/miniconda/bin:$PATH"
16+
- conda config --set always_yes yes
17+
- conda config --set show_channel_urls True
18+
- source activate root
19+
# Install basic conda dependencies.
20+
- touch $HOME/miniconda/conda-meta/pinned
21+
- echo "conda-build ==1.16.0" >> $HOME/miniconda/conda-meta/pinned
22+
- conda update --all
23+
- conda install conda-build
24+
# Setup environment for testing and install all dependencies and our package.
25+
- cd $TRAVIS_REPO_SLUG
26+
- conda create --use-local -n testenv python=$PYTHON_VERSION
27+
- source activate testenv
28+
- conda install numpy
29+
- python setup.py install
30+
# Install sphinx to build documentation.
31+
- conda install sphinx
32+
# Install coverage and coveralls to generate and submit test coverage results for coveralls.io.
33+
- echo "coverage 3.*" >> $HOME/miniconda/envs/testenv/conda-meta/pinned
34+
- conda install nose
35+
- conda install coverage
36+
- pip install coveralls
37+
# Clean up downloads as there are quite a few and they waste space/memory.
38+
- conda clean -tipsy
39+
- rm -rfv $HOME/.cache/pip
40+
script:
41+
# Run tests.
42+
- python nosetests.py
43+
# Build docs.
44+
- cd docs
45+
- make html
46+
- cd ..
47+
#after_success:
48+
# Submit results to coveralls.io.
49+
#- coveralls
50+
# Use container format for TravisCI for quicker startup and builds.
51+
sudo: false

README.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
|Travis CI Status|
2+
3+
-----------------------------------------------------------------------------------------------------
4+
15
Python-bioformats is a Python wrapper for Bio-Formats, a standalone
26
Java library for reading and writing life sciences image file
37
formats. Bio-Formats is capable of parsing both pixels and metadata
@@ -20,3 +24,7 @@ python-bioformats is licensed under the GNU General Public License
2024
See the accompanying files COPYING and LICENSE for details.
2125

2226
Copyright (c) 2009-2014 Broad Institute. All rights reserved.
27+
28+
29+
.. |Travis CI Status| image:: https://travis-ci.org/CellProfiler/python-bioformats.svg?branch=master
30+
:target: https://travis-ci.org/CellProfiler/python-bioformats

bioformats/formatwriter.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ def write_image(pathname, pixels, pixel_type,
5959
6060
:param t: the image's `t` index
6161
62-
:param sizeC: # of channels in the stack
62+
:param size_c: # of channels in the stack
6363
64-
:param sizeZ: # of z stacks
64+
:param size_z: # of z stacks
6565
66-
:param sizeT: # of timepoints in the stack
66+
:param size_t: # of timepoints in the stack
6767
6868
:param channel_names: names of the channels (make up names if not present).
6969

bioformats/tests/test_omexml.py

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ def test_02_01_iter_children(self):
4646
def test_02_02_get_text(self):
4747
o = O.OMEXML(TIFF_XML)
4848
ad = o.root_node.find(
49-
"/".join([O.qn(o.get_ns('ome'), x) for x in ("Image", "AcquiredDate")]))
49+
"/".join([O.qn(o.get_ns('ome'), x) for x in ("Image", "AcquisitionDate")]))
5050
self.assertEqual(O.get_text(ad), "2008-02-05T17:24:46")
5151

5252
def test_02_04_set_text(self):
5353
o = O.OMEXML(TIFF_XML)
5454
ad = o.root_node.find("/".join(
55-
[O.qn(o.get_ns('ome'), x) for x in ("Image", "AcquiredDate")]))
55+
[O.qn(o.get_ns('ome'), x) for x in ("Image", "AcquisitionDate")]))
5656
im = o.root_node.find(O.qn(o.get_ns("ome"), "Image"))
5757
O.set_text(im, "Foo")
5858
self.assertEqual(O.get_text(im), "Foo")
@@ -99,14 +99,25 @@ def test_04_04_image_set_name(self):
9999
o.image(0).Name = "Foo"
100100
self.assertEquals(o.image(0).node.get("Name"), "Foo")
101101

102-
def test_04_05_image_get_acquired_date(self):
102+
def test_04_05_image_get_acquisition_date(self):
103103
o = O.OMEXML(TIFF_XML)
104-
self.assertEqual(o.image(0).AcquiredDate, "2008-02-05T17:24:46")
104+
self.assertEqual(o.image(0).AcquisitionDate, "2008-02-05T17:24:46")
105105

106-
def test_04_06_image_set_acquired_date(self):
106+
def test_04_06_image_set_acquisition_date(self):
107107
o = O.OMEXML(TIFF_XML)
108-
o.image(0).AcquiredDate = "2011-12-21T11:04:14.903000"
109-
self.assertEqual(o.image(0).AcquiredDate, "2011-12-21T11:04:14.903000")
108+
o.image(0).AcquisitionDate = "2011-12-21T11:04:14.903000"
109+
self.assertEqual(o.image(0).AcquisitionDate, "2011-12-21T11:04:14.903000")
110+
111+
def test_04_07_image_1_acquisition_date(self):
112+
# regression test of #38
113+
o = O.OMEXML()
114+
o.set_image_count(2)
115+
date_1 = "2011-12-21T11:04:14.903000"
116+
date_2 = "2015-10-13T09:57:00.000000"
117+
o.image(0).AcquisitionDate = date_1
118+
o.image(1).AcquisitionDate = date_2
119+
self.assertEqual(o.image(0).AcquisitionDate, date_1)
120+
self.assertEqual(o.image(1).AcquisitionDate, date_2)
110121

111122
def test_05_01_pixels_get_id(self):
112123
o = O.OMEXML(TIFF_XML)
@@ -736,7 +747,7 @@ def test_14_17_set_position_z(self):
736747
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
737748
xsi:schemaLocation="http://www.openmicroscopy.org/Schemas/OME/2013-06 http://www.openmicroscopy.org/Schemas/OME/2013-06/ome.xsd">
738749
<Image ID="Image:0" Name="Channel1-01-A-01.tif">
739-
<AcquiredDate>2008-02-05T17:24:46</AcquiredDate>
750+
<AcquisitionDate>2008-02-05T17:24:46</AcquisitionDate>
740751
<Pixels DimensionOrder="XYCZT" ID="Pixels:0" PhysicalSizeX="352.77777777777777"
741752
PhysicalSizeY="352.77777777777777" SizeC="2" SizeT="3" SizeX="640"
742753
SizeY="512" SizeZ="1" Type="uint8">

docs/index.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ Installation and testing
2323
Install using pip
2424
-----------------
2525

26-
pip install python-bioformats
26+
::
2727

28+
pip install python-bioformats
2829

2930
Running the unit tests
3031
----------------------

0 commit comments

Comments
 (0)