Extending flitsr inputs

flitsr provides a number of Input types out-of-the-box, which cover a range of use cases. However, if you have a different spectral format (say, the output of a tool for a different programming language), you may also easily extend flitsr to support this format as well.

To extend flitsr to support a different output format, you must create an Input class.

This class may either be created in the flitsr tool’s input package, or you may create a flitsr pluin using entry points. For details on how to create a flitsr plugin, see Creating flitsr plugins. If creating a flitsr plugin, you may use the flitsr.input entry point, for example:

pyproject.toml
[project.entry-points.'flitsr.input']
test_input = "my-package.custom_input:CustomInput"

Where CustomInput is a custom input type that inherits Input.

Note

The test_input variable name is not used by flitsr and thus can be arbitrary.

Abstract Input class

See the Input class for the structure that your custom input type must extend.

Note

Your custom input type must implement all abstract methods, and may optionally implement the write_spectrum, and get_elem_separators methods.