Skip to content

Commit

Permalink
Improved tmp_files removal and added ipython docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
gbayarri committed Jan 22, 2025
1 parent c73ef2d commit f4e4519
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 9 deletions.
4 changes: 4 additions & 0 deletions biobb_chemistry/acpype/acpype_params_ac.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,15 @@ def launch(self) -> int:
get_default_value(self.__class__.__name__),
self.output_files, self.out_log)
else:
self.tmp_files.extend([self.basename + "." + self.unique_name + ".acpype"])
process_output(self.unique_name,
self.basename + "." + self.unique_name + ".acpype",
self.remove_tmp,
self.basename,
get_default_value(self.__class__.__name__),
self.output_files, self.out_log)

self.remove_tmp_files()
self.check_arguments(output_files_created=True, raise_exception=False)

return self.return_code
Expand All @@ -184,6 +186,8 @@ def acpype_params_ac(input_path: str, output_path_frcmod: str, output_path_inpcr
output_path_prmtop=output_path_prmtop,
properties=properties, **kwargs).launch()

acpype_params_ac.__doc__ = AcpypeParamsAC.__doc__


def main():
"""Command line execution of this building block. Please check the command line documentation."""
Expand Down
4 changes: 4 additions & 0 deletions biobb_chemistry/acpype/acpype_params_cns.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ def launch(self) -> int:
get_default_value(self.__class__.__name__),
self.output_files, self.out_log)
else:
self.tmp_files.extend([self.basename + "." + self.unique_name + ".acpype"])
process_output_cns(
self.unique_name,
self.basename + "." + self.unique_name + ".acpype",
Expand All @@ -170,6 +171,7 @@ def launch(self) -> int:
get_default_value(self.__class__.__name__),
self.output_files, self.out_log)

self.remove_tmp_files()
self.check_arguments(output_files_created=True, raise_exception=False)

return self.return_code
Expand All @@ -186,6 +188,8 @@ def acpype_params_cns(input_path: str, output_path_par: str, output_path_inp: st
output_path_pdb=output_path_pdb,
properties=properties, **kwargs).launch()

acpype_params_cns.__doc__ = AcpypeParamsCNS.__doc__


def main():
"""Command line execution of this building block. Please check the command line documentation."""
Expand Down
4 changes: 4 additions & 0 deletions biobb_chemistry/acpype/acpype_params_gmx.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,15 @@ def launch(self) -> int:
get_default_value(self.__class__.__name__),
self.output_files, self.out_log)
else:
self.tmp_files.extend([self.basename + "." + self.unique_name + ".acpype"])
process_output_gmx(self.unique_name,
self.basename + "." + self.unique_name + ".acpype",
self.remove_tmp,
self.basename,
get_default_value(self.__class__.__name__),
self.output_files, self.out_log)

self.remove_tmp_files()
self.check_arguments(output_files_created=True, raise_exception=False)

return self.return_code
Expand All @@ -179,6 +181,8 @@ def acpype_params_gmx(input_path: str, output_path_gro: str, output_path_itp: st
output_path_top=output_path_top,
properties=properties, **kwargs).launch()

acpype_params_gmx.__doc__ = AcpypeParamsGMX.__doc__


def main():
"""Command line execution of this building block. Please check the command line documentation."""
Expand Down
4 changes: 4 additions & 0 deletions biobb_chemistry/acpype/acpype_params_gmx_opls.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,15 @@ def launch(self) -> int:
get_default_value(self.__class__.__name__),
self.output_files, self.out_log)
else:
self.tmp_files.extend([self.basename + "." + self.unique_name + ".acpype"])
process_output_gmx(self.unique_name,
self.basename + "." + self.unique_name + ".acpype",
self.remove_tmp,
self.basename,
get_default_value(self.__class__.__name__),
self.output_files, self.out_log)

self.remove_tmp_files()
self.check_arguments(output_files_created=True, raise_exception=False)

return self.return_code
Expand All @@ -174,6 +176,8 @@ def acpype_params_gmx_opls(input_path: str, output_path_itp: str, output_path_to
output_path_top=output_path_top,
properties=properties, **kwargs).launch()

acpype_params_gmx_opls.__doc__ = AcpypeParamsGMXOPLS.__doc__


def main():
"""Command line execution of this building block. Please check the command line documentation."""
Expand Down
6 changes: 4 additions & 2 deletions biobb_chemistry/ambertools/reduce_add_hydrogens.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,9 @@ def launch(self) -> int:
self.copy_to_host()

