graphnet-team/graphnet

View on GitHub

Showing 184 of 200 total issues

File layers.py has 851 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""Class(es) implementing layers to be used in `graphnet` models."""
 
from typing import Any, Callable, Optional, Sequence, Union, List
 
import torch
Severity: Major
Found in src/graphnet/models/components/layers.py - About 2 days to fix

    File dataset.py has 592 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    """Base :py:class:`Dataset` class(es) used in GraphNeT."""
     
    from copy import deepcopy
    from abc import ABC, abstractmethod
    from typing import (
    Severity: Major
    Found in src/graphnet/data/dataset/dataset.py - About 1 day to fix

      File datamodule.py has 473 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      """Base `Dataloader` class(es) used in `graphnet`."""
       
      from typing import Dict, Any, Optional, List, Tuple, Union, Type
      import pytorch_lightning as pl
      from copy import deepcopy
      Severity: Minor
      Found in src/graphnet/data/datamodule.py - About 7 hrs to fix

        File i3truthextractor.py has 457 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        """I3Extractor class(es) for extracting truth-level information."""
         
        import numpy as np
        import matplotlib.path as mpath
        from scipy.spatial import ConvexHull, Delaunay
        Severity: Minor
        Found in src/graphnet/data/extractors/icecube/i3truthextractor.py - About 7 hrs to fix

          File utils.py has 424 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          """Utility functions for construction of graphs."""
           
          from typing import List, Tuple, Optional, Union
          import os
          import numpy as np
          Severity: Minor
          Found in src/graphnet/models/graphs/utils.py - About 6 hrs to fix

            File easy_model.py has 424 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            """Suggested Model subclass that enables simple user syntax."""
             
            from collections import OrderedDict
            from typing import Any, Dict, List, Optional, Union, Type
             
             
            Severity: Minor
            Found in src/graphnet/models/easy_model.py - About 6 hrs to fix

              File loss_functions.py has 415 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              """Collection of loss functions.
               
              All loss functions inherit from `LossFunction` which ensures a common syntax,
              handles per-event weights, etc.
              """
              Severity: Minor
              Found in src/graphnet/training/loss_functions.py - About 5 hrs to fix

                Function __call__ has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                Open

                def __call__(self, frame: "icetray.I3Frame") -> Dict[str, List[Any]]:
                """Extract reconstructed features from `frame`.
                 
                Args:
                frame: Physics (P) I3-frame from which to extract reconstructed
                Severity: Minor
                Found in src/graphnet/data/extractors/icecube/i3featureextractor.py - About 5 hrs to fix

                File task.py has 386 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                """Base physics task-specific `Model` class(es)."""
                 
                from abc import abstractmethod
                from typing import Any, TYPE_CHECKING, List, Tuple, Union
                from typing import Callable, Optional
                Severity: Minor
                Found in src/graphnet/models/task/task.py - About 5 hrs to fix

                  File nodes.py has 382 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  """Class(es) for building/connecting graphs."""
                   
                  from typing import List, Tuple, Optional, Dict
                  from abc import abstractmethod
                   
                   
                  Severity: Minor
                  Found in src/graphnet/models/graphs/nodes/nodes.py - About 5 hrs to fix

                    File graph_definition.py has 370 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    """Modules for defining graphs.
                     
                    These are self-contained graph definitions that hold all the graph-altering
                    code in graphnet. These modules define what the GNNs sees as input and can be
                    passed to dataloaders during training and deployment.
                    Severity: Minor
                    Found in src/graphnet/models/graphs/graph_definition.py - About 4 hrs to fix

                      File parquet_dataset.py has 343 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      """Base :py:class:`Dataset` class(es) used in GraphNeT."""
                       
                      from typing import (
                      Dict,
                      List,
                      Severity: Minor
                      Found in src/graphnet/data/dataset/parquet/parquet_dataset.py - About 4 hrs to fix

                        Function _keep_frame has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def _keep_frame(self, frame: "icetray.I3Frame") -> bool:
                        """Check if current frame should be kept.
                         
                        Args:
                        frame: I3-frame
                        Severity: Minor
                        Found in src/graphnet/data/extractors/icecube/utilities/i3_filters.py - About 3 hrs to fix

                        Function __iter__ has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def __iter__(self) -> Iterator[List[int]]:
                        """Return length-matched batches."""
                        indices = list(self.sampler)
                        data_source = self.sampler.data_source
                         
                         
                        Severity: Minor
                        Found in src/graphnet/data/dataset/samplers.py - About 3 hrs to fix

                        File embedding.py has 318 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        """Classes for performing embedding of input data."""
                         
                        import torch
                        import torch.nn as nn
                        from torch.functional import Tensor
                        Severity: Minor
                        Found in src/graphnet/models/components/embedding.py - About 3 hrs to fix

                          Function _merge_databases has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def _merge_databases(
                          self,
                          files: List[str],
                          database_path: str,
                          ) -> None:
                          Severity: Minor
                          Found in src/graphnet/data/writers/sqlite_writer.py - About 3 hrs to fix

                          Function __call__ has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def __call__(self, frame: "icetray.I3Frame") -> Dict[str, Any]:
                          """Extract all possible data from `frame`.
                           
                          The following types of objects are handled as special cases:
                          - Pulse series maps,
                          Severity: Minor
                          Found in src/graphnet/data/extractors/icecube/i3genericextractor.py - About 3 hrs to fix

                          Function __call__ has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def __call__(
                          self, frame: "icetray.I3Frame", padding_value: Any = -1
                          ) -> Dict[str, Any]:
                          """Extract truth-level information."""
                          is_mc = frame_is_montecarlo(frame, self._mctree)
                          Severity: Minor
                          Found in src/graphnet/data/extractors/icecube/i3truthextractor.py - About 3 hrs to fix

                          File curated_datamodule.py has 293 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          """Contains a Generic class for curated DataModules/Datasets.
                           
                          Inheriting subclasses are data-specific implementations that allow the user to
                          import and download pre-converteddatasets for training of deep learning based
                          methods in GraphNeT.
                          Severity: Minor
                          Found in src/graphnet/data/curated_datamodule.py - About 3 hrs to fix

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

                            def __init__(
                            Severity: Major
                            Found in src/graphnet/models/gnn/grit.py - About 2 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language