🔌 Application Programming Interface

🔌 Application Programming Interface#

galactic.io.data.fimi module

Class


class FIMIDataReader#

Bases: object

FIMI Data reader.

Example

>>> from pprint import pprint
>>> from galactic.io.data.fimi import FIMIDataReader
>>> reader = FIMIDataReader()
>>> import io
>>> text = '''
... 1 3
... 2 4 5
... 1 2
... 3 4 5
... '''.strip()
>>> dataset = reader.read(io.StringIO(text))
>>> dataset
[(1, 3), (2, 4, 5), (1, 2), (3, 4, 5)]
extensions()#

Return an iterator over the supported extensions.

Returns:

An iterator over the supported extensions

Return type:

Iterator[str]

read(data_file)#

Read a FIMI data file.

Parameters:

data_file (TextIO) – A readable text file

Returns:

The dataset read from the file

Return type:

DataSet

register()#

Register an instance of a FIMI data reader.

Return type:

None