Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gridData.tests.test_ccp4.test_ccp4 test fails on big-endian arches #50

Closed
rathann opened this issue Jul 28, 2018 · 15 comments
Closed

gridData.tests.test_ccp4.test_ccp4 test fails on big-endian arches #50

rathann opened this issue Jul 28, 2018 · 15 comments
Labels
defect format-MRC MRC/CCP4 file format
Milestone

Comments

@rathann
Copy link
Contributor

rathann commented Jul 28, 2018

When running under Fedora rawhide on a big-endian machine (ppc64, s390x), test_ccp4 fails:

cd GridDataFormats-0.4.0
/usr/bin/python2 setup.py nosetests
running nosetests
running egg_info
writing requirements to GridDataFormats.egg-info/requires.txt
writing GridDataFormats.egg-info/PKG-INFO
writing top-level names to GridDataFormats.egg-info/top_level.txt
writing dependency_links to GridDataFormats.egg-info/dependency_links.txt
reading manifest file 'GridDataFormats.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'README'
writing manifest file 'GridDataFormats.egg-info/SOURCES.txt'
/builddir/build/BUILD/GridDataFormats-0.4.0/gridData/CCP4.py:274: UserWarning: Key mode: Illegal value 33554432
  "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
/builddir/build/BUILD/GridDataFormats-0.4.0/gridData/CCP4.py:274: UserWarning: Key mapc: Illegal value 16777216
  "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
/builddir/build/BUILD/GridDataFormats-0.4.0/gridData/CCP4.py:274: UserWarning: Key mapr: Illegal value 33554432
  "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
/builddir/build/BUILD/GridDataFormats-0.4.0/gridData/CCP4.py:274: UserWarning: Key maps: Illegal value 50331648
  "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
E............/builddir/build/BUILD/GridDataFormats-0.4.0/gridData/OpenDX.py:339: UserWarning: array dtype.name = float128 can not be automatically converted to a DX array type. Use the 'type' keyword to manually specify the correct type.
  self.array.dtype.name))
.............S..
======================================================================
ERROR: gridData.tests.test_ccp4.test_ccp4
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/builddir/build/BUILD/GridDataFormats-0.4.0/gridData/tests/test_ccp4.py", line 9, in test_ccp4
    g = Grid('gridData/tests/test.ccp4')
  File "/builddir/build/BUILD/GridDataFormats-0.4.0/gridData/core.py", line 117, in __init__
    self.load(grid)
  File "/builddir/build/BUILD/GridDataFormats-0.4.0/gridData/core.py", line 302, in load
    loader(filename)
  File "/builddir/build/BUILD/GridDataFormats-0.4.0/gridData/core.py", line 314, in _load_cpp4
    ccp4.read(filename)
  File "/builddir/build/BUILD/GridDataFormats-0.4.0/gridData/CCP4.py", line 204, in read
    h = self.header = self._read_header(ccp4)
  File "/builddir/build/BUILD/GridDataFormats-0.4.0/gridData/CCP4.py", line 295, in _read_header
    label = struct.unpack(flag, binlabel)[0]
error: unpack requires a string argument of length 1342177280
----------------------------------------------------------------------
Ran 29 tests in 0.558s
FAILED (SKIP=1, errors=1)

python version is Python 2.7.15.

orbeckst added a commit that referenced this issue Aug 15, 2018
- should help with debugging #50
- added test that checks that the test ccp4 file byteorder is properly detected
orbeckst added a commit that referenced this issue Aug 15, 2018
- should help with debugging #50
- added test that checks that the test ccp4 file byteorder is properly detected
orbeckst added a commit that referenced this issue Aug 16, 2018
- should help with debugging #50
- added test that checks that the test ccp4 file byteorder is properly detected
orbeckst added a commit that referenced this issue Aug 16, 2018
- should help with debugging #50
- added test that checks that the test ccp4 file byteorder is properly detected
@rathann
Copy link
Contributor Author

rathann commented Aug 17, 2018

Unfortunately it's still failing on big-endian. Ignore that it says 0.4.0, I patched it with code (c777d4e) from the ccp4-endianness branch.

+ cd GridDataFormats-0.4.0
+ pytest-2 -v ./gridData/tests
============================= test session starts ==============================
platform linux2 -- Python 2.7.15, pytest-3.6.3, py-1.5.4, pluggy-0.6.0 -- /usr/bin/python2
cachedir: .pytest_cache
rootdir: /builddir/build/BUILD/GridDataFormats-0.4.0, inifile:
collecting ... collected 35 items
gridData/tests/test_ccp4.py::test_ccp4 FAILED                            [  2%]
gridData/tests/test_ccp4.py::test_byteorder PASSED                       [  5%]
gridData/tests/test_dx.py::test_read_dx PASSED                           [  8%]
gridData/tests/test_dx.py::test_write_dx[float16-float] PASSED           [ 11%]
gridData/tests/test_dx.py::test_write_dx[float32-float] PASSED           [ 14%]
gridData/tests/test_dx.py::test_write_dx[float64-double] PASSED          [ 17%]
gridData/tests/test_dx.py::test_write_dx[int64-int] PASSED               [ 20%]
gridData/tests/test_dx.py::test_write_dx[int32-int] PASSED               [ 22%]
gridData/tests/test_dx.py::test_write_dx[uint32-unsigned int] PASSED     [ 25%]
gridData/tests/test_dx.py::test_write_dx[uint64-unsigned int] PASSED     [ 28%]
gridData/tests/test_dx.py::test_write_dx[int16-short] PASSED             [ 31%]
gridData/tests/test_dx.py::test_write_dx[uint16-unsigned short] PASSED   [ 34%]
gridData/tests/test_dx.py::test_write_dx[int8-signed byte] PASSED        [ 37%]
gridData/tests/test_dx.py::test_write_dx[uint8-byte] PASSED              [ 40%]
gridData/tests/test_dx.py::test_write_dx_ValueError[complex64] PASSED    [ 42%]
gridData/tests/test_dx.py::test_write_dx_ValueError[complex128] PASSED   [ 45%]
gridData/tests/test_dx.py::test_write_dx_ValueError[bool_] PASSED        [ 48%]
gridData/tests/test_gOpenMol.py::test_gOpenMol PASSED                    [ 51%]
gridData/tests/test_grid.py::TestGrid::test_init PASSED                  [ 54%]
gridData/tests/test_grid.py::TestGrid::test_init_wrong_origin PASSED     [ 57%]
gridData/tests/test_grid.py::TestGrid::test_init_wrong_delta PASSED      [ 60%]
gridData/tests/test_grid.py::TestGrid::test_equality PASSED              [ 62%]
gridData/tests/test_grid.py::TestGrid::test_addition PASSED              [ 65%]
gridData/tests/test_grid.py::TestGrid::test_substraction PASSED          [ 68%]
gridData/tests/test_grid.py::TestGrid::test_multiplication PASSED        [ 71%]
gridData/tests/test_grid.py::TestGrid::test_division PASSED              [ 74%]
gridData/tests/test_grid.py::TestGrid::test_classic_division PASSED      [ 77%]
gridData/tests/test_grid.py::TestGrid::test_classic_division_NotImplementedError SKIPPED [ 80%]
gridData/tests/test_grid.py::TestGrid::test_floordivision PASSED         [ 82%]
gridData/tests/test_grid.py::TestGrid::test_power PASSED                 [ 85%]
gridData/tests/test_grid.py::TestGrid::test_compatibility_type PASSED    [ 88%]
gridData/tests/test_grid.py::TestGrid::test_wrong_compatibile_type PASSED [ 91%]
gridData/tests/test_grid.py::TestGrid::test_non_orthonormal_boxes PASSED [ 94%]
gridData/tests/test_grid.py::TestGrid::test_centers PASSED               [ 97%]
gridData/tests/test_grid.py::TestGrid::test_resample_factor PASSED       [100%]
=================================== FAILURES ===================================
__________________________________ test_ccp4 ___________________________________
    def test_ccp4():
>       g = Grid(datafiles.CCP4)
gridData/tests/test_ccp4.py:12: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
gridData/core.py:126: in __init__
    self.load(grid)
gridData/core.py:378: in load
    loader(filename)
gridData/core.py:390: in _load_cpp4
    ccp4.read(filename)
gridData/CCP4.py:204: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <gridData.CCP4.CCP4 object at 0x3ff909de748>
ccp4file = <closed file '/builddir/build/BUILD/GridDataFormats-0.4.0/gridData/tests/datafiles/test.ccp4', mode 'rb' at 0x3ff909fe390>
    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           error: unpack requires a string argument of length 1342177280
