cldf-clts / pyclts

Apache License 2.0
11 stars 2 forks source link

transcriptionsystem() gives error: unexpected keyword laterality #40

Closed peterdekker closed 3 years ago

peterdekker commented 3 years ago

I use pyclts to convert ASJPcode to IPA. Previously, this worked very well. After I updated pyclts to the newest version (3.0.1 - with CLTS 1.4.1), the code does not work anymore.

This is my minimal example that gives the error (in fact the example from the README):

from pyclts import CLTS
c = CLTS('clts-1.4.1')
asjp = c.transcriptionsystem('asjpcode')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.8/dist-packages/pyclts/api.py", line 71, in transcriptionsystem
    if key in self.transcriptionsystem_dict:
  File "/usr/local/lib/python3.8/dist-packages/clldutils/misc.py", line 195, in __get__
    result = instance.__dict__[self.__name__] = self.fget(instance)
  File "/usr/local/lib/python3.8/dist-packages/pyclts/api.py", line 68, in transcriptionsystem_dict
    return {ts.id: ts for ts in self.iter_transcriptionsystem()}
  File "/usr/local/lib/python3.8/dist-packages/pyclts/api.py", line 68, in <dictcomp>
    return {ts.id: ts for ts in self.iter_transcriptionsystem()}
  File "/usr/local/lib/python3.8/dist-packages/pyclts/api.py", line 60, in iter_transcriptionsystem
    yield TranscriptionSystem(
  File "/usr/local/lib/python3.8/dist-packages/pyclts/transcriptionsystem.py", line 70, in __init__
    sound = cls(ts=self, **item)
TypeError: __init__() got an unexpected keyword argument 'laterality'

Am I doing something wrong, or is this a bug in pyclts?

peterdekker commented 3 years ago

@tresoldi @xrotwang @LinguList Would you have any ideas by what this error is caused, and how it could possibly be fixed?

LinguList commented 3 years ago

You need to downscale your version < 3.0. Pyclts 3.0 works with a yet-to-publish version of CLTS, which has laterality as a feature. So please downscale this version of pyclts, and also checkout a labelled version of clts data.

peterdekker commented 3 years ago

That is clear, I will do that, thank you!

xrotwang commented 3 years ago

So

pip install pyclts < 3

and for the clone of https://github.com/cldf-clts/clts

git checkout v1.4.1

should do.

LinguList commented 3 years ago

The update was supposed to be released earlier, but we faced some difficulties (data are complex...) so it may well have to wait until February...

peterdekker commented 3 years ago

I am happy to use the older version, that should work for my purposes!