Skip to content

Commit

Permalink
Change utils imports from wildcard to explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
breimanntools committed Sep 23, 2023
1 parent d669bb7 commit 11b9a11
Show file tree
Hide file tree
Showing 19 changed files with 396 additions and 284 deletions.
Binary file modified aaanalysis/__pycache__/utils.cpython-39.pyc
Binary file not shown.
1 change: 1 addition & 0 deletions aaanalysis/_utils/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Binary file modified aaanalysis/_utils/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file modified aaanalysis/_utils/__pycache__/_utils_check.cpython-39.pyc
Binary file not shown.
Binary file not shown.
Binary file modified aaanalysis/_utils/__pycache__/_utils_output.cpython-39.pyc
Binary file not shown.
Binary file modified aaanalysis/_utils/__pycache__/utils_aaclust.cpython-39.pyc
Binary file not shown.
Binary file modified aaanalysis/_utils/__pycache__/utils_cpp.cpython-39.pyc
Binary file not shown.
91 changes: 0 additions & 91 deletions aaanalysis/_utils/_utils_constants.py

This file was deleted.

1 change: 0 additions & 1 deletion aaanalysis/_utils/utils_aaclust.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
METRIC_CORRELATION = "correlation"
LIST_METRICS = [METRIC_CORRELATION, "manhattan", "euclidean", "cosine"]


# Check functions
def check_model(model=None, model_kwargs=None, except_None=True):
""""""
Expand Down
8 changes: 3 additions & 5 deletions aaanalysis/_utils/utils_cpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@
This is a script with utility functions and settings for CPP project.
"""
import numpy as np
import pandas as pd
import matplotlib.colors as mcolors
import matplotlib.pyplot as plt

import aaanalysis._utils._utils_constants as ut_c
import aaanalysis._utils._utils_check as ut_check
import aaanalysis._utils._utils_output as ut_o

# Settings

Expand Down Expand Up @@ -104,7 +101,7 @@ def _check_seq(seq, len_, name_seq, name_len):
raise ValueError(f"The length of {seq} ({len(seq)}) should be >= {name_len} ({len_}).")
return len(seq)


# TODO split in two (separation of concerns)
def check_args_len(tmd_len=None, jmd_n_len=None, jmd_c_len=None, ext_len=None,
tmd_seq=None, jmd_n_seq=None, jmd_c_seq=None, accept_tmd_none=False):
"""Check length parameters and if they are matching with sequences if provided"""
Expand All @@ -116,6 +113,7 @@ def check_args_len(tmd_len=None, jmd_n_len=None, jmd_c_len=None, ext_len=None,
ut_check.check_non_negative_number(name="ext_len", val=ext_len, accept_none=True)
# Check if lengths and sequences match
tmd_len = _check_seq(tmd_seq, tmd_len, "tmd_seq", "tmd_len")
print(jmd_n_seq)
jmd_n_len = _check_seq(jmd_n_seq, jmd_n_len, "jmd_n_seq", "jmd_n_len")
jmd_c_len = _check_seq(jmd_c_seq, jmd_c_len, "jmd_c_seq", "jmd_c_len")
# Check if lengths are matching
Expand Down Expand Up @@ -269,7 +267,7 @@ def check_split(split=None):

# Scale functions
def get_dict_all_scales(df_scales=None):
"""Get nested dictionary where each scales is a key for a amino acid scale value dictionary"""
"""Get nested dictionary where each scale is a key for an amino acid scale value dictionary"""
dict_all_scales = {col: dict(zip(df_scales.index.to_list(), df_scales[col])) for col in list(df_scales)}
return dict_all_scales

Expand Down
Binary file modified aaanalysis/cpp/__pycache__/feature.cpython-39.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion aaanalysis/cpp/feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def _feature_matrix(feat_names, dict_all_scales, df_parts, accept_gaps):
accept_gaps=accept_gaps)
return feat_matrix


# II Main Functions
class SequenceFeature:
"""Retrieve and create sequence feature components (Part, Split, and Scale).
Expand Down
Loading

0 comments on commit 11b9a11

Please sign in to comment.