gridData/CCP4.py:308: error
=============================== warnings summary ===============================
gridData/tests/test_ccp4.py::test_ccp4
  /builddir/build/BUILD/GridDataFormats-0.4.0/gridData/CCP4.py:287: UserWarning: Key mode: Illegal value 33554432
    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
  /builddir/build/BUILD/GridDataFormats-0.4.0/gridData/CCP4.py:287: UserWarning: Key mapc: Illegal value 16777216
    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
  /builddir/build/BUILD/GridDataFormats-0.4.0/gridData/CCP4.py:287: UserWarning: Key mapr: Illegal value 33554432
    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
  /builddir/build/BUILD/GridDataFormats-0.4.0/gridData/CCP4.py:287: UserWarning: Key maps: Illegal value 50331648
    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
-- Docs: http://doc.pytest.org/en/latest/warnings.html
========== 1 failed, 33 passed, 1 skipped, 4 warnings in 0.30 seconds ==========

@orbeckst
Copy link
Member

To be honest, I didn't expect this patch to fix anything. I wanted to get a bit more fine-grained control.

In particular,

gridData/tests/test_ccp4.py::test_byteorder PASSED

so unless I wrote my test wrong,

assert flag in ("@", "=", "<"), "flag {} is not '<'".format(flag)

it looks as if we at least correctly detect the endianness of the data file.

@orbeckst
Copy link
Member

Next things todo:

  • "# TODO: Compare file specified endianness to one obtained above."
  • check that header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0] is doing the right thing

orbeckst added a commit that referenced this issue Apr 6, 2019
- should help with debugging #50
- added test that checks that the test ccp4 file byteorder is properly detected
@rathann
Copy link
Contributor Author

rathann commented Sep 14, 2019

I guess there hasn't been any progress here. 0.5.0 is failing as follows:

============================= test session starts ==============================
platform linux -- Python 3.6.8, pytest-3.4.2, py-1.5.4, pluggy-0.6.0 -- /usr/bin/python3
cachedir: ../BUILD/GridDataFormats-0.5.0/.pytest_cache
rootdir: /builddir/build/BUILD/GridDataFormats-0.5.0, inifile:
plugins: xdist-1.22.0, forked-0.2
collecting ... collected 87 items

