In #107 the run function was documented to be used either providing a file handler or an iterator scrolling over the PDB lines. However in pdb_split* and pdb_tocif the run function defines the output files basenames given the .name attribute of the file handler. iterables won't have this attribute. This PR corrects that by providing a default name, output, when the attribute .name is not present in fhandler. Also, if run is used directly, the user can define outname specifically, instead of relying on the default values.
You will see a new function get_fname in the __init__.py. This function is imported where it is needed. I don't think this adds any overhead to the execution, and keeps things clean.
I am keeping this PR as draft while I write the tests, so that you can comment on it already. But we should merge asap.
In #107 the
run
function was documented to be used either providing afile handler
or aniterator
scrolling over thePDB
lines. However inpdb_split*
andpdb_tocif
therun
function defines the output files basenames given the.name
attribute of thefile handler
.iterables
won't have this attribute. This PR corrects that by providing a default name,output
, when the attribute.name
is not present infhandler
. Also, ifrun
is used directly, the user can defineoutname
specifically, instead of relying on the default values.You will see a new function
get_fname
in the__init__.py
. This function is imported where it is needed. I don't think this adds any overhead to the execution, and keeps things clean.I am keeping this PR as draft while I write the tests, so that you can comment on it already. But we should merge asap.