Skip to content

NevFile.getdata uses deprecated/removed function to read comments in getdata() #41

Description

@zeeMonkeez

Describe the bug
NevFile.getdata() uses numpy.char.chararray.tostring(), which has been deprecated since 1.19 and is removed from modern versions of numpy:

File [/brpylib/brpylib.py:740](http://localhost:8888/lab/workspaces/auto-t/tree/brpylib/brpylib.py#line=739), in NevFile.getdata(self, elec_ids, wave_read)
    738 textComments = comments[trueCommentsidx]
    739 textComments[:, -1] = "$"
--> 740 stringarray = textComments.tostring()
    741 stringvector = stringarray.decode("latin-1")
    742 stringvector = stringvector[0:-1]

AttributeError: 'chararray' object has no attribute 'tostring'

To Reproduce

  1. Install a recent version of numpy, e.g. 2.4 (current stable)
  2. open a NEV file with comments

Expected behavior

NevFile.getdata() should open a NEV file with comments without error

Desktop (please complete the following information):

  • numpy 2.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions