Skip to content

Commit

Permalink
Merge commit 'cbdcf9dffcc2d2f56b5e01c1dd4def8b6dd8ddee' into backport
Browse files Browse the repository at this point in the history
  refactor references to new top-level package nemere
  init package nemere
  • Loading branch information
skleber committed Jun 16, 2021
2 parents bdc0685 + cbdcf9d commit ed5bdef
Show file tree
Hide file tree
Showing 39 changed files with 234 additions and 223 deletions.
98 changes: 37 additions & 61 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/check_parse-pcap.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
from sys import exit
import IPython

from validation.messageParser import ParsedMessage
from utils.loader import SpecimenLoader
from nemere.validation.messageParser import ParsedMessage
from nemere.utils.loader import SpecimenLoader

if __name__ == '__main__':
parser = ArgumentParser(
Expand Down
2 changes: 1 addition & 1 deletion src/check_pcap-info.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from os.path import isfile, basename
from tabulate import tabulate

from utils.loader import SpecimenLoader
from nemere.utils.loader import SpecimenLoader


def countByteFrequency():
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
from sklearn.cluster import DBSCAN
from scipy.special import comb

from alignment.hirschbergAlignSegments import HirschbergOnSegmentSimilarity
from inference.segmentHandler import matrixFromTpairs
from inference.segments import MessageSegment
from inference.templates import DistanceCalculator, MemmapDC
from nemere.alignment.hirschbergAlignSegments import HirschbergOnSegmentSimilarity
from nemere.inference.segmentHandler import matrixFromTpairs
from nemere.inference.segments import MessageSegment
from nemere.inference.templates import DistanceCalculator, MemmapDC


class SegmentedMessages(object):
Expand Down Expand Up @@ -71,8 +71,8 @@ def _calcSimilarityMatrix(self):
"""
Calculate a similarity matrix of messages from nwscores yielded by HirschbergOnSegmentSimilarity.
>>> from utils.baseAlgorithms import generateTestSegments
>>> from inference.templates import DistanceCalculator
>>> from nemere.utils.baseAlgorithms import generateTestSegments
>>> from nemere.inference.templates import DistanceCalculator
>>> segments = generateTestSegments()
>>> DistanceCalculator.debug = False
>>> dc = DistanceCalculator(segments)
Expand Down Expand Up @@ -104,8 +104,8 @@ def _calcDistanceMatrix(self, similarityMatrix: numpy.ndarray):
"""
For clustering, convert the nwscores-based similarity matrix to a distance measure.
>>> from utils.baseAlgorithms import generateTestSegments
>>> from inference.templates import DistanceCalculator
>>> from nemere.utils.baseAlgorithms import generateTestSegments
>>> from nemere.inference.templates import DistanceCalculator
>>> segments = generateTestSegments()
>>> DistanceCalculator.debug = False
>>> dc = DistanceCalculator(segments)
Expand Down Expand Up @@ -213,8 +213,8 @@ def alignMessageType(self, msgcluster: List[Tuple[MessageSegment]]):
Messages segments of one cluster aligned to the medoid ("segments that is most similar too all segments")
of the cluster.
>>> from utils.baseAlgorithms import generateTestSegments
>>> from inference.templates import DistanceCalculator
>>> from nemere.utils.baseAlgorithms import generateTestSegments
>>> from nemere.inference.templates import DistanceCalculator
>>> segments = generateTestSegments()
>>> DistanceCalculator.debug = False
>>> dc = DistanceCalculator(segments)
Expand Down Expand Up @@ -292,7 +292,7 @@ def autoconfigureDBSCAN(self):
:return: minpts, epsilon
"""
from utils.baseAlgorithms import autoconfigureDBSCAN
from nemere.utils.baseAlgorithms import autoconfigureDBSCAN
# can we omit k = 0 ?
# No - recall and even more so precision deteriorates for dns and dhcp (1000s)
epsilon, min_samples, k = autoconfigureDBSCAN(self.neighbors())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
from networkx import Graph
from networkx.algorithms.components.connected import connected_components

from inference.templates import DistanceCalculator, Template
from alignment.hirschbergAlignSegments import HirschbergOnSegmentSimilarity
from inference.analyzers import *
from nemere.inference.templates import DistanceCalculator, Template
from nemere.alignment.hirschbergAlignSegments import HirschbergOnSegmentSimilarity
from nemere.inference.analyzers import *



Expand Down Expand Up @@ -399,8 +399,8 @@ def mergeClusters(self, messageClusters, clusterStats, alignedFieldClasses,
matchingClusters, matchingConditions):
import IPython
from tabulate import tabulate
from utils.evaluationHelpers import printClusterMergeConditions
from inference.templates import Template
from nemere.utils.evaluationHelpers import printClusterMergeConditions
from nemere.inference.templates import Template

remDue2gaps = [
clunuAB for clunuAB in matchingClusters
Expand Down Expand Up @@ -588,7 +588,7 @@ def __init__(self, alignedClusters: Dict[int, List], dc: DistanceCalculator):


def calcClusterDistances(self, mmg=(0, -1, 5)):
from inference.segmentHandler import matrixFromTpairs
from nemere.inference.segmentHandler import matrixFromTpairs

fclassHirsch, statDynFields, statDynValues = self.generateHirsch(mmg)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
from collections import Counter
from tabulate import tabulate

from inference.segments import MessageSegment
from alignment.alignMessages import SegmentedMessages
from nemere.inference.segments import MessageSegment
from nemere.alignment.alignMessages import SegmentedMessages


debug = True
Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit ed5bdef

Please sign in to comment.