Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

v1.0.1 (Sourcery refactored) #67

Merged
merged 1 commit into from
Oct 6, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions ifpd2/scripts/db/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,11 @@ def main(
settings.prefix = prefix

assert not (
0 == len(settings.off_target_paths)
and 0 != len(settings.melting_temperature_paths)
len(settings.off_target_paths) == 0
and len(settings.melting_temperature_paths) != 0
), "please provide either --hush or --melting"

Comment on lines -104 to 107
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function main refactored with the following changes:


os.mkdir(settings.output_path)
dbdf = pd.DataFrame(columns=["name"])
dbdf.set_index("name", inplace=True)
Expand Down Expand Up @@ -141,7 +142,7 @@ def main(
def parse_input(
path_list: Set[str], parse_function: Callable, software_name: str
) -> pd.DataFrame:
if len(path_list) == 0:
if not path_list:
Comment on lines -144 to +145
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function parse_input refactored with the following changes:

return pd.DataFrame()
logging.info(f"parsing {software_name} output")
return pd.concat([parse_function(path) for path in path_list])
Expand All @@ -153,7 +154,7 @@ def populate_db(
parse_function: Callable,
software_name: str,
) -> pd.DataFrame:
if len(path_list) == 0:
if not path_list:
Comment on lines -156 to +157
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function populate_db refactored with the following changes:

return db
parsed_db = parse_input(path_list, parse_function, software_name)
logging.info(f"adding {software_name} output to database")
Expand Down