Skip to content

Commit

Permalink
[TYPING](ALL): Fix typing errors
Browse files Browse the repository at this point in the history
  • Loading branch information
PauAndrio committed Oct 17, 2024
1 parent 84b7fef commit a74c035
Show file tree
Hide file tree
Showing 14 changed files with 45 additions and 31 deletions.
7 changes: 4 additions & 3 deletions biobb_flexserv/flexserv/bd_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

"""Module containing the bd_run class and the command line interface."""
import argparse
from typing import Optional
from pathlib import Path
from biobb_common.generic.biobb_object import BiobbObject
from biobb_common.configuration import settings
Expand Down Expand Up @@ -51,7 +52,7 @@ class BDRun(BiobbObject):
"""

def __init__(self, input_pdb_path: str, output_log_path: str,
output_crd_path: str, properties: dict = None, **kwargs) -> None:
output_crd_path: str, properties: Optional[dict] = None, **kwargs) -> None:

properties = properties or {}

Expand Down Expand Up @@ -120,7 +121,7 @@ def launch(self):

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

Expand All @@ -131,7 +132,7 @@ def launch(self):

def bd_run(input_pdb_path: str,
output_log_path: str, output_crd_path: str,
properties: dict = None, **kwargs) -> int:
properties: Optional[dict] = None, **kwargs) -> int:
"""Create :class:`BDRun <flexserv.bd_run.BDRun>`flexserv.bd_run.BDRun class and
execute :meth:`launch() <flexserv.bd_run.BDRun.launch>` method"""

Expand Down
7 changes: 4 additions & 3 deletions biobb_flexserv/flexserv/dmd_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

"""Module containing the dmd_run class and the command line interface."""
import argparse
from typing import Optional
from pathlib import Path
from biobb_common.generic.biobb_object import BiobbObject
from biobb_common.configuration import settings
Expand Down Expand Up @@ -51,7 +52,7 @@ class DMDRun(BiobbObject):
"""

def __init__(self, input_pdb_path: str, output_log_path: str,
output_crd_path: str, properties: dict = None, **kwargs) -> None:
output_crd_path: str, properties: Optional[dict] = None, **kwargs) -> None:

properties = properties or {}

Expand Down Expand Up @@ -131,7 +132,7 @@ def launch(self):

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

Expand All @@ -142,7 +143,7 @@ def launch(self):

def dmd_run(input_pdb_path: str,
output_log_path: str, output_crd_path: str,
properties: dict = None, **kwargs) -> int:
properties: Optional[dict] = None, **kwargs) -> int:
"""Create :class:`DMDRun <flexserv.dmd_run.DMDRun>`flexserv.dmd_run.DMDRun class and
execute :meth:`launch() <flexserv.dmd_run.DMDRun.launch>` method"""

Expand Down
7 changes: 4 additions & 3 deletions biobb_flexserv/flexserv/nma_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

"""Module containing the nma_run class and the command line interface."""
import argparse
from typing import Optional
import os
from pathlib import Path
from biobb_common.generic.biobb_object import BiobbObject
Expand Down Expand Up @@ -51,7 +52,7 @@ class NMARun(BiobbObject):
"""

def __init__(self, input_pdb_path: str, output_log_path: str,
output_crd_path: str, properties: dict = None, **kwargs) -> None:
output_crd_path: str, properties: Optional[dict] = None, **kwargs) -> None:

properties = properties or {}

Expand Down Expand Up @@ -132,7 +133,7 @@ def launch(self):

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

Expand All @@ -143,7 +144,7 @@ def launch(self):

def nma_run(input_pdb_path: str,
output_log_path: str, output_crd_path: str,
properties: dict = None, **kwargs) -> int:
properties: Optional[dict] = None, **kwargs) -> int:
"""Create :class:`NMARun <flexserv.nma_run.NMARun>`flexserv.nma_run.NMARun class and
execute :meth:`launch() <flexserv.nma_run.NMARun.launch>` method"""

Expand Down
5 changes: 3 additions & 2 deletions biobb_flexserv/pcasuite/pcz_animate.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

"""Module containing the PCZanimate class and the command line interface."""
import argparse
from typing import Optional
import shutil
from pathlib import PurePath
from biobb_common.tools import file_utils as fu
Expand Down Expand Up @@ -51,7 +52,7 @@ class PCZanimate(BiobbObject):
"""

