jeetsukumaran / DendroPy

A Python library for phylogenetic scripting, simulation, data processing and manipulation.
https://pypi.org/project/DendroPy/.
BSD 3-Clause "New" or "Revised" License
210 stars 61 forks source link

Preserve_underscores #112

Open wrightaprilm opened 5 years ago

wrightaprilm commented 5 years ago

Hi Jeet,

I'm making a tree for a paper and I didn't want underscores in the taxon labels. I wanted to suggest in the Tree.write() functions, switching from a preserve_spaces to preserve_underscores. I think keeping the arguments the same between the input and output is more intuitive. I'd be happy to contribute a pull request doing that if you'd like.

jeetsukumaran commented 5 years ago

Hi April, that sounds great. Consistency and symmetry would be wonderful and is a design principle, so any lapse should be fixed. I would be happy to accept a PR if you can spare the time to work a fix, but the only thing that I ask is that legacy support be maintained.

This can be a little tedious --- as you will have to check and decide what to do if the user specifies both preserve_spaces'' andpreserve_underscores''. Will this be an error? Will this be an error only if there is a conflict? Whether or not they conflict, they should probably both map (populate) the same internal variable (that then gets checked by the underlying writer logic), so that the rest of the code does not need to worry about this double specification.

If you can get by for a couple of weeks, I will be happy to look into this myself.

wrightaprilm commented 5 years ago

Cool, I'll see if I have some time next Friday.