Skip to content

Commit

Permalink
Whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
caiw committed Apr 5, 2024
1 parent 7ac2f3e commit 7dce6d7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion kymata/ippm/data_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

Node = namedtuple('Node', 'magnitude position in_edges')


class IPPMHexel(object):
"""
Container to hold data about a hexel spike.
Expand Down Expand Up @@ -215,6 +216,7 @@ def stem_plot(

plt.show()


def causality_violation_score(denoised_hexels: Dict[str, IPPMHexel], hierarchy: Dict[str, List[str]], hemi: str, inputs: List[str]) -> Tuple[float, int, int]:
"""
Assumption: hexels are denoised. Otherwise, it doesn't really make sense to check the min/max latency of noisy hexels.
Expand Down Expand Up @@ -373,6 +375,7 @@ def remove_excess_funcs(to_retain: List[str], hexels: Dict[str, IPPMHexel]) -> D
hexels.pop(func)
return hexels


def plot_k_dist_1D(pairings: List[Tuple[float, float]], k: int=4, normalise: bool=False):
"""
This could be optimised further but since we aren't using it, we can leave it as it is.
Expand Down Expand Up @@ -412,6 +415,7 @@ def plot_k_dist_1D(pairings: List[Tuple[float, float]], k: int=4, normalise: boo
plt.plot(list(range(0, len(sorted_k_dists))), sorted_k_dists)
plt.show()


def copy_hemisphere(
hexels_to: Dict[str, IPPMHexel],
hexels_from: Dict[str, IPPMHexel],
Expand Down Expand Up @@ -456,6 +460,7 @@ def copy_hemisphere(
else:
hexels_to[func].left_best_pairings = hexels_from[func].left_best_pairings


def plot_denoised_vs_noisy(hexels: Dict[str, IPPMHexel], clusterer, title: str):
"""
Utility function to plot the noisy and denoised versions. It runs the supplied clusterer and then copies the denoised hexels, which
Expand All @@ -473,4 +478,4 @@ def plot_denoised_vs_noisy(hexels: Dict[str, IPPMHexel], clusterer, title: str):
"""
denoised_hexels = clusterer.cluster(hexels, 'rightHemisphere')
copy_hemisphere(denoised_hexels, hexels, 'leftHemisphere', 'rightHemisphere')
stem_plot(denoised_hexels, title)
stem_plot(denoised_hexels, title)

0 comments on commit 7dce6d7

Please sign in to comment.