nanoporetech / medaka

Sequence correction provided by ONT Research
https://nanoporetech.com
Other
391 stars 73 forks source link

Error numpy has no attribute unicode #404

Closed ammaraziz closed 1 year ago

ammaraziz commented 1 year ago

Hi there,

I am running medaka version 1.7.2, Numpy version 1.24.1. I get this error:

Traceback (most recent call last):
  File ".../bin/medaka", line 8, in <module>
    sys.exit(main())
  File ".../python3.9/site-packages/medaka/medaka.py", line 724, in main
    args.func(args)
  File ".../python3.9/site-packages/medaka/prediction.py", line 187, in predict
    new_remainders = run_prediction(
  File ".../python3.9/site-packages/medaka/prediction.py", line 54, in run_prediction
    ds.write_sample(new_sample)
  File ".../python3.9/site-packages/medaka/datastore.py", line 293, in write_sample
    isinstance(data[0], np.unicode):
  File ".../python3.9/site-packages/numpy/__init__.py", line 284, in __getattr__
    raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'unicode'

https://github.com/nanoporetech/medaka/blob/481a2839f019ad0dce032b9a655b5e309968ca18/medaka/datastore.py#L293

Not sure when the change happened (it's been a while looking at the docs) but np.unicode is now np.unicode_. Making this change to the code on my end fixed the issue.

Thanks

dinovski commented 1 year ago

I had the same issue and the change worked for me as well. Thanks @ammaraziz !

cjw85 commented 1 year ago

Thank you for reporting this,

In our continuous integration tests I see that numpy 1.23.5 is installed and gives us a warning that np.unicode is deprecated. It suggested using np.compat.unicode. We will change the code to this.

cjw85 commented 1 year ago

This is fixed in medaka v1.7.3.