Burmeister data reader
Burmeister data reader reads files whose extension is .cxt
.
[1]:
import tempfile
from pprint import pprint
from galactic.io.data.core import PopulationFactory
data = """\
B
2
2
1
2
a
b
.X
XX
"""
with tempfile.NamedTemporaryFile(mode="w+t", suffix=".cxt") as file:
file.write(data)
file.seek(0)
population = PopulationFactory.create(file)
pprint({key: sorted(value) for key, value in population.items()})
{'1': ['b'], '2': ['a', 'b']}