loosolab / TF-COMB

Transcription Factor Co-Occurrence using Market Basket analysis
https://tf-comb.readthedocs.io
MIT License
10 stars 1 forks source link

Inconsistent style/spacing in distances.py #9

Closed msbentsen closed 3 years ago

msbentsen commented 3 years ago

Hey, I noticed some inconsistencies in the spacings, especially within the function arguments. We will conform to the PEP 8 python style guide, in particular https://www.python.org/dev/peps/pep-0008/#whitespace-in-expressions-and-statements.

So always space between elements in a list, e.g. def plot_dens(self,targets,dataSource,bwadjust = 1,save = None): should rather be: def plot_dens(self, targets, dataSource, bwadjust=1, save=None):

And space around '==':

            weights = list(source_table.loc[((source_table["TF1"]==pair[0]) &
                                       (source_table["TF2"]==pair[1]))].iloc[0, 2:])

Should rather be:

            weights = list(source_table.loc[((source_table["TF1"] == pair[0]) &
                                       (source_table["TF2"] == pair[1]))].iloc[0, 2:])

Some more examples which could use some work: https://github.com/loosolab/TF-COMB/blob/306e2db9e6dac680e822a37b96768aa005b50d9f/tfcomb/distances.py#L937-L946

https://github.com/loosolab/TF-COMB/blob/306e2db9e6dac680e822a37b96768aa005b50d9f/tfcomb/distances.py#L415-L421

https://github.com/loosolab/TF-COMB/blob/306e2db9e6dac680e822a37b96768aa005b50d9f/tfcomb/distances.py#L295-L304

vheger commented 3 years ago

Yes, good Point It's already on my To-Do list. But good to have an issue as reminder :)

msbentsen commented 3 years ago

Super, looks much better! 👍 I will close this issue :-)