From 1602991fac24cc126e7770eb8549d8dd1895ca42 Mon Sep 17 00:00:00 2001 From: John Evans Date: Thu, 8 Jan 2015 15:30:10 -0500 Subject: [PATCH 1/5] remove test requirement for six This requirement is problematic, as some versions cause problems with assertWarns and some do not. We are already filtering out versions that we know cause problems and it can unintentionally cause an upgrade superceding the system version if it remains as a "test_requires" option, so best to get rid of it. --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index 0a62827..1b1abbd 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,6 @@ kwargs = {'name': 'Glymur', 'test_suite': 'glymur.test'} install_requires = ['numpy>=1.7.0', 'lxml>=3.0.0'] -test_requires = ['six>=1.7.0'] if sys.hexversion < 0x03030000: install_requires.append('contextlib2>=0.4') test_requires.append('mock>=1.0.1') From 4a708b9d7daa62759be62dde575573682d5e38cc Mon Sep 17 00:00:00 2001 From: John Evans Date: Thu, 8 Jan 2015 15:41:30 -0500 Subject: [PATCH 2/5] doc modifications --- docs/source/how_do_i.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/source/how_do_i.rst b/docs/source/how_do_i.rst index 33366b5..88d94fa 100644 --- a/docs/source/how_do_i.rst +++ b/docs/source/how_do_i.rst @@ -26,10 +26,10 @@ It's pretty simple, just supply the image data as the 2nd argument to the Jp2k constructor. >>> import glymur, numpy as np - >>> data = np.zeros((640, 480), dtype=np.uint8) - >>> jp2 = glymur.Jp2k('zeros.jp2', data=data) + >>> jp2 = glymur.Jp2k('zeros.jp2', data=np.zeros((640, 480), dtype=np.uint8) -You should have OpenJPEG version 1.5 or more recent before writing JPEG 2000 images. +You must have OpenJPEG version 1.5 or more recent in order to write JPEG 2000 +images with glymur. ... display metadata? ===================== @@ -442,7 +442,7 @@ following 'Google' But that would be painful. A better solution is to install the Python XMP -Toolkit (make sure it is version 2.0):: +Toolkit (make sure it is at least version 2.0):: >>> from libxmp import XMPMeta >>> from libxmp.consts import XMP_NS_XMP as NS_XAP From a715e3c38cfb26f568363433c7c8f104d05dc6ba Mon Sep 17 00:00:00 2001 From: jevans Date: Thu, 8 Jan 2015 19:46:42 -0500 Subject: [PATCH 3/5] doctest needed a teardown fixture, pep8 work this was the real fix for #316, not sure why this did not show up when testing on linux mint --- glymur/test/test_jp2box.py | 7 ++++++- setup.py | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/glymur/test/test_jp2box.py b/glymur/test/test_jp2box.py index e43eae6..f9e7c5c 100644 --- a/glymur/test/test_jp2box.py +++ b/glymur/test/test_jp2box.py @@ -27,12 +27,17 @@ from .fixtures import (WARNING_INFRASTRUCTURE_ISSUE, WINDOWS_TMP_FILE_MSG, MetadataBase) +def docTearDown(doctest_obj): + glymur.set_parseoptions(full_codestream=False) + + def load_tests(loader, tests, ignore): """Run doc tests as well.""" if os.name == "nt": # Can't do it on windows, temporary file issue. return tests - tests.addTests(doctest.DocTestSuite('glymur.jp2box')) + tests.addTests(doctest.DocTestSuite('glymur.jp2box', + tearDown=docTearDown)) return tests diff --git a/setup.py b/setup.py index 1b1abbd..00566cd 100644 --- a/setup.py +++ b/setup.py @@ -21,6 +21,7 @@ kwargs = {'name': 'Glymur', 'test_suite': 'glymur.test'} install_requires = ['numpy>=1.7.0', 'lxml>=3.0.0'] +test_requires = [] if sys.hexversion < 0x03030000: install_requires.append('contextlib2>=0.4') test_requires.append('mock>=1.0.1') From 687f075d920a889b4d7f8c8e1f5df8ca01fe4cc6 Mon Sep 17 00:00:00 2001 From: jevans Date: Thu, 8 Jan 2015 20:23:54 -0500 Subject: [PATCH 4/5] doc mods, update for RC1 --- CHANGES.txt | 5 ++ docs/source/api.rst | 116 ----------------------------------- docs/source/conf.py | 4 +- docs/source/index.rst | 1 - docs/source/whatsnew/0.8.rst | 16 ++++- glymur/version.py | 2 +- 6 files changed, 22 insertions(+), 122 deletions(-) delete mode 100644 docs/source/api.rst diff --git a/CHANGES.txt b/CHANGES.txt index 758941b..98e6730 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,8 @@ +Jan 08, 2015 - v0.8.0rc1 Reduced number of steps required for + writing images. Deprecated old read and write methods in favor + of array-style slicing. Added ignore_pclr_cmap_cdef, verbose, + shape, codestream, layer properties. + Oct 06, 2014 - v0.7.2 Added ellipsis support in array-style slicing. Oct 02, 2014 - v0.7.1 Fixed README to mention Python 3.4 diff --git a/docs/source/api.rst b/docs/source/api.rst deleted file mode 100644 index 7584718..0000000 --- a/docs/source/api.rst +++ /dev/null @@ -1,116 +0,0 @@ ---- -API ---- - -Jp2k ----- -.. autoclass:: glymur.Jp2k - :members: read, write, wrap, read_bands, get_codestream - -Individual Boxes ----------------- -Jp2kbox -''''''' -.. autoclass:: glymur.jp2box.Jp2kBox - :members: - -AssociationBox -'''''''''''''' -.. autoclass:: glymur.jp2box.AssociationBox - :members: - -ColourSpecificationBox -'''''''''''''''''''''' -.. autoclass:: glymur.jp2box.ColourSpecificationBox - :members: - -ChannelDefinitionBox -'''''''''''''''''''''' -.. autoclass:: glymur.jp2box.ChannelDefinitionBox - :members: - -ComponentMappingBox -''''''''''''''''''' -.. autoclass:: glymur.jp2box.ComponentMappingBox - :members: - -ContiguousCodestreamBox -''''''''''''''''''''''' -.. autoclass:: glymur.jp2box.ContiguousCodestreamBox - :members: - -DataEntryURLBox -''''''''''''''' -.. autoclass:: glymur.jp2box.DataEntryURLBox - :members: - -FileTypeBox -''''''''''' -.. autoclass:: glymur.jp2box.FileTypeBox - :members: - -ImageHeaderBox -'''''''''''''' -.. autoclass:: glymur.jp2box.ImageHeaderBox - :members: - -JP2HeaderBox -'''''''''''' -.. autoclass:: glymur.jp2box.JP2HeaderBox - :members: - -JPEG2000SignatureBox -'''''''''''''''''''' -.. autoclass:: glymur.jp2box.JPEG2000SignatureBox - :members: - -LabelBox -'''''''' -.. autoclass:: glymur.jp2box.LabelBox - :members: - -PaletteBox -'''''''''' -.. autoclass:: glymur.jp2box.PaletteBox - :members: - -ReaderRequirementsBox -''''''''''''''''''''' -.. autoclass:: glymur.jp2box.ReaderRequirementsBox - :members: - -ResolutionBox -''''''''''''' -.. autoclass:: glymur.jp2box.ResolutionBox - :members: - -CaptureResolutionBox -'''''''''''''''''''' -.. autoclass:: glymur.jp2box.CaptureResolutionBox - :members: - -DisplayResolutionBox -'''''''''''''''''''' -.. autoclass:: glymur.jp2box.DisplayResolutionBox - :members: - -UUIDBox -''''''' -.. autoclass:: glymur.jp2box.UUIDBox - :members: - -UUIDInfoBox -''''''''''' -.. autoclass:: glymur.jp2box.UUIDInfoBox - :members: - -UUIDListBox -''''''''''' -.. autoclass:: glymur.jp2box.UUIDListBox - :members: - -XMLBox -'''''' -.. autoclass:: glymur.jp2box.XMLBox - :members: - diff --git a/docs/source/conf.py b/docs/source/conf.py index e9387f4..c786810 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -75,9 +75,9 @@ copyright = u'2013, John Evans' # built documents. # # The short X.Y version. -version = '0.7' +version = '0.8' # The full version, including alpha/beta/rc tags. -release = '0.7.2' +release = '0.8.0rc1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/source/index.rst b/docs/source/index.rst index 8c1fb03..62e118d 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -17,7 +17,6 @@ Contents: how_do_i whatsnew/index roadmap - api ------------------ Indices and tables diff --git a/docs/source/whatsnew/0.8.rst b/docs/source/whatsnew/0.8.rst index 5c87f5a..e7215ad 100644 --- a/docs/source/whatsnew/0.8.rst +++ b/docs/source/whatsnew/0.8.rst @@ -7,6 +7,18 @@ Changes in 0.8.0 * Simplified writing images by moving data and options into the constructor. - * The main_header attribute of the ContiguousCodestream class is now called - codestream. * Deprecated :py:meth:`read` method in favor of array-style slicing. + In order to retain certain functionality, the following parameters + to the :py:meth:`read` method have become top-level properties + + * verbose + * layer + * ignore_pclr_cmap_cdef + + * Two additional properties were introduced. + + * codestream + * shape + + + diff --git a/glymur/version.py b/glymur/version.py index 55e4b88..8958a5e 100644 --- a/glymur/version.py +++ b/glymur/version.py @@ -18,7 +18,7 @@ from .lib import openjpeg as opj, openjp2 as opj2 # Do not change the format of this next line! Doing so risks breaking # setup.py -version = "0.7.2" +version = "0.8.0rc1" _sv = LooseVersion(version) version_tuple = _sv.version From 6a8b89ae1c27dcc5806270dcc6a259c8634c0943 Mon Sep 17 00:00:00 2001 From: John Evans Date: Sat, 10 Jan 2015 10:06:25 -0500 Subject: [PATCH 5/5] remove test_requires, as setuptools doesn't seem to support it "mock" won't get installed in a virtualenv because of this --- setup.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 00566cd..b49ed69 100644 --- a/setup.py +++ b/setup.py @@ -21,12 +21,10 @@ kwargs = {'name': 'Glymur', 'test_suite': 'glymur.test'} install_requires = ['numpy>=1.7.0', 'lxml>=3.0.0'] -test_requires = [] if sys.hexversion < 0x03030000: install_requires.append('contextlib2>=0.4') - test_requires.append('mock>=1.0.1') + install_requires.append('mock>=1.0.1') kwargs['install_requires'] = install_requires -kwargs['test_requires'] = test_requires clssfrs = ["Programming Language :: Python", "Programming Language :: Python :: 2.7",