def __init__(self, input_pcz_path: str,
output_crd_path: str, properties: dict = None, **kwargs) -> None:
output_crd_path: str, properties: Optional[dict] = None, **kwargs) -> None:

properties = properties or {}

Expand Down Expand Up @@ -146,7 +147,7 @@ def launch(self):


def pcz_animate(input_pcz_path: str, output_crd_path: str,
properties: dict = None, **kwargs) -> int:
properties: Optional[dict] = None, **kwargs) -> int:
"""Create :class:`PCZanimate <flexserv.pcasuite.pcz_animate>`flexserv.pcasuite.PCZanimate class and
execute :meth:`launch() <flexserv.pcasuite.pcz_animate.launch>` method"""

Expand Down
5 changes: 3 additions & 2 deletions biobb_flexserv/pcasuite/pcz_bfactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

"""Module containing the PCZbfactor class and the command line interface."""
import argparse
from typing import Optional
import shutil
from pathlib import PurePath
from biobb_common.tools import file_utils as fu
Expand Down Expand Up @@ -53,7 +54,7 @@ class PCZbfactor(BiobbObject):
"""

def __init__(self, input_pcz_path: str, output_dat_path: str,
output_pdb_path: str, properties: dict = None, **kwargs) -> None:
output_pdb_path: str, properties: Optional[dict] = None, **kwargs) -> None:

properties = properties or {}

Expand Down Expand Up @@ -176,7 +177,7 @@ def launch(self):


def pcz_bfactor(input_pcz_path: str, output_dat_path: str, output_pdb_path: str,
properties: dict = None, **kwargs) -> int:
properties: Optional[dict] = None, **kwargs) -> int:
"""Create :class:`PCZbfactor <flexserv.pcasuite.pcz_bfactor>`flexserv.pcasuite.PCZbfactor class and
execute :meth:`launch() <flexserv.pcasuite.pcz_bfactor.launch>` method"""

Expand Down
5 changes: 3 additions & 2 deletions biobb_flexserv/pcasuite/pcz_collectivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

"""Module containing the PCZcollectivity class and the command line interface."""
import argparse
from typing import Optional
import shutil
from pathlib import PurePath
from biobb_common.tools import file_utils as fu
Expand Down Expand Up @@ -52,7 +53,7 @@ class PCZcollectivity(BiobbObject):
"""

def __init__(self, input_pcz_path: str,
output_json_path: str, properties: dict = None, **kwargs) -> None:
output_json_path: str, properties: Optional[dict] = None, **kwargs) -> None:

properties = properties or {}

Expand Down Expand Up @@ -162,7 +163,7 @@ def launch(self):


def pcz_collectivity(input_pcz_path: str, output_json_path: str,
properties: dict = None, **kwargs) -> int:
properties: Optional[dict] = None, **kwargs) -> int:
"""Create :class:`PCZcollectivity <flexserv.pcasuite.pcz_collectivity>`flexserv.pcasuite.PCZcollectivity class and
execute :meth:`launch() <flexserv.pcasuite.pcz_collectivity.launch>` method"""

Expand Down
5 changes: 3 additions & 2 deletions biobb_flexserv/pcasuite/pcz_evecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

