IMTEK-Simulation / NuMPI

Utilities for MPI-parallel numerical calculations with Python
MIT License
2 stars 1 forks source link

Regression with numpy==1.17.0 #22

Closed pastewka closed 3 years ago

pastewka commented 5 years ago

The latest numpy version introduced a regression in NuMPI. Output from pytest follows.

NuMPI/IO/MPIFileIO.py:143: in load_npy
    file = MPIFileViewNPY(fn, comm)
NuMPI/IO/MPIFileIO.py:197: in __init__
    self._read_header()
NuMPI/IO/MPIFileIO.py:234: in _read_header
    raise err
NuMPI/IO/MPIFileIO.py:227: in _read_header
    header = _filter_header(header)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = b"{'descr': '<f8', 'fortran_order': True, 'shape': (3, 2), }                                                           \n"

    def _filter_header(s):
        """Clean up 'L' in npz header ints.

        Cleans up the 'L' in strings representing integers. Needed to allow npz
        headers produced in Python2 to be read in Python3.

        Parameters
        ----------
        s : string
            Npy file header.

        Returns
        -------
        header : str
            Cleaned up header.

        """
        import tokenize
        if sys.version_info[0] >= 3:
            from io import StringIO
        else:
            from StringIO import StringIO

        tokens = []
        last_token_was_number = False
        # adding newline as python 2.7.5 workaround
>       string = s + "\n"
E       TypeError: can't concat str to bytes
pastewka commented 5 years ago

This problem persists, reopening issue.

sannant commented 5 years ago

This working on my local copy and on travis.

I need more informations

sannant commented 3 years ago

@pastewka can we close this or does it still occur ?

pastewka commented 3 years ago

No, pytest runs with current master on my machine. Not sure what the problem was.