Closed dave992 closed 1 year ago
The relevant constructors that I found for the TaskComposerPluginFactory
are:
Overload 2: Load plugins from file path :type config: path :param config: The config file path
Overload 3: Load plugins from string :type config: string :param config: The config string
I think the path
refers to tesseract_common::FilesystemPath
which is a wrapper for boost::filesystem::path
based on the documentation. Would it be possible to have this compatible with Python patlib.Path
?
The use of FilesystemPath is to select the correct overload of the function/constructor. It is wrapping boost::filesystem::path. Using Pathlib would add more unnecessary complexity from these low level wrappers.
Perhaps exclude the string overload from the wrapper then.
The string constructor allows for the use of a string containing the yaml text without needing to open a file.
Ah, the third overload is a YAML string. Sounds like perfect info for the docstring of the overload, although out of scope for this issue 😉
The docstring is generated from the C++ doxygen comments in the upstream repository. Pull requests are always appreciated.
I am unable to construct a
TaskComposerPluginFactory
using a string as input:I get the following error:
If I look at the
TaskComposerPluginFactory
, I find references to a constructor using a string as input and would've expected this to also be accepted.For now, I will work around this by using a
tesseract_common::FilesystemPath
object as input.