"""Module containing the PCZevecs class and the command line interface."""
import argparse
from typing import Optional
import shutil
import json
import math
Expand Down Expand Up @@ -53,7 +54,7 @@ class PCZevecs(BiobbObject):
"""

def __init__(self, input_pcz_path: str,
output_json_path: str, properties: dict = None, **kwargs) -> None:
output_json_path: str, properties: Optional[dict] = None, **kwargs) -> None:

properties = properties or {}

Expand Down Expand Up @@ -180,7 +181,7 @@ def launch(self):


def pcz_evecs(input_pcz_path: str, output_json_path: str,
properties: dict = None, **kwargs) -> int:
properties: Optional[dict] = None, **kwargs) -> int:
"""Create :class:`PCZevecs <flexserv.pcasuite.pcz_evecs>`flexserv.pcasuite.PCZevecs class and
execute :meth:`launch() <flexserv.pcasuite.pcz_evecs.launch>` method"""

Expand Down
5 changes: 3 additions & 2 deletions biobb_flexserv/pcasuite/pcz_hinges.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

"""Module containing the PCZhinges class and the command line interface."""
import argparse
from typing import Optional
import shutil
import json
import re
Expand Down Expand Up @@ -53,7 +54,7 @@ class PCZhinges(BiobbObject):
"""

def __init__(self, input_pcz_path: str, output_json_path: str,
properties: dict = None, **kwargs) -> None:
properties: Optional[dict] = None, **kwargs) -> None:

properties = properties or {}

Expand Down Expand Up @@ -244,7 +245,7 @@ def launch(self):


def pcz_hinges(input_pcz_path: str, output_json_path: str,
properties: dict = None, **kwargs) -> int:
properties: Optional[dict] = None, **kwargs) -> int:
"""Create :class:`PCZhinges <flexserv.pcasuite.pcz_hinges>`flexserv.pcasuite.PCZhinges class and
execute :meth:`launch() <flexserv.pcasuite.pcz_hinges.launch>` method"""

Expand Down
5 changes: 3 additions & 2 deletions biobb_flexserv/pcasuite/pcz_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

"""Module containing the PCZinfo class and the command line interface."""
import argparse
from typing import Optional
import shutil
import json
from pathlib import PurePath
Expand Down Expand Up @@ -46,7 +47,7 @@ class PCZinfo(BiobbObject):
"""

def __init__(self, input_pcz_path: str,
output_json_path: str, properties: dict = None, **kwargs) -> None:
output_json_path: str, properties: Optional[dict] = None, **kwargs) -> None:

properties = properties or {}

Expand Down Expand Up @@ -192,7 +193,7 @@ def launch(self):


def pcz_info(input_pcz_path: str, output_json_path: str,
properties: dict = None, **kwargs) -> int:
properties: Optional[dict] = None, **kwargs) -> int:
"""Create :class:`PCZinfo <flexserv.pcasuite.pcz_info>`flexserv.pcasuite.PCZinfo class and
execute :meth:`launch() <flexserv.pcasuite.pcz_info.launch>` method"""

Expand Down
5 changes: 3 additions & 2 deletions biobb_flexserv/pcasuite/pcz_lindemann.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

"""Module containing the PCZlindemann class and the command line interface."""
import argparse
from typing import Optional
import shutil
import json
from pathlib import PurePath
Expand Down Expand Up @@ -50,7 +51,7 @@ class PCZlindemann(BiobbObject):
"""

def __init__(self, input_pcz_path: str,
output_json_path: str, properties: dict = None, **kwargs) -> None:
output_json_path: str, properties: Optional[dict] = None, **kwargs) -> None:

properties = properties or {}

Expand Down Expand Up @@ -160,7 +161,7 @@ def launch(self):


def pcz_lindemann(input_pcz_path: str, output_json_path: str,
properties: dict = None, **kwargs) -> int:
properties: Optional[dict] = None, **kwargs) -> int:
"""Create :class:`PCZlindemann <flexserv.pcasuite.pcz_lindemann>`flexserv.pcasuite.PCZlindemann class and
execute :meth:`launch() <flexserv.pcasuite.pcz_lindemann.launch>` method"""

Expand Down
5 changes: 3 additions & 2 deletions biobb_flexserv/pcasuite/pcz_similarity.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