../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py::test_ccp4 ERROR [  1%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py::test_ccp4_read_header[nc-96] ERROR [  2%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py::test_ccp4_read_header[nr-76] ERROR [  3%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py::test_ccp4_read_header[ns-70] ERROR [  4%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py::test_ccp4_read_header[mode-2] ERROR [  5%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py::test_ccp4_read_header[ncstart--4] ERROR [  6%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py::test_ccp4_read_header[nrstart--23] ERROR [  8%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py::test_ccp4_read_header[nsstart-102] ERROR [  9%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py::test_ccp4_read_header[nx-84] ERROR [ 10%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py::test_ccp4_read_header[ny-84] ERROR [ 11%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py::test_ccp4_read_header[nz-160] ERROR [ 12%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py::test_ccp4_read_header[xlen-45.79999923706055] ERROR [ 13%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py::test_ccp4_read_header[ylen-45.79999923706055] ERROR [ 14%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py::test_ccp4_read_header[zlen-89.6500015258789] ERROR [ 16%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py::test_ccp4_read_header[alpha-90.0] ERROR [ 17%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py::test_ccp4_read_header[beta-90.0] ERROR [ 18%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py::test_ccp4_read_header[gamma-90.0] ERROR [ 19%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py::test_ccp4_read_header[mapc-2] ERROR [ 20%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py::test_ccp4_read_header[mapr-1] ERROR [ 21%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py::test_ccp4_read_header[maps-3] ERROR [ 22%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py::test_ccp4_read_header[amin--0.9930942058563232] ERROR [ 24%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py::test_ccp4_read_header[amax-9.050403594970703] ERROR [ 25%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py::test_ccp4_read_header[amean--0.0005801090155728161] ERROR [ 26%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py::test_ccp4_read_header[ispg-92] ERROR [ 27%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py::test_ccp4_read_header[nsymbt-640] ERROR [ 28%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py::test_ccp4_read_header[lskflg-0] ERROR [ 29%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py::test_ccp4_read_header[bsaflag-@] ERROR [ 31%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py::test_ccp4_read_header[skwmat-None] ERROR [ 32%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py::test_ccp4_read_header[skwtrn-None] ERROR [ 33%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py::test_ccp4_read_header[endianness-little] ERROR [ 34%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py::test_ccp4_read_header[arms-0.4034915268421173] ERROR [ 35%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py::test_ccp4_read_header[nlabl-1] ERROR [ 36%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py::test_ccp4_read_header[label- Map from fft                                                                   ] ERROR [ 37%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py::test_byteorder PASSED [ 39%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_dx.py::test_read_dx PASSED [ 40%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_dx.py::test_write_dx[float16-float] PASSED [ 41%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_dx.py::test_write_dx[float32-float] PASSED [ 42%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_dx.py::test_write_dx[float64-double] PASSED [ 43%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_dx.py::test_write_dx[int64-int] PASSED [ 44%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_dx.py::test_write_dx[int32-int] PASSED [ 45%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_dx.py::test_write_dx[uint32-unsigned int] PASSED [ 47%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_dx.py::test_write_dx[uint64-unsigned int] PASSED [ 48%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_dx.py::test_write_dx[int16-short] PASSED [ 49%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_dx.py::test_write_dx[uint16-unsigned short] PASSED [ 50%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_dx.py::test_write_dx[int8-signed byte] PASSED [ 51%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_dx.py::test_write_dx[uint8-byte] PASSED [ 52%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_dx.py::test_write_dx_ValueError[complex64] PASSED [ 54%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_dx.py::test_write_dx_ValueError[complex128] PASSED [ 55%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_dx.py::test_write_dx_ValueError[bool_] PASSED [ 56%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_gOpenMol.py::test_gOpenMol PASSED [ 57%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_grid.py::TestGrid::test_init PASSED [ 58%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_grid.py::TestGrid::test_init_wrong_origin PASSED [ 59%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_grid.py::TestGrid::test_init_wrong_delta PASSED [ 60%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_grid.py::TestGrid::test_empty_Grid PASSED [ 62%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_grid.py::TestGrid::test_init_missing_delta_ValueError PASSED [ 63%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_grid.py::TestGrid::test_init_missing_origin_ValueError PASSED [ 64%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_grid.py::TestGrid::test_init_wrong_data_exception PASSED [ 65%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_grid.py::TestGrid::test_load_wrong_fileformat_ValueError PASSED [ 66%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_grid.py::TestGrid::test_equality PASSED [ 67%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_grid.py::TestGrid::test_addition PASSED [ 68%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_grid.py::TestGrid::test_subtraction PASSED [ 70%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_grid.py::TestGrid::test_multiplication PASSED [ 71%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_grid.py::TestGrid::test_division PASSED [ 72%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_grid.py::TestGrid::test_classic_division SKIPPED [ 73%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_grid.py::TestGrid::test_classic_division_NotImplementedError PASSED [ 74%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_grid.py::TestGrid::test_floordivision PASSED [ 75%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_grid.py::TestGrid::test_power PASSED [ 77%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_grid.py::TestGrid::test_compatibility_type PASSED [ 78%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_grid.py::TestGrid::test_wrong_compatibile_type PASSED [ 79%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_grid.py::TestGrid::test_non_orthonormal_boxes PASSED [ 80%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_grid.py::TestGrid::test_centers PASSED [ 81%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_grid.py::TestGrid::test_resample_factor PASSED [ 82%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_grid.py::TestGrid::test_load_pickle PASSED [ 83%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_grid.py::TestGrid::test_init_pickle_pathobjects PASSED [ 85%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_grid.py::TestGrid::test_load_fileformat[pkl] PASSED [ 86%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_grid.py::TestGrid::test_load_fileformat[PKL] PASSED [ 87%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_grid.py::TestGrid::test_load_fileformat[pickle] PASSED [ 88%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_grid.py::TestGrid::test_load_fileformat[python] PASSED [ 89%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_grid.py::TestGrid::test_load_wrong_fileformat[ccp4] xfail [ 90%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_grid.py::TestGrid::test_load_wrong_fileformat[plt] xfail [ 91%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_grid.py::TestGrid::test_load_wrong_fileformat[dx] xfail [ 93%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_grid.py::TestGrid::test_export[dx] PASSED [ 94%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_grid.py::TestGrid::test_export[pkl] PASSED [ 95%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_grid.py::TestGrid::test_export_not_supported[ccp4] PASSED [ 96%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_grid.py::TestGrid::test_export_not_supported[plt] PASSED [ 97%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_grid.py::test_inheritance PASSED [ 98%]
../BUILD/GridDataFormats-0.5.0/gridData/tests/test_grid.py::test_anyarray PASSED [100%]

==================================== ERRORS ====================================
_________________________ ERROR at setup of test_ccp4 __________________________

    @pytest.fixture(scope="module")
    def g():
>       return Grid(datafiles.CCP4)

../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py:15: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../BUILD/GridDataFormats-0.5.0/gridData/core.py:158: in __init__
    self.load(filename, file_format=file_format)
../BUILD/GridDataFormats-0.5.0/gridData/core.py:419: in load
    loader(filename)
../BUILD/GridDataFormats-0.5.0/gridData/core.py:431: in _load_cpp4
    ccp4.read(filename)
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:204: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <gridData.CCP4.CCP4 object at 0x7fff948399b0>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.5.0/gridData/tests/datafiles/test.ccp4'>

    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes

../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:308: error
________________ ERROR at setup of test_ccp4_read_header[nc-96] ________________

    @pytest.fixture(scope="module")
    def ccp4data():
>       return CCP4.CCP4(datafiles.CCP4_1JZV)

../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py:27: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:197: in __init__
    self.read(filename)
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:204: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <gridData.CCP4.CCP4 object at 0x7fff947944a8>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.5.0/gridData/tests/datafiles/1jzv.ccp4'>

    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes

../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:308: error
________________ ERROR at setup of test_ccp4_read_header[nr-76] ________________

    @pytest.fixture(scope="module")
    def ccp4data():
>       return CCP4.CCP4(datafiles.CCP4_1JZV)

../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py:27: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:197: in __init__
    self.read(filename)
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:204: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <gridData.CCP4.CCP4 object at 0x7fff947944a8>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.5.0/gridData/tests/datafiles/1jzv.ccp4'>

    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes

../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:308: error
________________ ERROR at setup of test_ccp4_read_header[ns-70] ________________

    @pytest.fixture(scope="module")
    def ccp4data():
>       return CCP4.CCP4(datafiles.CCP4_1JZV)

../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py:27: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:197: in __init__
    self.read(filename)
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:204: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <gridData.CCP4.CCP4 object at 0x7fff947944a8>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.5.0/gridData/tests/datafiles/1jzv.ccp4'>

    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes

../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:308: error
_______________ ERROR at setup of test_ccp4_read_header[mode-2] ________________

    @pytest.fixture(scope="module")
    def ccp4data():
>       return CCP4.CCP4(datafiles.CCP4_1JZV)

../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py:27: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:197: in __init__
    self.read(filename)
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:204: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <gridData.CCP4.CCP4 object at 0x7fff947944a8>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.5.0/gridData/tests/datafiles/1jzv.ccp4'>

    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes

../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:308: error
_____________ ERROR at setup of test_ccp4_read_header[ncstart--4] ______________

    @pytest.fixture(scope="module")
    def ccp4data():
>       return CCP4.CCP4(datafiles.CCP4_1JZV)

../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py:27: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:197: in __init__
    self.read(filename)
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:204: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <gridData.CCP4.CCP4 object at 0x7fff947944a8>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.5.0/gridData/tests/datafiles/1jzv.ccp4'>

    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes

../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:308: error
_____________ ERROR at setup of test_ccp4_read_header[nrstart--23] _____________

    @pytest.fixture(scope="module")
    def ccp4data():
>       return CCP4.CCP4(datafiles.CCP4_1JZV)

../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py:27: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:197: in __init__
    self.read(filename)
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:204: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <gridData.CCP4.CCP4 object at 0x7fff947944a8>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.5.0/gridData/tests/datafiles/1jzv.ccp4'>

    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes

../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:308: error
_____________ ERROR at setup of test_ccp4_read_header[nsstart-102] _____________

    @pytest.fixture(scope="module")
    def ccp4data():
>       return CCP4.CCP4(datafiles.CCP4_1JZV)

../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py:27: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:197: in __init__
    self.read(filename)
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:204: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <gridData.CCP4.CCP4 object at 0x7fff947944a8>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.5.0/gridData/tests/datafiles/1jzv.ccp4'>

    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes

../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:308: error
________________ ERROR at setup of test_ccp4_read_header[nx-84] ________________

    @pytest.fixture(scope="module")
    def ccp4data():
>       return CCP4.CCP4(datafiles.CCP4_1JZV)

../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py:27: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:197: in __init__
    self.read(filename)
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:204: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <gridData.CCP4.CCP4 object at 0x7fff947944a8>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.5.0/gridData/tests/datafiles/1jzv.ccp4'>

    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes

../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:308: error
________________ ERROR at setup of test_ccp4_read_header[ny-84] ________________

    @pytest.fixture(scope="module")
    def ccp4data():
>       return CCP4.CCP4(datafiles.CCP4_1JZV)

../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py:27: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:197: in __init__
    self.read(filename)
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:204: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <gridData.CCP4.CCP4 object at 0x7fff947944a8>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.5.0/gridData/tests/datafiles/1jzv.ccp4'>

    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes

../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:308: error
_______________ ERROR at setup of test_ccp4_read_header[nz-160] ________________

    @pytest.fixture(scope="module")
    def ccp4data():
>       return CCP4.CCP4(datafiles.CCP4_1JZV)

../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py:27: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:197: in __init__
    self.read(filename)
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:204: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <gridData.CCP4.CCP4 object at 0x7fff947944a8>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.5.0/gridData/tests/datafiles/1jzv.ccp4'>

    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes

../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:308: error
_______ ERROR at setup of test_ccp4_read_header[xlen-45.79999923706055] ________

    @pytest.fixture(scope="module")
    def ccp4data():
>       return CCP4.CCP4(datafiles.CCP4_1JZV)

../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py:27: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:197: in __init__
    self.read(filename)
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:204: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <gridData.CCP4.CCP4 object at 0x7fff947944a8>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.5.0/gridData/tests/datafiles/1jzv.ccp4'>

    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes

../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:308: error
_______ ERROR at setup of test_ccp4_read_header[ylen-45.79999923706055] ________

    @pytest.fixture(scope="module")
    def ccp4data():
>       return CCP4.CCP4(datafiles.CCP4_1JZV)

../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py:27: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:197: in __init__
    self.read(filename)
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:204: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <gridData.CCP4.CCP4 object at 0x7fff947944a8>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.5.0/gridData/tests/datafiles/1jzv.ccp4'>

    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes

../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:308: error
________ ERROR at setup of test_ccp4_read_header[zlen-89.6500015258789] ________

    @pytest.fixture(scope="module")
    def ccp4data():
>       return CCP4.CCP4(datafiles.CCP4_1JZV)

../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py:27: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:197: in __init__
    self.read(filename)
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:204: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <gridData.CCP4.CCP4 object at 0x7fff947944a8>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.5.0/gridData/tests/datafiles/1jzv.ccp4'>

    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes

../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:308: error
_____________ ERROR at setup of test_ccp4_read_header[alpha-90.0] ______________

    @pytest.fixture(scope="module")
    def ccp4data():
>       return CCP4.CCP4(datafiles.CCP4_1JZV)

../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py:27: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:197: in __init__
    self.read(filename)
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:204: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <gridData.CCP4.CCP4 object at 0x7fff947944a8>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.5.0/gridData/tests/datafiles/1jzv.ccp4'>

    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes

../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:308: error
______________ ERROR at setup of test_ccp4_read_header[beta-90.0] ______________

    @pytest.fixture(scope="module")
    def ccp4data():
>       return CCP4.CCP4(datafiles.CCP4_1JZV)

../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py:27: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:197: in __init__
    self.read(filename)
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:204: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <gridData.CCP4.CCP4 object at 0x7fff947944a8>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.5.0/gridData/tests/datafiles/1jzv.ccp4'>

    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes

../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:308: error
_____________ ERROR at setup of test_ccp4_read_header[gamma-90.0] ______________

    @pytest.fixture(scope="module")
    def ccp4data():
>       return CCP4.CCP4(datafiles.CCP4_1JZV)

../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py:27: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:197: in __init__
    self.read(filename)
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:204: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <gridData.CCP4.CCP4 object at 0x7fff947944a8>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.5.0/gridData/tests/datafiles/1jzv.ccp4'>

    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes

../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:308: error
_______________ ERROR at setup of test_ccp4_read_header[mapc-2] ________________

    @pytest.fixture(scope="module")
    def ccp4data():
>       return CCP4.CCP4(datafiles.CCP4_1JZV)

../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py:27: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:197: in __init__
    self.read(filename)
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:204: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <gridData.CCP4.CCP4 object at 0x7fff947944a8>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.5.0/gridData/tests/datafiles/1jzv.ccp4'>

    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes

../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:308: error
_______________ ERROR at setup of test_ccp4_read_header[mapr-1] ________________

    @pytest.fixture(scope="module")
    def ccp4data():
>       return CCP4.CCP4(datafiles.CCP4_1JZV)

../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py:27: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:197: in __init__
    self.read(filename)
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:204: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <gridData.CCP4.CCP4 object at 0x7fff947944a8>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.5.0/gridData/tests/datafiles/1jzv.ccp4'>

    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes

../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:308: error
_______________ ERROR at setup of test_ccp4_read_header[maps-3] ________________

    @pytest.fixture(scope="module")
    def ccp4data():
>       return CCP4.CCP4(datafiles.CCP4_1JZV)

../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py:27: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:197: in __init__
    self.read(filename)
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:204: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <gridData.CCP4.CCP4 object at 0x7fff947944a8>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.5.0/gridData/tests/datafiles/1jzv.ccp4'>

    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes

../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:308: error
______ ERROR at setup of test_ccp4_read_header[amin--0.9930942058563232] _______

    @pytest.fixture(scope="module")
    def ccp4data():
>       return CCP4.CCP4(datafiles.CCP4_1JZV)

../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py:27: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:197: in __init__
    self.read(filename)
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:204: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <gridData.CCP4.CCP4 object at 0x7fff947944a8>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.5.0/gridData/tests/datafiles/1jzv.ccp4'>

    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes

../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:308: error
_______ ERROR at setup of test_ccp4_read_header[amax-9.050403594970703] ________

    @pytest.fixture(scope="module")
    def ccp4data():
>       return CCP4.CCP4(datafiles.CCP4_1JZV)

../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py:27: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:197: in __init__
    self.read(filename)
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:204: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <gridData.CCP4.CCP4 object at 0x7fff947944a8>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.5.0/gridData/tests/datafiles/1jzv.ccp4'>

    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes

../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:308: error
____ ERROR at setup of test_ccp4_read_header[amean--0.0005801090155728161] _____

    @pytest.fixture(scope="module")
    def ccp4data():
>       return CCP4.CCP4(datafiles.CCP4_1JZV)

../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py:27: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:197: in __init__
    self.read(filename)
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:204: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <gridData.CCP4.CCP4 object at 0x7fff947944a8>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.5.0/gridData/tests/datafiles/1jzv.ccp4'>

    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes

../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:308: error
_______________ ERROR at setup of test_ccp4_read_header[ispg-92] _______________

    @pytest.fixture(scope="module")
    def ccp4data():
>       return CCP4.CCP4(datafiles.CCP4_1JZV)

../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py:27: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:197: in __init__
    self.read(filename)
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:204: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <gridData.CCP4.CCP4 object at 0x7fff947944a8>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.5.0/gridData/tests/datafiles/1jzv.ccp4'>

    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes

../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:308: error
_____________ ERROR at setup of test_ccp4_read_header[nsymbt-640] ______________

    @pytest.fixture(scope="module")
    def ccp4data():
>       return CCP4.CCP4(datafiles.CCP4_1JZV)

../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py:27: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:197: in __init__
    self.read(filename)
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:204: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <gridData.CCP4.CCP4 object at 0x7fff947944a8>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.5.0/gridData/tests/datafiles/1jzv.ccp4'>

    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes

../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:308: error
______________ ERROR at setup of test_ccp4_read_header[lskflg-0] _______________

    @pytest.fixture(scope="module")
    def ccp4data():
>       return CCP4.CCP4(datafiles.CCP4_1JZV)

../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py:27: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:197: in __init__
    self.read(filename)
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:204: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <gridData.CCP4.CCP4 object at 0x7fff947944a8>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.5.0/gridData/tests/datafiles/1jzv.ccp4'>

    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes

../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:308: error
______________ ERROR at setup of test_ccp4_read_header[bsaflag-@] ______________

    @pytest.fixture(scope="module")
    def ccp4data():
>       return CCP4.CCP4(datafiles.CCP4_1JZV)

../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py:27: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:197: in __init__
    self.read(filename)
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:204: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <gridData.CCP4.CCP4 object at 0x7fff947944a8>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.5.0/gridData/tests/datafiles/1jzv.ccp4'>

    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes

../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:308: error
_____________ ERROR at setup of test_ccp4_read_header[skwmat-None] _____________

    @pytest.fixture(scope="module")
    def ccp4data():
>       return CCP4.CCP4(datafiles.CCP4_1JZV)

../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py:27: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:197: in __init__
    self.read(filename)
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:204: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <gridData.CCP4.CCP4 object at 0x7fff947944a8>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.5.0/gridData/tests/datafiles/1jzv.ccp4'>

    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes

../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:308: error
_____________ ERROR at setup of test_ccp4_read_header[skwtrn-None] _____________

    @pytest.fixture(scope="module")
    def ccp4data():
>       return CCP4.CCP4(datafiles.CCP4_1JZV)

../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py:27: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:197: in __init__
    self.read(filename)
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:204: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <gridData.CCP4.CCP4 object at 0x7fff947944a8>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.5.0/gridData/tests/datafiles/1jzv.ccp4'>

    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes

../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:308: error
__________ ERROR at setup of test_ccp4_read_header[endianness-little] __________

    @pytest.fixture(scope="module")
    def ccp4data():
>       return CCP4.CCP4(datafiles.CCP4_1JZV)

../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py:27: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:197: in __init__
    self.read(filename)
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:204: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <gridData.CCP4.CCP4 object at 0x7fff947944a8>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.5.0/gridData/tests/datafiles/1jzv.ccp4'>

    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes

../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:308: error
_______ ERROR at setup of test_ccp4_read_header[arms-0.4034915268421173] _______

    @pytest.fixture(scope="module")
    def ccp4data():
>       return CCP4.CCP4(datafiles.CCP4_1JZV)

../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py:27: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:197: in __init__
    self.read(filename)
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:204: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <gridData.CCP4.CCP4 object at 0x7fff947944a8>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.5.0/gridData/tests/datafiles/1jzv.ccp4'>

    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes

../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:308: error
_______________ ERROR at setup of test_ccp4_read_header[nlabl-1] _______________

    @pytest.fixture(scope="module")
    def ccp4data():
>       return CCP4.CCP4(datafiles.CCP4_1JZV)

../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py:27: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:197: in __init__
    self.read(filename)
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:204: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <gridData.CCP4.CCP4 object at 0x7fff947944a8>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.5.0/gridData/tests/datafiles/1jzv.ccp4'>

    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes

../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:308: error
 ERROR at setup of test_ccp4_read_header[label- Map from fft                                                                   ] 

    @pytest.fixture(scope="module")
    def ccp4data():
>       return CCP4.CCP4(datafiles.CCP4_1JZV)

../BUILD/GridDataFormats-0.5.0/gridData/tests/test_ccp4.py:27: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:197: in __init__
    self.read(filename)
../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:204: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <gridData.CCP4.CCP4 object at 0x7fff947944a8>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.5.0/gridData/tests/datafiles/1jzv.ccp4'>

    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes

../BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:308: error
=============================== warnings summary ===============================
gridData/tests/test_ccp4.py::test_ccp4
  /builddir/build/BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:287: UserWarning: Key mode: Illegal value 33554432
    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
  /builddir/build/BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:287: UserWarning: Key mapc: Illegal value 16777216
    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
  /builddir/build/BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:287: UserWarning: Key mapr: Illegal value 33554432
    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
  /builddir/build/BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:287: UserWarning: Key maps: Illegal value 50331648
    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))

gridData/tests/test_ccp4.py::test_ccp4_read_header[nc-96]
  /builddir/build/BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:287: UserWarning: Key mode: Illegal value 33554432
    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
  /builddir/build/BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:287: UserWarning: Key mapc: Illegal value 33554432
    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
  /builddir/build/BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:287: UserWarning: Key mapr: Illegal value 16777216
    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
  /builddir/build/BUILD/GridDataFormats-0.5.0/gridData/CCP4.py:287: UserWarning: Key maps: Illegal value 50331648
    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))

-- Docs: http://doc.pytest.org/en/latest/warnings.html
==== 50 passed, 1 skipped, 3 xfailed, 8 warnings, 33 error in 4.18 seconds =====

@orbeckst orbeckst added the format-MRC MRC/CCP4 file format label Sep 10, 2021
@mtasaka
Copy link

mtasaka commented Dec 28, 2021

Well, I don't understand what

for flag in '@=<>':
mapstr = struct.unpack(flag + '4s', mapbin)[0].decode('utf-8')
if mapstr.upper() == 'MAP ':
bsaflag = flag
break # Only possible value according to spec.
is going to do...?

So regardless of whether the host machine is little endian or big endian, if the bytes of 209-213 of the reading file is 209'M' 210'A' 211'P' 212' ', flag @ passes, because reading a file one byte by one as "char" array returns the same result regardless of host machine endianness, and "char" array is 1 byte alignment. So actually even on big endian host system, _detect_byteorder returns bsaflag is @ .

But then struct flag @I for the same "character" array returns different results between little endian host and big endian host - for example, reading b'\x01\x00\x00\x00' with @I at:

header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
returns 1 correctly on little endian system, but returns 16777216 (= 1<<24) on big endian system wrongly (as expected?).

Note that if I change the line L256 to for flag in '<>': , only test_ccp4_read_header[bsaflag-@] test fails. So for now I think returning value _detect_byteorder should be changed.

@orbeckst
Copy link
Member

That makes sense @mtasaka .

However, there are a few other issues with CCP4 so I am replacing it with mrcfile PR #100 and hopefully that will also close all the endianness issues (assuming that the mrcfile library handles those correctly).

@orbeckst orbeckst added this to the 0.7.0 milestone Dec 30, 2021
@orbeckst orbeckst mentioned this issue Dec 30, 2021
5 tasks
@orbeckst orbeckst modified the milestones: 0.7.0, 1.0.0 Feb 21, 2022
@rathann
Copy link
Contributor Author

rathann commented Mar 12, 2022

@orbeckst unfortunately mrcfile has issues on s390x as well, see ccpem/mrcfile#35 .

@orbeckst
Copy link
Member

That’s disappointing. But at least now if/when it gets fixed in mrcfile then it will benefit more people.

@rathann
Copy link
Contributor Author

rathann commented Apr 29, 2022

So, mrcfile got fixed, but GridDataFormats-0.7.0 CCP4 tests are still failing on s390x: https://koji.fedoraproject.org/koji/taskinfo?taskID=86372084 .

==================================== ERRORS ====================================
________________ ERROR at setup of test_ccp4_read_header[nc-96] ________________
[gw1] linux -- Python 3.10.4 /usr/bin/python3
    @pytest.fixture(scope="module")
    def ccp4data():
        with pytest.warns(DeprecationWarning,
                          match="CCP4.CCP4 is being replaced by mrc.MRC and will be removed"):
>           ccp4 = CCP4.CCP4(datafiles.CCP4_1JZV)
gridData/tests/test_ccp4.py:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
gridData/CCP4.py:204: in __init__
    self.read(filename)
gridData/CCP4.py:215: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <gridData.CCP4.CCP4 object at 0x3ff9a86f6d0>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.7.0/gridData/tests/datafiles/1jzv.ccp4'>
    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes
gridData/CCP4.py:319: error
_________________________ ERROR at setup of test_ccp4 __________________________
[gw0] linux -- Python 3.10.4 /usr/bin/python3
    @pytest.fixture(scope="module")
    def g():
        with pytest.warns(DeprecationWarning,
                          match="CCP4.CCP4 is being replaced by mrc.MRC and will be removed"):
            ccp4 = CCP4.CCP4()
>       ccp4.read(datafiles.CCP4)
gridData/tests/test_ccp4.py:18: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
gridData/CCP4.py:215: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <gridData.CCP4.CCP4 object at 0x3ff76f67a00>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.7.0/gridData/tests/datafiles/test.ccp4'>
    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes
gridData/CCP4.py:319: error
________________ ERROR at setup of test_ccp4_read_header[ns-70] ________________
[gw1] linux -- Python 3.10.4 /usr/bin/python3
    @pytest.fixture(scope="module")
    def ccp4data():
        with pytest.warns(DeprecationWarning,
                          match="CCP4.CCP4 is being replaced by mrc.MRC and will be removed"):
>           ccp4 = CCP4.CCP4(datafiles.CCP4_1JZV)
gridData/tests/test_ccp4.py:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
gridData/CCP4.py:204: in __init__
    self.read(filename)
gridData/CCP4.py:215: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <gridData.CCP4.CCP4 object at 0x3ff9a86f6d0>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.7.0/gridData/tests/datafiles/1jzv.ccp4'>
    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes
gridData/CCP4.py:319: error
_____________ ERROR at setup of test_ccp4_read_header[ncstart--4] ______________
[gw1] linux -- Python 3.10.4 /usr/bin/python3
    @pytest.fixture(scope="module")
    def ccp4data():
        with pytest.warns(DeprecationWarning,
                          match="CCP4.CCP4 is being replaced by mrc.MRC and will be removed"):
>           ccp4 = CCP4.CCP4(datafiles.CCP4_1JZV)
gridData/tests/test_ccp4.py:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
gridData/CCP4.py:204: in __init__
    self.read(filename)
gridData/CCP4.py:215: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <gridData.CCP4.CCP4 object at 0x3ff9a86f6d0>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.7.0/gridData/tests/datafiles/1jzv.ccp4'>
    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes
gridData/CCP4.py:319: error
________________ ERROR at setup of test_ccp4_read_header[nr-76] ________________
[gw0] linux -- Python 3.10.4 /usr/bin/python3
    @pytest.fixture(scope="module")
    def ccp4data():
        with pytest.warns(DeprecationWarning,
                          match="CCP4.CCP4 is being replaced by mrc.MRC and will be removed"):
>           ccp4 = CCP4.CCP4(datafiles.CCP4_1JZV)
gridData/tests/test_ccp4.py:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
gridData/CCP4.py:204: in __init__
    self.read(filename)
gridData/CCP4.py:215: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <gridData.CCP4.CCP4 object at 0x3ff76f71600>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.7.0/gridData/tests/datafiles/1jzv.ccp4'>
    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes
gridData/CCP4.py:319: error
_____________ ERROR at setup of test_ccp4_read_header[nsstart-102] _____________
[gw1] linux -- Python 3.10.4 /usr/bin/python3
    @pytest.fixture(scope="module")
    def ccp4data():
        with pytest.warns(DeprecationWarning,
                          match="CCP4.CCP4 is being replaced by mrc.MRC and will be removed"):
>           ccp4 = CCP4.CCP4(datafiles.CCP4_1JZV)
gridData/tests/test_ccp4.py:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
gridData/CCP4.py:204: in __init__
    self.read(filename)
gridData/CCP4.py:215: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <gridData.CCP4.CCP4 object at 0x3ff9a86f6d0>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.7.0/gridData/tests/datafiles/1jzv.ccp4'>
    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes
gridData/CCP4.py:319: error
_______________ ERROR at setup of test_ccp4_read_header[mode-2] ________________
[gw0] linux -- Python 3.10.4 /usr/bin/python3
    @pytest.fixture(scope="module")
    def ccp4data():
        with pytest.warns(DeprecationWarning,
                          match="CCP4.CCP4 is being replaced by mrc.MRC and will be removed"):
>           ccp4 = CCP4.CCP4(datafiles.CCP4_1JZV)
gridData/tests/test_ccp4.py:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
gridData/CCP4.py:204: in __init__
    self.read(filename)
gridData/CCP4.py:215: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <gridData.CCP4.CCP4 object at 0x3ff76f71600>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.7.0/gridData/tests/datafiles/1jzv.ccp4'>
    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes
gridData/CCP4.py:319: error
_____________ ERROR at setup of test_ccp4_read_header[nrstart--23] _____________
[gw0] linux -- Python 3.10.4 /usr/bin/python3
    @pytest.fixture(scope="module")
    def ccp4data():
        with pytest.warns(DeprecationWarning,
                          match="CCP4.CCP4 is being replaced by mrc.MRC and will be removed"):
>           ccp4 = CCP4.CCP4(datafiles.CCP4_1JZV)
gridData/tests/test_ccp4.py:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
gridData/CCP4.py:204: in __init__
    self.read(filename)
gridData/CCP4.py:215: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <gridData.CCP4.CCP4 object at 0x3ff76f71600>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.7.0/gridData/tests/datafiles/1jzv.ccp4'>
    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes
gridData/CCP4.py:319: error
________________ ERROR at setup of test_ccp4_read_header[ny-84] ________________
[gw1] linux -- Python 3.10.4 /usr/bin/python3
    @pytest.fixture(scope="module")
    def ccp4data():
        with pytest.warns(DeprecationWarning,
                          match="CCP4.CCP4 is being replaced by mrc.MRC and will be removed"):
>           ccp4 = CCP4.CCP4(datafiles.CCP4_1JZV)
gridData/tests/test_ccp4.py:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
gridData/CCP4.py:204: in __init__
    self.read(filename)
gridData/CCP4.py:215: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <gridData.CCP4.CCP4 object at 0x3ff9a86f6d0>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.7.0/gridData/tests/datafiles/1jzv.ccp4'>
    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes
gridData/CCP4.py:319: error
________________ ERROR at setup of test_ccp4_read_header[nx-84] ________________
[gw0] linux -- Python 3.10.4 /usr/bin/python3
    @pytest.fixture(scope="module")
    def ccp4data():
        with pytest.warns(DeprecationWarning,
                          match="CCP4.CCP4 is being replaced by mrc.MRC and will be removed"):
>           ccp4 = CCP4.CCP4(datafiles.CCP4_1JZV)
gridData/tests/test_ccp4.py:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
gridData/CCP4.py:204: in __init__
    self.read(filename)
gridData/CCP4.py:215: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <gridData.CCP4.CCP4 object at 0x3ff76f71600>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.7.0/gridData/tests/datafiles/1jzv.ccp4'>
    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes
gridData/CCP4.py:319: error
_______ ERROR at setup of test_ccp4_read_header[xlen-45.79999923706055] ________
[gw1] linux -- Python 3.10.4 /usr/bin/python3
    @pytest.fixture(scope="module")
    def ccp4data():
        with pytest.warns(DeprecationWarning,
                          match="CCP4.CCP4 is being replaced by mrc.MRC and will be removed"):
>           ccp4 = CCP4.CCP4(datafiles.CCP4_1JZV)
gridData/tests/test_ccp4.py:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
gridData/CCP4.py:204: in __init__
    self.read(filename)
gridData/CCP4.py:215: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <gridData.CCP4.CCP4 object at 0x3ff9a86f6d0>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.7.0/gridData/tests/datafiles/1jzv.ccp4'>
    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes
gridData/CCP4.py:319: error
_______________ ERROR at setup of test_ccp4_read_header[nz-160] ________________
[gw0] linux -- Python 3.10.4 /usr/bin/python3
    @pytest.fixture(scope="module")
    def ccp4data():
        with pytest.warns(DeprecationWarning,
                          match="CCP4.CCP4 is being replaced by mrc.MRC and will be removed"):
>           ccp4 = CCP4.CCP4(datafiles.CCP4_1JZV)
gridData/tests/test_ccp4.py:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
gridData/CCP4.py:204: in __init__
    self.read(filename)
gridData/CCP4.py:215: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <gridData.CCP4.CCP4 object at 0x3ff76f71600>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.7.0/gridData/tests/datafiles/1jzv.ccp4'>
    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes
gridData/CCP4.py:319: error
________ ERROR at setup of test_ccp4_read_header[zlen-89.6500015258789] ________
[gw1] linux -- Python 3.10.4 /usr/bin/python3
    @pytest.fixture(scope="module")
    def ccp4data():
        with pytest.warns(DeprecationWarning,
                          match="CCP4.CCP4 is being replaced by mrc.MRC and will be removed"):
>           ccp4 = CCP4.CCP4(datafiles.CCP4_1JZV)
gridData/tests/test_ccp4.py:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
gridData/CCP4.py:204: in __init__
    self.read(filename)
gridData/CCP4.py:215: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <gridData.CCP4.CCP4 object at 0x3ff9a86f6d0>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.7.0/gridData/tests/datafiles/1jzv.ccp4'>
    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes
gridData/CCP4.py:319: error
_______ ERROR at setup of test_ccp4_read_header[ylen-45.79999923706055] ________
[gw0] linux -- Python 3.10.4 /usr/bin/python3
    @pytest.fixture(scope="module")
    def ccp4data():
        with pytest.warns(DeprecationWarning,
                          match="CCP4.CCP4 is being replaced by mrc.MRC and will be removed"):
>           ccp4 = CCP4.CCP4(datafiles.CCP4_1JZV)
gridData/tests/test_ccp4.py:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
gridData/CCP4.py:204: in __init__
    self.read(filename)
gridData/CCP4.py:215: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <gridData.CCP4.CCP4 object at 0x3ff76f71600>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.7.0/gridData/tests/datafiles/1jzv.ccp4'>
    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes
gridData/CCP4.py:319: error
______________ ERROR at setup of test_ccp4_read_header[beta-90.0] ______________
[gw1] linux -- Python 3.10.4 /usr/bin/python3
    @pytest.fixture(scope="module")
    def ccp4data():
        with pytest.warns(DeprecationWarning,
                          match="CCP4.CCP4 is being replaced by mrc.MRC and will be removed"):
>           ccp4 = CCP4.CCP4(datafiles.CCP4_1JZV)
gridData/tests/test_ccp4.py:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
gridData/CCP4.py:204: in __init__
    self.read(filename)
gridData/CCP4.py:215: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <gridData.CCP4.CCP4 object at 0x3ff9a86f6d0>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.7.0/gridData/tests/datafiles/1jzv.ccp4'>
    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes
gridData/CCP4.py:319: error
_____________ ERROR at setup of test_ccp4_read_header[alpha-90.0] ______________
[gw0] linux -- Python 3.10.4 /usr/bin/python3
    @pytest.fixture(scope="module")
    def ccp4data():
        with pytest.warns(DeprecationWarning,
                          match="CCP4.CCP4 is being replaced by mrc.MRC and will be removed"):
>           ccp4 = CCP4.CCP4(datafiles.CCP4_1JZV)
gridData/tests/test_ccp4.py:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
gridData/CCP4.py:204: in __init__
    self.read(filename)
gridData/CCP4.py:215: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <gridData.CCP4.CCP4 object at 0x3ff76f71600>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.7.0/gridData/tests/datafiles/1jzv.ccp4'>
    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes
gridData/CCP4.py:319: error
_______________ ERROR at setup of test_ccp4_read_header[mapc-2] ________________
[gw1] linux -- Python 3.10.4 /usr/bin/python3
    @pytest.fixture(scope="module")
    def ccp4data():
        with pytest.warns(DeprecationWarning,
                          match="CCP4.CCP4 is being replaced by mrc.MRC and will be removed"):
>           ccp4 = CCP4.CCP4(datafiles.CCP4_1JZV)
gridData/tests/test_ccp4.py:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
gridData/CCP4.py:204: in __init__
    self.read(filename)
gridData/CCP4.py:215: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <gridData.CCP4.CCP4 object at 0x3ff9a86f6d0>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.7.0/gridData/tests/datafiles/1jzv.ccp4'>
    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes
gridData/CCP4.py:319: error
_______________ ERROR at setup of test_ccp4_read_header[maps-3] ________________
[gw1] linux -- Python 3.10.4 /usr/bin/python3
    @pytest.fixture(scope="module")
    def ccp4data():
        with pytest.warns(DeprecationWarning,
                          match="CCP4.CCP4 is being replaced by mrc.MRC and will be removed"):
>           ccp4 = CCP4.CCP4(datafiles.CCP4_1JZV)
gridData/tests/test_ccp4.py:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
gridData/CCP4.py:204: in __init__
    self.read(filename)
gridData/CCP4.py:215: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <gridData.CCP4.CCP4 object at 0x3ff9a86f6d0>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.7.0/gridData/tests/datafiles/1jzv.ccp4'>
    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes
gridData/CCP4.py:319: error
_____________ ERROR at setup of test_ccp4_read_header[gamma-90.0] ______________
[gw0] linux -- Python 3.10.4 /usr/bin/python3
    @pytest.fixture(scope="module")
    def ccp4data():
        with pytest.warns(DeprecationWarning,
                          match="CCP4.CCP4 is being replaced by mrc.MRC and will be removed"):
>           ccp4 = CCP4.CCP4(datafiles.CCP4_1JZV)
gridData/tests/test_ccp4.py:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
gridData/CCP4.py:204: in __init__
    self.read(filename)
gridData/CCP4.py:215: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <gridData.CCP4.CCP4 object at 0x3ff76f71600>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.7.0/gridData/tests/datafiles/1jzv.ccp4'>
    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes
gridData/CCP4.py:319: error
_______ ERROR at setup of test_ccp4_read_header[amax-9.050403594970703] ________
[gw1] linux -- Python 3.10.4 /usr/bin/python3
    @pytest.fixture(scope="module")
    def ccp4data():
        with pytest.warns(DeprecationWarning,
                          match="CCP4.CCP4 is being replaced by mrc.MRC and will be removed"):
>           ccp4 = CCP4.CCP4(datafiles.CCP4_1JZV)
gridData/tests/test_ccp4.py:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
gridData/CCP4.py:204: in __init__
    self.read(filename)
gridData/CCP4.py:215: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <gridData.CCP4.CCP4 object at 0x3ff9a86f6d0>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.7.0/gridData/tests/datafiles/1jzv.ccp4'>
    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes
gridData/CCP4.py:319: error
_______________ ERROR at setup of test_ccp4_read_header[mapr-1] ________________
[gw0] linux -- Python 3.10.4 /usr/bin/python3
    @pytest.fixture(scope="module")
    def ccp4data():
        with pytest.warns(DeprecationWarning,
                          match="CCP4.CCP4 is being replaced by mrc.MRC and will be removed"):
>           ccp4 = CCP4.CCP4(datafiles.CCP4_1JZV)
gridData/tests/test_ccp4.py:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
gridData/CCP4.py:204: in __init__
    self.read(filename)
gridData/CCP4.py:215: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <gridData.CCP4.CCP4 object at 0x3ff76f71600>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.7.0/gridData/tests/datafiles/1jzv.ccp4'>
    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes
gridData/CCP4.py:319: error
_______________ ERROR at setup of test_ccp4_read_header[ispg-92] _______________
[gw1] linux -- Python 3.10.4 /usr/bin/python3
    @pytest.fixture(scope="module")
    def ccp4data():
        with pytest.warns(DeprecationWarning,
                          match="CCP4.CCP4 is being replaced by mrc.MRC and will be removed"):
>           ccp4 = CCP4.CCP4(datafiles.CCP4_1JZV)
gridData/tests/test_ccp4.py:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
gridData/CCP4.py:204: in __init__
    self.read(filename)
gridData/CCP4.py:215: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <gridData.CCP4.CCP4 object at 0x3ff9a86f6d0>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.7.0/gridData/tests/datafiles/1jzv.ccp4'>
    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes
gridData/CCP4.py:319: error
______ ERROR at setup of test_ccp4_read_header[amin--0.9930942058563232] _______
[gw0] linux -- Python 3.10.4 /usr/bin/python3
    @pytest.fixture(scope="module")
    def ccp4data():
        with pytest.warns(DeprecationWarning,
                          match="CCP4.CCP4 is being replaced by mrc.MRC and will be removed"):
>           ccp4 = CCP4.CCP4(datafiles.CCP4_1JZV)
gridData/tests/test_ccp4.py:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
gridData/CCP4.py:204: in __init__
    self.read(filename)
gridData/CCP4.py:215: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <gridData.CCP4.CCP4 object at 0x3ff76f71600>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.7.0/gridData/tests/datafiles/1jzv.ccp4'>
    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes
gridData/CCP4.py:319: error
______________ ERROR at setup of test_ccp4_read_header[lskflg-0] _______________
[gw1] linux -- Python 3.10.4 /usr/bin/python3
    @pytest.fixture(scope="module")
    def ccp4data():
        with pytest.warns(DeprecationWarning,
                          match="CCP4.CCP4 is being replaced by mrc.MRC and will be removed"):
>           ccp4 = CCP4.CCP4(datafiles.CCP4_1JZV)
gridData/tests/test_ccp4.py:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
gridData/CCP4.py:204: in __init__
    self.read(filename)
gridData/CCP4.py:215: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <gridData.CCP4.CCP4 object at 0x3ff9a86f6d0>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.7.0/gridData/tests/datafiles/1jzv.ccp4'>
    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes
gridData/CCP4.py:319: error
____ ERROR at setup of test_ccp4_read_header[amean--0.0005801090155728161] _____
[gw0] linux -- Python 3.10.4 /usr/bin/python3
    @pytest.fixture(scope="module")
    def ccp4data():
        with pytest.warns(DeprecationWarning,
                          match="CCP4.CCP4 is being replaced by mrc.MRC and will be removed"):
>           ccp4 = CCP4.CCP4(datafiles.CCP4_1JZV)
gridData/tests/test_ccp4.py:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
gridData/CCP4.py:204: in __init__
    self.read(filename)
gridData/CCP4.py:215: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <gridData.CCP4.CCP4 object at 0x3ff76f71600>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.7.0/gridData/tests/datafiles/1jzv.ccp4'>
    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes
gridData/CCP4.py:319: error
_____________ ERROR at setup of test_ccp4_read_header[skwmat-None] _____________
[gw1] linux -- Python 3.10.4 /usr/bin/python3
    @pytest.fixture(scope="module")
    def ccp4data():
        with pytest.warns(DeprecationWarning,
                          match="CCP4.CCP4 is being replaced by mrc.MRC and will be removed"):
>           ccp4 = CCP4.CCP4(datafiles.CCP4_1JZV)
gridData/tests/test_ccp4.py:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
gridData/CCP4.py:204: in __init__
    self.read(filename)
gridData/CCP4.py:215: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <gridData.CCP4.CCP4 object at 0x3ff9a86f6d0>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.7.0/gridData/tests/datafiles/1jzv.ccp4'>
    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes
gridData/CCP4.py:319: error
_____________ ERROR at setup of test_ccp4_read_header[nsymbt-640] ______________
[gw0] linux -- Python 3.10.4 /usr/bin/python3
    @pytest.fixture(scope="module")
    def ccp4data():
        with pytest.warns(DeprecationWarning,
                          match="CCP4.CCP4 is being replaced by mrc.MRC and will be removed"):
>           ccp4 = CCP4.CCP4(datafiles.CCP4_1JZV)
gridData/tests/test_ccp4.py:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
gridData/CCP4.py:204: in __init__
    self.read(filename)
gridData/CCP4.py:215: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <gridData.CCP4.CCP4 object at 0x3ff76f71600>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.7.0/gridData/tests/datafiles/1jzv.ccp4'>
    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes
gridData/CCP4.py:319: error
__________ ERROR at setup of test_ccp4_read_header[endianness-little] __________
[gw1] linux -- Python 3.10.4 /usr/bin/python3
    @pytest.fixture(scope="module")
    def ccp4data():
        with pytest.warns(DeprecationWarning,
                          match="CCP4.CCP4 is being replaced by mrc.MRC and will be removed"):
>           ccp4 = CCP4.CCP4(datafiles.CCP4_1JZV)
gridData/tests/test_ccp4.py:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
gridData/CCP4.py:204: in __init__
    self.read(filename)
gridData/CCP4.py:215: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <gridData.CCP4.CCP4 object at 0x3ff9a86f6d0>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.7.0/gridData/tests/datafiles/1jzv.ccp4'>
    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes
gridData/CCP4.py:319: error
_______________ ERROR at setup of test_ccp4_read_header[nlabl-1] _______________
[gw1] linux -- Python 3.10.4 /usr/bin/python3
    @pytest.fixture(scope="module")
    def ccp4data():
        with pytest.warns(DeprecationWarning,
                          match="CCP4.CCP4 is being replaced by mrc.MRC and will be removed"):
>           ccp4 = CCP4.CCP4(datafiles.CCP4_1JZV)
gridData/tests/test_ccp4.py:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
gridData/CCP4.py:204: in __init__
    self.read(filename)
gridData/CCP4.py:215: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <gridData.CCP4.CCP4 object at 0x3ff9a86f6d0>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.7.0/gridData/tests/datafiles/1jzv.ccp4'>
    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes
gridData/CCP4.py:319: error
______________ ERROR at setup of test_ccp4_read_header[bsaflag-@] ______________
[gw0] linux -- Python 3.10.4 /usr/bin/python3
    @pytest.fixture(scope="module")
    def ccp4data():
        with pytest.warns(DeprecationWarning,
                          match="CCP4.CCP4 is being replaced by mrc.MRC and will be removed"):
>           ccp4 = CCP4.CCP4(datafiles.CCP4_1JZV)
gridData/tests/test_ccp4.py:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
gridData/CCP4.py:204: in __init__
    self.read(filename)
gridData/CCP4.py:215: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <gridData.CCP4.CCP4 object at 0x3ff76f71600>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.7.0/gridData/tests/datafiles/1jzv.ccp4'>
    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes
gridData/CCP4.py:319: error
_____________ ERROR at setup of test_ccp4_read_header[skwtrn-None] _____________
[gw0] linux -- Python 3.10.4 /usr/bin/python3
    @pytest.fixture(scope="module")
    def ccp4data():
        with pytest.warns(DeprecationWarning,
                          match="CCP4.CCP4 is being replaced by mrc.MRC and will be removed"):
>           ccp4 = CCP4.CCP4(datafiles.CCP4_1JZV)
gridData/tests/test_ccp4.py:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
gridData/CCP4.py:204: in __init__
    self.read(filename)
gridData/CCP4.py:215: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <gridData.CCP4.CCP4 object at 0x3ff76f71600>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.7.0/gridData/tests/datafiles/1jzv.ccp4'>
    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes
gridData/CCP4.py:319: error
_______ ERROR at setup of test_ccp4_read_header[arms-0.4034915268421173] _______
[gw0] linux -- Python 3.10.4 /usr/bin/python3
    @pytest.fixture(scope="module")
    def ccp4data():
        with pytest.warns(DeprecationWarning,
                          match="CCP4.CCP4 is being replaced by mrc.MRC and will be removed"):
>           ccp4 = CCP4.CCP4(datafiles.CCP4_1JZV)
gridData/tests/test_ccp4.py:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
gridData/CCP4.py:204: in __init__
    self.read(filename)
gridData/CCP4.py:215: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <gridData.CCP4.CCP4 object at 0x3ff76f71600>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.7.0/gridData/tests/datafiles/1jzv.ccp4'>
    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes
gridData/CCP4.py:319: error
_ ERROR at setup of test_ccp4_read_header[label- Map from fft                                                                   ] _
[gw0] linux -- Python 3.10.4 /usr/bin/python3
    @pytest.fixture(scope="module")
    def ccp4data():
        with pytest.warns(DeprecationWarning,
                          match="CCP4.CCP4 is being replaced by mrc.MRC and will be removed"):
>           ccp4 = CCP4.CCP4(datafiles.CCP4_1JZV)
gridData/tests/test_ccp4.py:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
gridData/CCP4.py:204: in __init__
    self.read(filename)
gridData/CCP4.py:215: in read
    h = self.header = self._read_header(ccp4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <gridData.CCP4.CCP4 object at 0x3ff76f71600>
ccp4file = <_io.BufferedReader name='/builddir/build/BUILD/GridDataFormats-0.7.0/gridData/tests/datafiles/1jzv.ccp4'>
    def _read_header(self, ccp4file):
        """Read header bytes"""
    
        bsaflag = self._detect_byteorder(ccp4file)
    
        # Parse the top of the header (4-byte words, 1 to 25).
        nheader = struct.calcsize(self._headerfmt)
        names = [r.key for r in self._header_struct]
        bintopheader = ccp4file.read(25 * 4)
    
        def decode_header(header, bsaflag='@'):
            h = dict(zip(names, struct.unpack(bsaflag + self._headerfmt,
                                              header)))
            h['bsaflag'] = bsaflag
            return h
    
        header = decode_header(bintopheader, bsaflag)
        for rec in self._header_struct:
            if not rec.is_legal_dict(header):
                warnings.warn(
                    "Key %s: Illegal value %r" % (rec.key, header[rec.key]))
    
        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (header['lskflg']):
            skewmatrix = np.fromfile(ccp4file, dtype=np.float32, count=9)
            header['skwmat'] = skewmatrix.reshape((3, 3))
            header['skwtrn'] = np.fromfile(ccp4file, dtype=np.float32, count=3)
        else:
            header['skwmat'] = header['skwtrn'] = None
            ccp4file.seek(12 * 4, 1)
        ccp4file.seek(15 * 4, 1)  # Skip future use section.
        ccp4file.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        endiancode = struct.unpack(bsaflag + '4b', ccp4file.read(4))
        header['endianness'] = 'little' if endiancode == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        header['arms'] = struct.unpack(bsaflag + 'f', ccp4file.read(4))[0]
        header['nlabl'] = struct.unpack(bsaflag + 'I', ccp4file.read(4))[0]
        if header['nlabl']:
            binlabel = ccp4file.read(80 * header['nlabl'])
            flag = bsaflag + str(80 * header['nlabl']) + 's'
>           label = struct.unpack(flag, binlabel)[0]
E           struct.error: unpack requires a buffer of 1342177280 bytes
gridData/CCP4.py:319: error
=============================== warnings summary ===============================
gridData/tests/test_ccp4.py::test_ccp4
  /builddir/build/BUILD/GridDataFormats-0.7.0/gridData/CCP4.py:297: UserWarning: Key mode: Illegal value 33554432
    warnings.warn(
gridData/tests/test_ccp4.py::test_ccp4
  /builddir/build/BUILD/GridDataFormats-0.7.0/gridData/CCP4.py:297: UserWarning: Key mapc: Illegal value 16777216
    warnings.warn(
gridData/tests/test_ccp4.py::test_ccp4
  /builddir/build/BUILD/GridDataFormats-0.7.0/gridData/CCP4.py:297: UserWarning: Key mapr: Illegal value 33554432
    warnings.warn(
gridData/tests/test_ccp4.py::test_ccp4
  /builddir/build/BUILD/GridDataFormats-0.7.0/gridData/CCP4.py:297: UserWarning: Key maps: Illegal value 50331648
    warnings.warn(
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
ERROR gridData/tests/test_ccp4.py::test_ccp4_read_header[nc-96] - struct.erro...
ERROR gridData/tests/test_ccp4.py::test_ccp4 - struct.error: unpack requires ...
ERROR gridData/tests/test_ccp4.py::test_ccp4_read_header[ns-70] - struct.erro...
ERROR gridData/tests/test_ccp4.py::test_ccp4_read_header[ncstart--4] - struct...
ERROR gridData/tests/test_ccp4.py::test_ccp4_read_header[nr-76] - struct.erro...
ERROR gridData/tests/test_ccp4.py::test_ccp4_read_header[nsstart-102] - struc...
ERROR gridData/tests/test_ccp4.py::test_ccp4_read_header[mode-2] - struct.err...
ERROR gridData/tests/test_ccp4.py::test_ccp4_read_header[nrstart--23] - struc...
ERROR gridData/tests/test_ccp4.py::test_ccp4_read_header[ny-84] - struct.erro...
ERROR gridData/tests/test_ccp4.py::test_ccp4_read_header[nx-84] - struct.erro...
ERROR gridData/tests/test_ccp4.py::test_ccp4_read_header[xlen-45.79999923706055]
ERROR gridData/tests/test_ccp4.py::test_ccp4_read_header[nz-160] - struct.err...
ERROR gridData/tests/test_ccp4.py::test_ccp4_read_header[zlen-89.6500015258789]
ERROR gridData/tests/test_ccp4.py::test_ccp4_read_header[ylen-45.79999923706055]
ERROR gridData/tests/test_ccp4.py::test_ccp4_read_header[beta-90.0] - struct....
ERROR gridData/tests/test_ccp4.py::test_ccp4_read_header[alpha-90.0] - struct...
ERROR gridData/tests/test_ccp4.py::test_ccp4_read_header[mapc-2] - struct.err...
ERROR gridData/tests/test_ccp4.py::test_ccp4_read_header[maps-3] - struct.err...
ERROR gridData/tests/test_ccp4.py::test_ccp4_read_header[gamma-90.0] - struct...
ERROR gridData/tests/test_ccp4.py::test_ccp4_read_header[amax-9.050403594970703]
ERROR gridData/tests/test_ccp4.py::test_ccp4_read_header[mapr-1] - struct.err...
ERROR gridData/tests/test_ccp4.py::test_ccp4_read_header[ispg-92] - struct.er...
ERROR gridData/tests/test_ccp4.py::test_ccp4_read_header[amin--0.9930942058563232]
ERROR gridData/tests/test_ccp4.py::test_ccp4_read_header[lskflg-0] - struct.e...
ERROR gridData/tests/test_ccp4.py::test_ccp4_read_header[amean--0.0005801090155728161]
ERROR gridData/tests/test_ccp4.py::test_ccp4_read_header[skwmat-None] - struc...
ERROR gridData/tests/test_ccp4.py::test_ccp4_read_header[nsymbt-640] - struct...
ERROR gridData/tests/test_ccp4.py::test_ccp4_read_header[endianness-little]
ERROR gridData/tests/test_ccp4.py::test_ccp4_read_header[nlabl-1] - struct.er...
ERROR gridData/tests/test_ccp4.py::test_ccp4_read_header[bsaflag-@] - struct....
ERROR gridData/tests/test_ccp4.py::test_ccp4_read_header[skwtrn-None] - struc...
ERROR gridData/tests/test_ccp4.py::test_ccp4_read_header[arms-0.4034915268421173]
ERROR gridData/tests/test_ccp4.py::test_ccp4_read_header[label- Map from fft                                                                   ]
======= 105 passed, 1 skipped, 3 xfailed, 4 warnings, 33 errors in 1.05s =======

@orbeckst
Copy link
Member

Thank you for the update. Given that we are removing the deprecated CCP4 module anyway, we might just make a new release with it gone.

I’m very happy about the good news that mrcfile got fixed!

orbeckst added a commit that referenced this issue Apr 30, 2022
- fix #107 and #50
- removed CCP4.py and test_CCP4.py
- updated docs
- updated CHANGELOG
orbeckst added a commit that referenced this issue May 12, 2022
* removed CCP4 module

- fix #107 and #50
- removed CCP4.py and test_CCP4.py
- updated docs
- updated CHANGELOG

* Update CHANGELOG

Co-authored-by: Irfan Alibay <[email protected]>

Co-authored-by: Irfan Alibay <[email protected]>
@orbeckst
Copy link
Member

We removed the failing tests. In principle that should be enough to close this issue.

If you have the time to try it and report back then that would be great.

Otherwise I’ll just cut the 1.0 release and hope it will be fine.

@orbeckst
Copy link
Member

(We also removed the code that belonged to the failing tests, not just the tests… just wanted to be clear :-) )

@orbeckst
Copy link
Member

The failing tests are not anymore present in the 1.0.0 release (#68 ). The functionality is provided by the new mrc module and the tests are not necessary anymore so I am closing the issue.

@rathann
Copy link
Contributor Author

rathann commented May 29, 2022

The test suite passes on s390x with 1.0.1. Thanks!

@orbeckst
Copy link
Member

orbeckst commented May 29, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect format-MRC MRC/CCP4 file format
Projects
None yet
Development

No branches or pull requests

3 participants