From 9999cbbfb86febe3dc5b17d31df6c4f38a0ab806 Mon Sep 17 00:00:00 2001 From: Pau Andrio Date: Thu, 17 Oct 2024 13:45:19 +0200 Subject: [PATCH] [TYPING](ALL): Fix typing errors --- biobb_pmx/docs/source/conf.py | 15 +++++++-------- biobb_pmx/pmxbiobb/pmxanalyse.py | 7 ++++--- biobb_pmx/pmxbiobb/pmxatom_mapping.py | 7 ++++--- biobb_pmx/pmxbiobb/pmxcreate_top.py | 7 ++++--- biobb_pmx/pmxbiobb/pmxgentop.py | 7 ++++--- biobb_pmx/pmxbiobb/pmxligand_hybrid.py | 7 ++++--- biobb_pmx/pmxbiobb/pmxmerge_ff.py | 7 ++++--- biobb_pmx/pmxbiobb/pmxmutate.py | 7 ++++--- 8 files changed, 35 insertions(+), 29 deletions(-) diff --git a/biobb_pmx/docs/source/conf.py b/biobb_pmx/docs/source/conf.py index 2734acc..2ea0a06 100644 --- a/biobb_pmx/docs/source/conf.py +++ b/biobb_pmx/docs/source/conf.py @@ -14,7 +14,6 @@ import sys from pathlib import Path -from typing import List, Dict # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the @@ -92,9 +91,9 @@ # Else, today_fmt is used as the format for a strftime call. # today_fmt = '%B %d, %Y' -# List of patterns, relative to source directory, that match files and +# list of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. -exclude_patterns: List[str] = [] +exclude_patterns: list[str] = [] # The reST default role (used for this markup: `text`) to use for all # documents. @@ -120,7 +119,7 @@ # If true, keep warnings as "system message" paragraphs in the built documents. # keep_warnings = False -# If true, `todo` and `todoList` produce output, else they produce nothing. +# If true, `todo` and `todolist` produce output, else they produce nothing. todo_include_todos = False @@ -228,7 +227,7 @@ def setup(app): # -- Options for LaTeX output --------------------------------------------- -latex_elements: Dict[str, str] = { +latex_elements: dict[str, str] = { # The paper size ('letterpaper' or 'a4paper'). # 'papersize': 'letterpaper', @@ -242,7 +241,7 @@ def setup(app): # 'figure_align': 'htbp', } -# Grouping the document tree into LaTeX files. List of tuples +# Grouping the document tree into LaTeX files. list of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ @@ -273,7 +272,7 @@ def setup(app): # -- Options for manual page output --------------------------------------- -# One entry per manual page. List of tuples +# One entry per manual page. list of tuples # (source start file, name, description, authors, manual section). man_pages = [ (master_doc, 'biobb_pmx', u'biobb_pmx Documentation', @@ -286,7 +285,7 @@ def setup(app): # -- Options for Texinfo output ------------------------------------------- -# Grouping the document tree into Texinfo files. List of tuples +# Grouping the document tree into Texinfo files. list of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ diff --git a/biobb_pmx/pmxbiobb/pmxanalyse.py b/biobb_pmx/pmxbiobb/pmxanalyse.py index 3859b98..6a16941 100755 --- a/biobb_pmx/pmxbiobb/pmxanalyse.py +++ b/biobb_pmx/pmxbiobb/pmxanalyse.py @@ -2,9 +2,10 @@ """Module containing the PMX analyse class and the command line interface.""" import argparse +from typing import Optional from pathlib import Path import shutil -from typing import Dict, Optional +from typing import Optional from biobb_common.generic.biobb_object import BiobbObject from biobb_common.configuration import settings from biobb_common.tools import file_utils as fu @@ -76,7 +77,7 @@ class Pmxanalyse(BiobbObject): """ def __init__(self, input_a_xvg_zip_path: str, input_b_xvg_zip_path: str, output_result_path: str, output_work_plot_path: str, - properties: Optional[Dict] = None, **kwargs) -> None: + properties: Optional[dict] = None, **kwargs) -> None: properties = properties or {} # Call parent class constructor @@ -210,7 +211,7 @@ def launch(self) -> int: def pmxanalyse(input_a_xvg_zip_path: str, input_b_xvg_zip_path: str, output_result_path: str, output_work_plot_path: str, - properties: Optional[Dict] = None, **kwargs) -> int: + properties: Optional[dict] = None, **kwargs) -> int: """Execute the :class:`Pmxanalyse ` class and execute the :meth:`launch() method.""" diff --git a/biobb_pmx/pmxbiobb/pmxatom_mapping.py b/biobb_pmx/pmxbiobb/pmxatom_mapping.py index 65ec500..5ef3423 100755 --- a/biobb_pmx/pmxbiobb/pmxatom_mapping.py +++ b/biobb_pmx/pmxbiobb/pmxatom_mapping.py @@ -6,7 +6,8 @@ from pathlib import Path import shutil import argparse -from typing import Dict, Optional +from typing import Optional +from typing import Optional from biobb_common.generic.biobb_object import BiobbObject from biobb_common.configuration import settings from biobb_common.tools.file_utils import launchlogger @@ -83,7 +84,7 @@ class Pmxatom_mapping(BiobbObject): def __init__(self, input_structure1_path: str, input_structure2_path: str, output_pairs1_path: str, output_pairs2_path: str, output_log_path: str, output_structure1_path: Optional[str] = None, output_structure2_path: Optional[str] = None, output_morph1_path: Optional[str] = None, output_morph2_path: Optional[str] = None, output_scaffold1_path: Optional[str] = None, output_scaffold2_path: Optional[str] = None, output_score_path: Optional[str] = None, - properties: Optional[Dict] = None, **kwargs) -> None: + properties: Optional[dict] = None, **kwargs) -> None: properties = properties or {} # Call parent class constructor @@ -236,7 +237,7 @@ def launch(self) -> int: def pmxatom_mapping(input_structure1_path: str, input_structure2_path: str, output_pairs1_path: str, output_pairs2_path: str, output_log_path: str, output_structure1_path: Optional[str] = None, output_structure2_path: Optional[str] = None, output_morph1_path: Optional[str] = None, output_morph2_path: Optional[str] = None, output_scaffold1_path: Optional[str] = None, output_scaffold2_path: Optional[str] = None, output_score_path: Optional[str] = None, - properties: Optional[Dict] = None, **kwargs) -> int: + properties: Optional[dict] = None, **kwargs) -> int: """Execute the :class:`Pmxatom_mapping ` class and execute the :meth:`launch() method.""" diff --git a/biobb_pmx/pmxbiobb/pmxcreate_top.py b/biobb_pmx/pmxbiobb/pmxcreate_top.py index 53b10f7..0dd7a0b 100755 --- a/biobb_pmx/pmxbiobb/pmxcreate_top.py +++ b/biobb_pmx/pmxbiobb/pmxcreate_top.py @@ -6,7 +6,8 @@ from pathlib import Path, PurePath import shutil import argparse -from typing import Dict, Optional +from typing import Optional +from typing import Optional from biobb_common.generic.biobb_object import BiobbObject from biobb_common.configuration import settings from biobb_common.tools import file_utils as fu @@ -63,7 +64,7 @@ class Pmxcreate_top(BiobbObject): """ def __init__(self, input_topology1_path: str, input_topology2_path: str, output_topology_path: str, - properties: Optional[Dict] = None, **kwargs) -> None: + properties: Optional[dict] = None, **kwargs) -> None: properties = properties or {} # Call parent class constructor @@ -173,7 +174,7 @@ def launch(self) -> int: def pmxcreate_top(input_topology1_path: str, input_topology2_path: str, output_topology_path: str, - properties: Optional[Dict] = None, **kwargs) -> int: + properties: Optional[dict] = None, **kwargs) -> int: """Execute the :class:`Pmxcreate_top ` class and execute the :meth:`launch() method.""" diff --git a/biobb_pmx/pmxbiobb/pmxgentop.py b/biobb_pmx/pmxbiobb/pmxgentop.py index fdbb845..712acdf 100755 --- a/biobb_pmx/pmxbiobb/pmxgentop.py +++ b/biobb_pmx/pmxbiobb/pmxgentop.py @@ -4,9 +4,10 @@ import os import sys import argparse +from typing import Optional import shutil from pathlib import Path -from typing import Dict, Optional +from typing import Optional from biobb_common.generic.biobb_object import BiobbObject from biobb_common.configuration import settings from biobb_common.tools import file_utils as fu @@ -62,7 +63,7 @@ class Pmxgentop(BiobbObject): """ def __init__(self, input_top_zip_path: str, output_top_zip_path: str, - properties: Optional[Dict] = None, **kwargs) -> None: + properties: Optional[dict] = None, **kwargs) -> None: properties = properties or {} # Call parent class constructor @@ -179,7 +180,7 @@ def launch(self) -> int: return self.return_code -def pmxgentop(input_top_zip_path: str, output_top_zip_path: str, properties: Optional[Dict] = None, **kwargs) -> int: +def pmxgentop(input_top_zip_path: str, output_top_zip_path: str, properties: Optional[dict] = None, **kwargs) -> int: """Execute the :class:`Pmxgentop ` class and execute the :meth:`launch() method.""" diff --git a/biobb_pmx/pmxbiobb/pmxligand_hybrid.py b/biobb_pmx/pmxbiobb/pmxligand_hybrid.py index 257c66c..f7856aa 100755 --- a/biobb_pmx/pmxbiobb/pmxligand_hybrid.py +++ b/biobb_pmx/pmxbiobb/pmxligand_hybrid.py @@ -6,7 +6,8 @@ from pathlib import Path import shutil import argparse -from typing import Dict, Optional +from typing import Optional +from typing import Optional from biobb_common.generic.biobb_object import BiobbObject from biobb_common.configuration import settings from biobb_common.tools.file_utils import launchlogger @@ -84,7 +85,7 @@ class Pmxligand_hybrid(BiobbObject): def __init__(self, input_structure1_path: str, input_structure2_path: str, input_topology1_path: str, input_topology2_path: str, output_log_path: str, output_structure1_path: str, output_structure2_path: str, output_topology_path: str, output_atomtypes_path: str, input_scaffold1_path: Optional[str] = None, input_scaffold2_path: Optional[str] = None, input_pairs_path: Optional[str] = None, - properties: Optional[Dict] = None, **kwargs) -> None: + properties: Optional[dict] = None, **kwargs) -> None: properties = properties or {} @@ -209,7 +210,7 @@ def launch(self) -> int: def pmxligand_hybrid(input_structure1_path: str, input_structure2_path: str, input_topology1_path: str, input_topology2_path: str, output_log_path: str, output_structure1_path: str, output_structure2_path: str, output_topology_path: str, output_atomtypes_path: str, input_scaffold1_path: Optional[str] = None, input_scaffold2_path: Optional[str] = None, input_pairs_path: Optional[str] = None, - properties: Optional[Dict] = None, **kwargs) -> int: + properties: Optional[dict] = None, **kwargs) -> int: """Execute the :class:`Pmxligand_hybrid ` class and execute the :meth:`launch() method.""" diff --git a/biobb_pmx/pmxbiobb/pmxmerge_ff.py b/biobb_pmx/pmxbiobb/pmxmerge_ff.py index e3ada92..a3a59d0 100755 --- a/biobb_pmx/pmxbiobb/pmxmerge_ff.py +++ b/biobb_pmx/pmxbiobb/pmxmerge_ff.py @@ -6,8 +6,9 @@ from pathlib import Path import glob import argparse +from typing import Optional from pmx import ligand_alchemy # type: ignore -from typing import Dict, Optional +from typing import Optional from biobb_common.generic.biobb_object import BiobbObject from biobb_common.configuration import settings from biobb_common.tools import file_utils as fu @@ -57,7 +58,7 @@ class Pmxmerge_ff(BiobbObject): """ - def __init__(self, input_topology_path: str, output_topology_path: str, properties: Optional[Dict] = None, **kwargs) -> None: + def __init__(self, input_topology_path: str, output_topology_path: str, properties: Optional[dict] = None, **kwargs) -> None: properties = properties or {} # Call parent class constructor @@ -128,7 +129,7 @@ def launch(self) -> int: return self.return_code -def pmxmerge_ff(input_topology_path: str, output_topology_path: str, properties: Optional[Dict] = None, **kwargs) -> int: +def pmxmerge_ff(input_topology_path: str, output_topology_path: str, properties: Optional[dict] = None, **kwargs) -> int: """Execute the :class:`Pmxmerge_ff ` class and execute the :meth:`launch() method.""" diff --git a/biobb_pmx/pmxbiobb/pmxmutate.py b/biobb_pmx/pmxbiobb/pmxmutate.py index fc20fea..f07f4d3 100755 --- a/biobb_pmx/pmxbiobb/pmxmutate.py +++ b/biobb_pmx/pmxbiobb/pmxmutate.py @@ -6,7 +6,8 @@ import sys import shutil import argparse -from typing import Dict, Optional +from typing import Optional +from typing import Optional from biobb_pmx.pmxbiobb.common import create_mutations_file, MUTATION_DICT from biobb_common.generic.biobb_object import BiobbObject from biobb_common.configuration import settings @@ -66,7 +67,7 @@ class Pmxmutate(BiobbObject): """ def __init__(self, input_structure_path: str, output_structure_path: str, input_b_structure_path: Optional[str] = None, - properties: Optional[Dict] = None, **kwargs) -> None: + properties: Optional[dict] = None, **kwargs) -> None: properties = properties or {} # Call parent class constructor @@ -158,7 +159,7 @@ def launch(self) -> int: def pmxmutate(input_structure_path: str, output_structure_path: str, - input_b_structure_path: Optional[str] = None, properties: Optional[Dict] = None, + input_b_structure_path: Optional[str] = None, properties: Optional[dict] = None, **kwargs) -> int: """Execute the :class:`Pmxmutate ` class and execute the :meth:`launch() method."""