# remove temporary folder(s)
self.tmp_files.extend([
'''self.tmp_files.extend([
self.stage_io_dict.get("unique_dir", "")
])
])'''
self.remove_tmp_files()

self.check_arguments(output_files_created=True, raise_exception=False)
Expand All @@ -213,6 +213,8 @@ def reduce_add_hydrogens(input_path: str, output_path: str, properties: Optional
output_path=output_path,
properties=properties, **kwargs).launch()

reduce_add_hydrogens.__doc__ = ReduceAddHydrogens.__doc__


def main():
"""Command line execution of this building block. Please check the command line documentation."""
Expand Down
6 changes: 4 additions & 2 deletions biobb_chemistry/ambertools/reduce_remove_hydrogens.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ def launch(self) -> int:
self.copy_to_host()

# remove temporary folder(s)
self.tmp_files.extend([
'''self.tmp_files.extend([
self.stage_io_dict.get("unique_dir", "")
])
])'''
self.remove_tmp_files()

self.check_arguments(output_files_created=True, raise_exception=False)
Expand All @@ -132,6 +132,8 @@ def reduce_remove_hydrogens(input_path: str, output_path: str, properties: Optio
output_path=output_path,
properties=properties, **kwargs).launch()

reduce_remove_hydrogens.__doc__ = ReduceRemoveHydrogens.__doc__


def main():
"""Command line execution of this building block. Please check the command line documentation."""
Expand Down
4 changes: 3 additions & 1 deletion biobb_chemistry/babelm/babel_add_hydrogens.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def launch(self) -> int:
self.copy_to_host()

# remove temporary folder(s)
self.tmp_files.extend([self.stage_io_dict.get("unique_dir", "")])
# self.tmp_files.extend([self.stage_io_dict.get("unique_dir", "")])
self.remove_tmp_files()

self.check_arguments(output_files_created=True, raise_exception=False)
Expand All @@ -212,6 +212,8 @@ def babel_add_hydrogens(
input_path=input_path, output_path=output_path, properties=properties, **kwargs
).launch()

babel_add_hydrogens.__doc__ = BabelAddHydrogens.__doc__


def main():
"""Command line execution of this building block. Please check the command line documentation."""
Expand Down
4 changes: 3 additions & 1 deletion biobb_chemistry/babelm/babel_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def launch(self) -> int:
self.copy_to_host()

# remove temporary folder(s)
self.tmp_files.extend([self.stage_io_dict.get("unique_dir", "")])
# self.tmp_files.extend([self.stage_io_dict.get("unique_dir", "")])
self.remove_tmp_files()

self.check_arguments(output_files_created=True, raise_exception=False)
Expand All @@ -213,6 +213,8 @@ def babel_convert(
input_path=input_path, output_path=output_path, properties=properties, **kwargs
).launch()

babel_convert.__doc__ = BabelConvert.__doc__


def main():
"""Command line execution of this building block. Please check the command line documentation."""
Expand Down
6 changes: 4 additions & 2 deletions biobb_chemistry/babelm/babel_minimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@ def launch(self) -> int:
self.copy_to_host()

# remove temporary folder(s)
self.tmp_files.extend([
'''self.tmp_files.extend([
self.stage_io_dict.get("unique_dir", "")
])
])'''
self.remove_tmp_files()

self.check_arguments(output_files_created=True, raise_exception=False)
Expand All @@ -188,6 +188,8 @@ def babel_minimize(input_path: str, output_path: str, properties: Optional[dict]
output_path=output_path,
properties=properties, **kwargs).launch()

babel_minimize.__doc__ = BabelMinimize.__doc__


def main():
"""Command line execution of this building block. Please check the command line documentation."""
Expand Down
4 changes: 3 additions & 1 deletion biobb_chemistry/babelm/babel_remove_hydrogens.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def launch(self) -> int:
self.copy_to_host()

# remove temporary folder(s)
self.tmp_files.extend([self.stage_io_dict.get("unique_dir", "")])
# self.tmp_files.extend([self.stage_io_dict.get("unique_dir", "")])
self.remove_tmp_files()

self.check_arguments(output_files_created=True, raise_exception=False)
Expand All @@ -209,6 +209,8 @@ def babel_remove_hydrogens(
input_path=input_path, output_path=output_path, properties=properties, **kwargs
).launch()

babel_remove_hydrogens.__doc__ = BabelRemoveHydrogens.__doc__


def main():
"""Command line execution of this building block. Please check the command line documentation."""
Expand Down

0 comments on commit f4e4519

Please sign in to comment.