"""Module containing the PCZsimilarity class and the command line interface."""
import argparse
from typing import Optional
import json
import numpy as np
import shutil
Expand Down Expand Up @@ -52,7 +53,7 @@ class PCZsimilarity(BiobbObject):
"""

def __init__(self, input_pcz_path1: str, input_pcz_path2: str,
output_json_path: str, properties: dict = None, **kwargs) -> None:
output_json_path: str, properties: Optional[dict] = None, **kwargs) -> None:

properties = properties or {}

Expand Down Expand Up @@ -470,7 +471,7 @@ def launch(self):


def pcz_similarity(input_pcz_path1: str, input_pcz_path2: str, output_json_path: str,
properties: dict = None, **kwargs) -> int:
properties: Optional[dict] = None, **kwargs) -> int:
"""Create :class:`PCZsimilarity <flexserv.pcasuite.pcz_similarity>`flexserv.pcasuite.PCZsimilarity class and
execute :meth:`launch() <flexserv.pcasuite.pcz_similarity.launch>` method"""

Expand Down
5 changes: 3 additions & 2 deletions biobb_flexserv/pcasuite/pcz_stiffness.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

"""Module containing the PCZstiffness class and the command line interface."""
import argparse
from typing import Optional
import shutil
import json
import math
Expand Down Expand Up @@ -54,7 +55,7 @@ class PCZstiffness(BiobbObject):
"""

def __init__(self, input_pcz_path: str,
output_json_path: str, properties: dict = None, **kwargs) -> None:
output_json_path: str, properties: Optional[dict] = None, **kwargs) -> None:

properties = properties or {}

Expand Down Expand Up @@ -180,7 +181,7 @@ def launch(self):


def pcz_stiffness(input_pcz_path: str, output_json_path: str,
properties: dict = None, **kwargs) -> int:
properties: Optional[dict] = None, **kwargs) -> int:
"""Create :class:`PCZstiffness <flexserv.pcasuite.pcz_stiffness>`flexserv.pcasuite.PCZstiffness class and
execute :meth:`launch() <flexserv.pcasuite.pcz_stiffness.launch>` method"""

Expand Down
5 changes: 3 additions & 2 deletions biobb_flexserv/pcasuite/pcz_unzip.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

"""Module containing the PCZunzip class and the command line interface."""
import argparse
from typing import Optional
import shutil
from pathlib import PurePath
from biobb_common.tools import file_utils as fu
Expand Down Expand Up @@ -50,7 +51,7 @@ class PCZunzip(BiobbObject):
"""

def __init__(self, input_pcz_path: str,
output_crd_path: str, properties: dict = None, **kwargs) -> None:
output_crd_path: str, properties: Optional[dict] = None, **kwargs) -> None:

properties = properties or {}

Expand Down Expand Up @@ -147,7 +148,7 @@ def launch(self):

def pcz_unzip(input_pcz_path: str,
output_crd_path: str,
properties: dict = None, **kwargs) -> int:
properties: Optional[dict] = None, **kwargs) -> int:
"""Create :class:`PCZunzip <flexserv.pcasuite.PCZunzip>`flexserv.pcasuite.PCZunzip class and
execute :meth:`launch() <flexserv.pcasuite.PCZunzip.launch>` method"""

Expand Down
5 changes: 3 additions & 2 deletions biobb_flexserv/pcasuite/pcz_zip.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

"""Module containing the PCAzip class and the command line interface."""
import argparse
from typing import Optional
import shutil
from pathlib import PurePath
from biobb_common.tools import file_utils as fu
Expand Down Expand Up @@ -54,7 +55,7 @@ class PCZzip(BiobbObject):
"""

def __init__(self, input_pdb_path: str, input_crd_path: str,
output_pcz_path: str, properties: dict = None, **kwargs) -> None:
output_pcz_path: str, properties: Optional[dict] = None, **kwargs) -> None:

properties = properties or {}

Expand Down Expand Up @@ -168,7 +169,7 @@ def launch(self):

def pcz_zip(input_pdb_path: str, input_crd_path: str,
output_pcz_path: str,
properties: dict = None, **kwargs) -> int:
properties: Optional[dict] = None, **kwargs) -> int:
"""Create :class:`PCZzip <flexserv.pcasuite.PCZzip>`flexserv.pcasuite.PCZzip class and
execute :meth:`launch() <flexserv.pcasuite.PCZzip.launch>` method"""

Expand Down

0 comments on commit a74c035

Please sign in to comment.