diff --git a/rsp_vision/analysis/gaussians_calculations.py b/rsp_vision/analysis/gaussians_calculations.py index 7c04265..7bdd9df 100644 --- a/rsp_vision/analysis/gaussians_calculations.py +++ b/rsp_vision/analysis/gaussians_calculations.py @@ -53,9 +53,7 @@ def elliptical_gaussian_andermann( r = ( peak_response * np.exp(-((np.log2(sf) - np.log2(sf_0)) ** 2) / 2 * (sigma_sf**2)) - * np.exp( - -((np.log2(tf) - log_2_tf_pref_sf) ** 2) / 2 * (sigma_tf**2) - ) + * np.exp(-((np.log2(tf) - log_2_tf_pref_sf) ** 2) / 2 * (sigma_tf**2)) ) return r diff --git a/rsp_vision/analysis/spatial_freq_temporal_freq.py b/rsp_vision/analysis/spatial_freq_temporal_freq.py index 11ccb08..3fd9f16 100644 --- a/rsp_vision/analysis/spatial_freq_temporal_freq.py +++ b/rsp_vision/analysis/spatial_freq_temporal_freq.py @@ -66,9 +66,9 @@ def __call__(self) -> PhotonData: ] ) - self.data.p_values[ - "Kruskal-Wallis test" - ] = self.nonparam_anova_over_rois() + self.data.p_values["Kruskal-Wallis test"] = ( + self.nonparam_anova_over_rois() + ) ( self.data.p_values["Sign test"], self.data.p_values["Wilcoxon signed rank test"], @@ -504,9 +504,11 @@ def get_median_subtracted_response_and_params( median_subtracted_response = ( responses[ - (responses.roi_id == roi_id) & (responses.direction == dir) - if not pool_directions - else (responses.roi_id == roi_id) + ( + (responses.roi_id == roi_id) & (responses.direction == dir) + if not pool_directions + else (responses.roi_id == roi_id) + ) ] .groupby(["sf", "tf"])[["subtracted"]] .median() @@ -520,9 +522,9 @@ def get_median_subtracted_response_and_params( for i, sf in enumerate(sfs): for j, tf in enumerate(tfs): - median_subtracted_response_2d_matrix[ - i, j - ] = median_subtracted_response.loc[(sf, tf)]["subtracted"] + median_subtracted_response_2d_matrix[i, j] = ( + median_subtracted_response.loc[(sf, tf)]["subtracted"] + ) return median_subtracted_response_2d_matrix, sf_0, tf_0, peak_response @@ -701,6 +703,6 @@ def get_all_fits(self) -> None: key ][0] self.data.fit_output[(roi_id, key)] = roi_data[key][1] - self.data.median_subtracted_response[ - (roi_id, key) - ] = roi_data[key][2] + self.data.median_subtracted_response[(roi_id, key)] = ( + roi_data[key][2] + ) diff --git a/rsp_vision/save/save_data.py b/rsp_vision/save/save_data.py index 554b7c9..a9a19f3 100644 --- a/rsp_vision/save/save_data.py +++ b/rsp_vision/save/save_data.py @@ -304,9 +304,11 @@ def save_metadata_about_this_analysis( # save in a file details about the experimental data that was analysed metadata = { "folder_name": folder_naming_specs.folder_name, - "photon_type": "two_photon" - if photon_data.photon_type == PhotonType.TWO_PHOTON - else "three_photon", + "photon_type": ( + "two_photon" + if photon_data.photon_type == PhotonType.TWO_PHOTON + else "three_photon" + ), "date": str(datetime.datetime.now()), "rsp_vision_latest_commit_hash": str( git.Repo(search_parent_directories=True).head.object.hexsha @@ -363,9 +365,11 @@ def save_info_in_main_log( "commit_hash": str( git.Repo(search_parent_directories=True).head.object.hexsha ), - "microscope": "two_photon" - if photon_data.photon_type == PhotonType.TWO_PHOTON - else "three_photon", + "microscope": ( + "two_photon" + if photon_data.photon_type == PhotonType.TWO_PHOTON + else "three_photon" + ), "n_roi": photon_data.n_roi, "n_responsive_roi": len(photon_data.responsive_rois), "days_of_the_experiment": photon_data.total_n_days,