Description
i think we need to rethink the name_source
and _gen_filename
api.
originally _gen_filename
was meant to help auto generate filenames when typically a parameter that corresponded to an output was required. so if the output was Undefined
_gen_filename
would be called allowing interfaces to determine how the output should be called.
pattern:
undefined value + genfile -> gen_filename -> value
name_source
extended this to allow more clever naming of the output name, instead of the defaults that the interface supplied.
patterns:
undefined value + genfile -> gen_filename -> value
'%s' in value & genfile & name_source -> gen_filename from name source -> value
the same function _gen_filename
was overloaded to handle both these patterns and i think that every place where _gen_filename
was used was not checked.
there are two solutions:
-
keep the single function, but go through every single one of them to ensure that they are behaving appropriately. make sure to write a test for these.
-
refine the function.
a. you cannot specify
name_source
withoutgenfile
b. all overloaded_gen_filename
functions have to call the base class function whenever
they don't deal with that name -
create two separate functions:
_filename_from_source
and_gen_filename
see the PR for details on option 3.