mfinzi/LieConv

View on GitHub

Showing 50 of 55 total issues

Function __init__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(self, root_dir=default_root_dir, train=True, download=True, n_systems=100, regen=False,
Severity: Major
Found in lie_conv/datasets.py - About 1 hr to fix

    Function forward has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def forward(self,inp,withquery=False):
            abq_pairs,vals,mask = inp
            dist = self.group.distance if self.group else lambda ab: norm(ab,dim=-1)
            if self.ds_frac!=1:
                if self.cache and self.cached_indices is None:
    Severity: Minor
    Found in lie_conv/lieConv.py - About 55 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function process_xyz_files has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def process_xyz_files(data, process_file_fn, file_ext=None, file_idx_list=None, stack=True):
        """
        Take a set of datafiles and apply a predefined data processing script to each
        one. Data can be stored in a directory, tarfile, or zipfile. An optional
        file extension can be added.
    Severity: Minor
    Found in corm_data/prepare/process.py - About 55 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__(self, root_dir=default_root_dir, train=True, download=True, n_systems=100, space_dim=2, regen=False,
    Severity: Major
    Found in lie_conv/datasets.py - About 50 mins to fix

      Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def __init__(self,*args,group=T(3),ds_frac=1,fill=1/3,cache=False,knn=False,**kwargs):
      Severity: Major
      Found in lie_conv/lieConv.py - About 50 mins to fix

        Function prepare_dataset has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def prepare_dataset(datadir, dataset, subset=None, splits=None, cleanup=True, force_download=False):
        Severity: Minor
        Found in corm_data/prepare/download.py - About 45 mins to fix

          Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def __init__(self,chin,chout,conv,bn=False,act='swish',fill=None):
          Severity: Minor
          Found in lie_conv/lieConv.py - About 45 mins to fix

            Function conv2d has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def conv2d(in_channels,out_channels,kernel_size=3,coords=False,dilation=1,**kwargs):
            Severity: Minor
            Found in lie_conv/utils.py - About 45 mins to fix

              Function download_dataset_qm9 has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def download_dataset_qm9(datadir, dataname, splits=None, calculate_thermo=True, exclude=True, cleanup=True):
              Severity: Minor
              Found in corm_data/prepare/qm9.py - About 45 mins to fix

                Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def __init__(self,num_species,charge_scale,num_outputs=1,d=3,k=64,num_layers=1):
                Severity: Minor
                Found in lie_conv/graphnets.py - About 45 mins to fix

                  Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def __init__(self, data, included_species=None, num_pts=-1, normalize=True, shuffle=True, subtract_thermo=True):
                  Severity: Minor
                  Found in corm_data/dataset.py - About 45 mins to fix

                    Function initialize_datasets has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    def initialize_datasets(splits, datadir, dataset, subset=None,
                    Severity: Minor
                    Found in corm_data/utils.py - About 45 mins to fix

                      Function forward has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def forward(self, src, dest, edge_attr, u, batch):
                      Severity: Minor
                      Found in lie_conv/graphnets.py - About 35 mins to fix

                        Function knn_point has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        def knn_point(nbhd, xyz, new_xyz, mask, distance=square_distance):
                        Severity: Minor
                        Found in lie_conv/utils.py - About 35 mins to fix

                          Function forward has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def forward(self, x, edge_index, edge_attr, u, batch):
                          Severity: Minor
                          Found in lie_conv/graphnets.py - About 35 mins to fix

                            Function LieConvBNrelu has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            def LieConvBNrelu(in_channels,out_channels,bn=True,act='swish',**kwargs):
                            Severity: Minor
                            Found in lie_conv/lieConv.py - About 35 mins to fix

                              Function forward has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  def forward(self, x, edge_index, edge_attr, u, batch):
                              Severity: Minor
                              Found in lie_conv/graphnets.py - About 35 mins to fix

                                Function process_xyz_files has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                def process_xyz_files(data, process_file_fn, file_ext=None, file_idx_list=None, stack=True):
                                Severity: Minor
                                Found in corm_data/prepare/process.py - About 35 mins to fix

                                  Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      def __init__(self, d=2,k=300,num_layers=4,sys_dim=2,**kwargs):
                                  Severity: Minor
                                  Found in lie_conv/dynamicsTrainer.py - About 35 mins to fix

                                    Function pConvBNrelu has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                    def pConvBNrelu(in_channels,out_channels,bn=True,act='swish',**kwargs):
                                    Severity: Minor
                                    Found in lie_conv/lieConv.py - About 35 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language