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 6364668 commit 7d11690
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
11 changes: 6 additions & 5 deletions biobb_cp2k/cp2k/cp2k_prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

"""Module containing the Cp2kPrep class and the command line interface."""
import argparse
from typing import Optional
import os
import collections.abc
from pathlib import Path
Expand Down Expand Up @@ -54,8 +55,8 @@ class Cp2kPrep(BiobbObject):
"""

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

properties = properties or {}

Expand Down Expand Up @@ -416,7 +417,7 @@ def launch(self):
self.iterdict(final_dict2, 0, cp2k_out_fh)

self.tmp_files.extend([
self.stage_io_dict.get("unique_dir")
self.stage_io_dict.get("unique_dir", "")
])
self.remove_tmp_files()

Expand All @@ -426,8 +427,8 @@ def launch(self):


def cp2k_prep(output_inp_path: str,
input_inp_path: str = None, input_pdb_path: str = None, input_rst_path: str = None,
properties: dict = None, **kwargs) -> int:
input_inp_path: Optional[str] = None, input_pdb_path: Optional[str] = None, input_rst_path: Optional[str] = None,
properties: Optional[dict] = None, **kwargs) -> int:
"""Create :class:`Cp2kPrep <cp2k.cp2k_prep.Cp2kPrep>`cp2k.cp2k_prep.Cp2kPrep class and
execute :meth:`launch() <cp2k.cp2k_prep.Cp2kPrep.launch>` method"""

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

"""Module containing the Cp2kRun class and the command line interface."""
import argparse
from typing import Optional
import shutil
import os
from pathlib import Path, PurePath
Expand Down Expand Up @@ -60,7 +61,7 @@ class Cp2kRun(BiobbObject):

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

properties = properties or {}

Expand Down Expand Up @@ -179,7 +180,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.tmp_folder
])
self.remove_tmp_files()
Expand All @@ -191,7 +192,7 @@ def launch(self):

def cp2k_run(input_inp_path: str,
output_log_path: str, output_outzip_path: str, output_rst_path: str,
properties: dict = None, **kwargs) -> int:
properties: Optional[dict] = None, **kwargs) -> int:
"""Create :class:`Cp2kRun <cp2k.cp2k_run.Cp2kRun>`cp2k.cp2k_run.Cp2kRun class and
execute :meth:`launch() <cp2k.cp2k_run.Cp2kRun.launch>` method"""

Expand Down

0 comments on commit 7d11690

Please sign in to comment.