Skip to content

Commit b160adb

Browse files
committed
Black formatting and import optimisation
1 parent ab88353 commit b160adb

File tree

18 files changed

+122
-84
lines changed

18 files changed

+122
-84
lines changed

autoprot/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import sys
2+
23
from . import common
3-
from . import r_helper
44
from . import decorators
5+
from . import r_helper
56

67
__version__ = "dev"
78
__author__ = "The autoprot contributors"
@@ -14,4 +15,4 @@
1415
# write the environment.txt file
1516
common.generate_environment_txt()
1617

17-
from . import preprocessing
18+
from . import preprocessing

autoprot/analysis/PCA.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,14 @@
99

1010
from typing import Union, Literal
1111

12-
import pandas as pd
13-
import numpy as np
1412
import matplotlib.pylab as plt
13+
import numpy as np
14+
import pandas as pd
1515
import seaborn as sns
16-
16+
from gprofiler import GProfiler
1717
from sklearn.decomposition import PCA
18-
from autoprot import r_helper
1918

20-
from gprofiler import GProfiler
19+
from autoprot import r_helper
2120

2221
gp = GProfiler(user_agent="autoprot", return_dataframe=True)
2322
RFUNCTIONS, R = r_helper.return_r_path()

autoprot/analysis/__init__.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1+
from .PCA import *
12
from .clustering import *
23
from .functional import *
3-
from .PCA import *
44
from .qc import *
55
from .stat_test import *
66
from .stats import *
77

88
# Optional: define what's exported when someone does `from analysis import *`
99
__all__ = [
10-
'clustering',
11-
'functional',
12-
'PCA',
13-
'qc',
14-
'stat_test',
15-
'stats',
16-
]
10+
"clustering",
11+
"functional",
12+
"PCA",
13+
"qc",
14+
"stat_test",
15+
"stats",
16+
]

autoprot/analysis/clustering.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
import matplotlib.pylab as plt
1717
import numpy as np
1818
import pandas as pd
19-
from pandas.api.types import is_numeric_dtype
2019
import seaborn as sns
2120
from gprofiler import GProfiler
2221
from numpy.typing import ArrayLike
22+
from pandas.api.types import is_numeric_dtype
2323
from scipy import cluster as clst
2424
from scipy.spatial import distance
2525
from scipy.stats import zscore

autoprot/analysis/functional.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@
1111
from importlib import resources
1212
from typing import Union, Literal, List, Dict, Any, Tuple
1313

14-
import pandas as pd
15-
import numpy as np
1614
import matplotlib.pylab as plt
15+
import numpy as np
16+
import pandas as pd
1717
import seaborn as sns
18+
from gprofiler import GProfiler
1819

19-
from autoprot import visualization as vis
2020
from autoprot import r_helper
21-
22-
from gprofiler import GProfiler
21+
from autoprot import visualization as vis
2322

2423
gp = GProfiler(user_agent="autoprot", return_dataframe=True)
2524
RFUNCTIONS, R = r_helper.return_r_path()

autoprot/analysis/qc.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,19 @@
77
@documentation: Julian
88
"""
99

10-
from typing import Literal
1110
from datetime import date
11+
from operator import itemgetter
12+
from typing import Literal
1213

13-
import pandas as pd
14-
import numpy as np
1514
import matplotlib.pylab as plt
16-
import seaborn as sns
17-
from operator import itemgetter
1815
import missingno as msn
16+
import numpy as np
17+
import pandas as pd
18+
import seaborn as sns
19+
from gprofiler import GProfiler
1920

2021
from autoprot import r_helper
2122

22-
from gprofiler import GProfiler
23-
2423
gp = GProfiler(user_agent="autoprot", return_dataframe=True)
2524
RFUNCTIONS, R = r_helper.return_r_path()
2625

autoprot/analysis/stats.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,14 @@
77
@documentation: Julian
88
"""
99

10-
import pandas as pd
11-
import numpy as np
1210
import matplotlib.pylab as plt
11+
import numpy as np
12+
import pandas as pd
1313
import seaborn as sns
14+
from gprofiler import GProfiler
1415

1516
from autoprot import r_helper
1617

17-
from gprofiler import GProfiler
18-
1918
gp = GProfiler(user_agent="autoprot", return_dataframe=True)
2019
RFUNCTIONS, R = r_helper.return_r_path()
2120

autoprot/preprocessing/__init__.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
from .annotation import *
22
from .data_handling import *
3+
from .diann import *
34
from .filtering import *
45
from .imputation import *
56
from .normalization import *
67
from .transformation import *
7-
from .diann import *
88

99
# Optional: define what's exported when someone does `from preprocessing import *`
1010
__all__ = [
11-
'annotation',
12-
'data_handling',
13-
'filtering',
14-
'imputation',
15-
'normalization',
16-
'transformation',
17-
'diann'
18-
]
11+
"annotation",
12+
"data_handling",
13+
"filtering",
14+
"imputation",
15+
"normalization",
16+
"transformation",
17+
"diann",
18+
]

autoprot/preprocessing/annotation.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,21 @@
1515
import numpy as np
1616
import pandas as pd
1717
import requests
18-
1918
from Bio import Align
19+
2020
from autoprot import r_helper, common
2121
from autoprot.decorators import report
2222

2323
RFUNCTIONS, R = r_helper.return_r_path()
2424

2525
# defines which functions are exposed at the module level
26-
__all__ = ['go_annot', 'motif_annot', 'annotate_phosphosite', 'to_canonical_ps', 'get_subcellular_loc']
26+
__all__ = [
27+
"go_annot",
28+
"motif_annot",
29+
"annotate_phosphosite",
30+
"to_canonical_ps",
31+
"get_subcellular_loc",
32+
]
2733

2834
# =============================================================================
2935
# Note: When using R functions provided column names might get changed

autoprot/preprocessing/data_handling.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,21 @@
77
@documentation: Julian
88
"""
99

10-
import pandas as pd
1110
import os
12-
import requests
13-
from urllib import parse
1411
from ftplib import FTP
12+
from urllib import parse
13+
14+
import pandas as pd
15+
import requests
1516

1617
# defines which functions are exposed at the module level
17-
__all__ = ['read_csv', 'to_csv', 'download_from_ftp', 'fetch_from_pride',]
18+
__all__ = [
19+
"read_csv",
20+
"to_csv",
21+
"download_from_ftp",
22+
"fetch_from_pride",
23+
]
24+
1825

1926
def read_csv(file, sep="\t", low_memory=False, **kwargs):
2027
r"""

0 commit comments

Comments
 (0)