dlce-eva / python-nexus

python-nexus - Generic nexus (.nex, .trees) reader/writer for python
BSD 2-Clause "Simplified" License
11 stars 3 forks source link

add fix for trailing comma in character labels #28

Closed SimonGreenhill closed 2 years ago

SimonGreenhill commented 2 years ago

This PR fixes a bug encountered here:

https://github.com/phlorest/kitchen_et_al2009/blob/870ca757a1ff737791073efef01a39faaef97eeb/raw/Kitchen-Semitic-Multistate.nex#L101

where the last character state label has a trailing comma. This used to create an empty character. We now throw a warning and ignore this case.

There's also an extra testcase for nexus.tools.binarise, because I initially thought that this was the problem but it wasn't. However, the test does something the other tests don't, so I thought I'd keep it.

SimonGreenhill commented 2 years ago

actually, I've moved that test over into #29