Skip to content
This repository has been archived by the owner on Oct 30, 2024. It is now read-only.

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jul 8, 2024
1 parent 4bc8bc5 commit c8dcf77
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 21 deletions.
4 changes: 1 addition & 3 deletions rsp_vision/analysis/gaussians_calculations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 14 additions & 12 deletions rsp_vision/analysis/spatial_freq_temporal_freq.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down Expand Up @@ -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()
Expand All @@ -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

Expand Down Expand Up @@ -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]
)
16 changes: 10 additions & 6 deletions rsp_vision/save/save_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit c8dcf77

Please sign in to comment.