From 9f1bb022c6b1a735ae356129d79217ec891a1959 Mon Sep 17 00:00:00 2001 From: Carsen Stringer Date: Tue, 13 Jun 2023 14:36:12 -0400 Subject: [PATCH] adding copyright and fixing np.bool deprecation --- docs/conf.py | 3 +++ facemap/__init__.py | 3 +++ facemap/__main__.py | 3 +++ facemap/gui/cluster.py | 3 +++ facemap/gui/gui.py | 3 +++ facemap/gui/guiparts.py | 3 +++ facemap/gui/help_windows.py | 3 +++ facemap/gui/io.py | 3 +++ facemap/gui/menus.py | 3 +++ facemap/keypoints.py | 3 +++ facemap/neural_prediction/keypoints_utils.py | 3 +++ facemap/neural_prediction/neural_activity.py | 3 +++ facemap/neural_prediction/neural_model.py | 3 +++ facemap/neural_prediction/prediction_utils.py | 3 +++ facemap/pose/datasets.py | 3 +++ facemap/pose/facemap_network.py | 3 +++ facemap/pose/model_loader.py | 3 +++ facemap/pose/model_training.py | 3 +++ facemap/pose/pose.py | 3 +++ facemap/pose/pose_gui.py | 3 +++ facemap/pose/pose_helper_functions.py | 3 +++ facemap/pose/refine_pose.py | 3 +++ facemap/pose/transforms.py | 3 +++ facemap/process.py | 3 +++ facemap/pupil.py | 5 ++++- facemap/roi.py | 7 +++++-- facemap/running.py | 3 +++ facemap/utils.py | 3 +++ paper/fig1.py | 3 +++ paper/fig3.py | 3 +++ paper/fig4.py | 3 +++ paper/fig_utils.py | 3 +++ paper/kpsproc.py | 3 +++ paper/neuralpred.py | 3 +++ paper/suppfigs.py | 3 +++ setup.py | 3 +++ tests/conftest.py | 3 +++ tests/test_import.py | 3 +++ tests/test_neural_prediction_output.py | 3 +++ tests/test_pose_estimation_output.py | 3 +++ tests/test_svd_output.py | 3 +++ 41 files changed, 126 insertions(+), 3 deletions(-) mode change 100755 => 100644 facemap/__init__.py mode change 100755 => 100644 facemap/__main__.py mode change 100755 => 100644 facemap/gui/gui.py mode change 100755 => 100644 facemap/gui/guiparts.py mode change 100755 => 100644 facemap/gui/io.py mode change 100755 => 100644 facemap/gui/menus.py mode change 100755 => 100644 facemap/pose/facemap_network.py mode change 100755 => 100644 facemap/pose/model_loader.py mode change 100755 => 100644 facemap/pose/pose.py mode change 100755 => 100644 facemap/pose/pose_gui.py mode change 100755 => 100644 facemap/pose/pose_helper_functions.py mode change 100755 => 100644 facemap/pose/transforms.py mode change 100755 => 100644 facemap/process.py mode change 100755 => 100644 facemap/pupil.py mode change 100755 => 100644 facemap/roi.py mode change 100755 => 100644 facemap/running.py mode change 100755 => 100644 facemap/utils.py diff --git a/docs/conf.py b/docs/conf.py index 77e103b..c0aa708 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,3 +1,6 @@ +""" +Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. +""" # Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full diff --git a/facemap/__init__.py b/facemap/__init__.py old mode 100755 new mode 100644 index dff8c1c..14371ca --- a/facemap/__init__.py +++ b/facemap/__init__.py @@ -1 +1,4 @@ +""" +Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. +""" name = "facemap" diff --git a/facemap/__main__.py b/facemap/__main__.py old mode 100755 new mode 100644 index b0b0d8f..c551135 --- a/facemap/__main__.py +++ b/facemap/__main__.py @@ -1,3 +1,6 @@ +""" +Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. +""" import argparse import time from distutils.util import strtobool diff --git a/facemap/gui/cluster.py b/facemap/gui/cluster.py index cc2e3e9..28e2f04 100644 --- a/facemap/gui/cluster.py +++ b/facemap/gui/cluster.py @@ -1,3 +1,6 @@ +""" +Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. +""" import os import cv2 diff --git a/facemap/gui/gui.py b/facemap/gui/gui.py old mode 100755 new mode 100644 index a0f795a..ad0f812 --- a/facemap/gui/gui.py +++ b/facemap/gui/gui.py @@ -1,3 +1,6 @@ +""" +Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. +""" import os import sys from pathlib import Path diff --git a/facemap/gui/guiparts.py b/facemap/gui/guiparts.py old mode 100755 new mode 100644 index 96a5d59..b8cff6b --- a/facemap/gui/guiparts.py +++ b/facemap/gui/guiparts.py @@ -1,3 +1,6 @@ +""" +Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. +""" import numpy as np import pyqtgraph as pg from PyQt5 import QtCore, QtGui, QtWidgets diff --git a/facemap/gui/help_windows.py b/facemap/gui/help_windows.py index 90ab9b7..d87c946 100644 --- a/facemap/gui/help_windows.py +++ b/facemap/gui/help_windows.py @@ -1,3 +1,6 @@ +""" +Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. +""" import os import numpy as np diff --git a/facemap/gui/io.py b/facemap/gui/io.py old mode 100755 new mode 100644 index 129e164..2165064 --- a/facemap/gui/io.py +++ b/facemap/gui/io.py @@ -1,3 +1,6 @@ +""" +Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. +""" import glob import os import pickle diff --git a/facemap/gui/menus.py b/facemap/gui/menus.py old mode 100755 new mode 100644 index 3ce4894..ff1417d --- a/facemap/gui/menus.py +++ b/facemap/gui/menus.py @@ -1,3 +1,6 @@ +""" +Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. +""" from PyQt5.QtWidgets import QAction, QDesktopWidget from . import help_windows, io diff --git a/facemap/keypoints.py b/facemap/keypoints.py index 827a059..ae8b087 100644 --- a/facemap/keypoints.py +++ b/facemap/keypoints.py @@ -1,3 +1,6 @@ +""" +Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. +""" import os import numpy as np diff --git a/facemap/neural_prediction/keypoints_utils.py b/facemap/neural_prediction/keypoints_utils.py index c15c80b..05d9f20 100644 --- a/facemap/neural_prediction/keypoints_utils.py +++ b/facemap/neural_prediction/keypoints_utils.py @@ -1,3 +1,6 @@ +""" +Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. +""" import os import numpy as np diff --git a/facemap/neural_prediction/neural_activity.py b/facemap/neural_prediction/neural_activity.py index c9a7000..c651f24 100644 --- a/facemap/neural_prediction/neural_activity.py +++ b/facemap/neural_prediction/neural_activity.py @@ -1,3 +1,6 @@ +""" +Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. +""" import numpy as np from facemap import utils diff --git a/facemap/neural_prediction/neural_model.py b/facemap/neural_prediction/neural_model.py index ca93d5d..87294f6 100644 --- a/facemap/neural_prediction/neural_model.py +++ b/facemap/neural_prediction/neural_model.py @@ -1,3 +1,6 @@ +""" +Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. +""" import time from io import StringIO diff --git a/facemap/neural_prediction/prediction_utils.py b/facemap/neural_prediction/prediction_utils.py index 9c75c62..b294452 100644 --- a/facemap/neural_prediction/prediction_utils.py +++ b/facemap/neural_prediction/prediction_utils.py @@ -1,3 +1,6 @@ +""" +Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. +""" import os import time diff --git a/facemap/pose/datasets.py b/facemap/pose/datasets.py index a07ebdf..63eff9b 100644 --- a/facemap/pose/datasets.py +++ b/facemap/pose/datasets.py @@ -1,3 +1,6 @@ +""" +Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. +""" import os from glob import glob diff --git a/facemap/pose/facemap_network.py b/facemap/pose/facemap_network.py old mode 100755 new mode 100644 index c66ce8b..729053f --- a/facemap/pose/facemap_network.py +++ b/facemap/pose/facemap_network.py @@ -1,3 +1,6 @@ +""" +Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. +""" # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Network ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ import numpy as np import torch diff --git a/facemap/pose/model_loader.py b/facemap/pose/model_loader.py old mode 100755 new mode 100644 index fc11eb3..624faf3 --- a/facemap/pose/model_loader.py +++ b/facemap/pose/model_loader.py @@ -1,4 +1,7 @@ """ +Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. +""" +""" Facemap model trained for generating pose estimates. Contains functions for: - downloading pre-trained models - Model class diff --git a/facemap/pose/model_training.py b/facemap/pose/model_training.py index d50ae48..b73ba0f 100644 --- a/facemap/pose/model_training.py +++ b/facemap/pose/model_training.py @@ -1,3 +1,6 @@ +""" +Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. +""" ## Import packages import os from io import StringIO diff --git a/facemap/pose/pose.py b/facemap/pose/pose.py old mode 100755 new mode 100644 index 3e5dc98..3ca24e2 --- a/facemap/pose/pose.py +++ b/facemap/pose/pose.py @@ -1,3 +1,6 @@ +""" +Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. +""" import os import pickle import time diff --git a/facemap/pose/pose_gui.py b/facemap/pose/pose_gui.py old mode 100755 new mode 100644 index 75143c8..ba9d9d4 --- a/facemap/pose/pose_gui.py +++ b/facemap/pose/pose_gui.py @@ -1,3 +1,6 @@ +""" +Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. +""" import numpy as np import pyqtgraph as pg from matplotlib import cm diff --git a/facemap/pose/pose_helper_functions.py b/facemap/pose/pose_helper_functions.py old mode 100755 new mode 100644 index 24dcd7e..7282395 --- a/facemap/pose/pose_helper_functions.py +++ b/facemap/pose/pose_helper_functions.py @@ -1,3 +1,6 @@ +""" +Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. +""" # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Import packages ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ import numpy as np diff --git a/facemap/pose/refine_pose.py b/facemap/pose/refine_pose.py index 1cd0583..7e657f2 100644 --- a/facemap/pose/refine_pose.py +++ b/facemap/pose/refine_pose.py @@ -1,3 +1,6 @@ +""" +Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. +""" import os import shutil from glob import glob diff --git a/facemap/pose/transforms.py b/facemap/pose/transforms.py old mode 100755 new mode 100644 index b0fb44c..8d4fa10 --- a/facemap/pose/transforms.py +++ b/facemap/pose/transforms.py @@ -1,4 +1,7 @@ """ +Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. +""" +""" Facemap functions for: - bounding box: (suggested ROI) for UNet input images - image preprocessing diff --git a/facemap/process.py b/facemap/process.py old mode 100755 new mode 100644 index f0e5162..7abd280 --- a/facemap/process.py +++ b/facemap/process.py @@ -1,3 +1,6 @@ +""" +Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. +""" import os import time from io import StringIO diff --git a/facemap/pupil.py b/facemap/pupil.py old mode 100755 new mode 100644 index 5e480a3..e9eb78e --- a/facemap/pupil.py +++ b/facemap/pupil.py @@ -1,3 +1,6 @@ +""" +Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. +""" import numpy as np from scipy.ndimage import gaussian_filter @@ -11,7 +14,7 @@ def fit_gaussian(im, sigma=2.0, do_xy=False, missing=None): miss = np.isin(ix * im.shape[1] + iy, mx * im.shape[1] + my) miss = miss.flatten() else: - miss = np.zeros((ix.size,), np.bool) + miss = np.zeros((ix.size,), "bool") ix = ix[~miss].flatten() iy = iy[~miss].flatten() diff --git a/facemap/roi.py b/facemap/roi.py old mode 100755 new mode 100644 index bd592c0..ba8b234 --- a/facemap/roi.py +++ b/facemap/roi.py @@ -1,3 +1,6 @@ +""" +Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. +""" import numpy as np import pyqtgraph as pg from PyQt5 import QtCore @@ -94,7 +97,7 @@ def position(self, parent): yrange += int(sizey / 2) # what is ellipse circling? br = self.ROI.boundingRect() - ellipse = np.zeros((yrange.size, xrange.size), np.bool) + ellipse = np.zeros((yrange.size, xrange.size), "bool") x, y = np.meshgrid(np.arange(0, xrange.size, 1), np.arange(0, yrange.size, 1)) ellipse = ( (y - br.center().y()) ** 2 / (br.height() / 2) ** 2 @@ -248,7 +251,7 @@ def position(self, parent): yrange += int(sizey / 2) # what is ellipse circling? br = self.ROI.boundingRect() - ellipse = np.zeros((yrange.size, xrange.size), np.bool) + ellipse = np.zeros((yrange.size, xrange.size), "bool") x, y = np.meshgrid(np.arange(0, xrange.size, 1), np.arange(0, yrange.size, 1)) ellipse = ( (y - br.center().y()) ** 2 / (br.height() / 2) ** 2 diff --git a/facemap/running.py b/facemap/running.py old mode 100755 new mode 100644 index 323420b..ec41019 --- a/facemap/running.py +++ b/facemap/running.py @@ -1,3 +1,6 @@ +""" +Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. +""" # outputs the dx, dy offsets between frames by registering frame N to frame # N-1. If the movement is larger than half the frame size, outputs NaN. # ops.yrange, xrange are ranges to use for rectangular section of movie diff --git a/facemap/utils.py b/facemap/utils.py old mode 100755 new mode 100644 index 3e4ed1e..6fd298b --- a/facemap/utils.py +++ b/facemap/utils.py @@ -1,3 +1,6 @@ +""" +Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. +""" import cv2 import h5py import numpy as np diff --git a/paper/fig1.py b/paper/fig1.py index 2f4deaf..7710046 100644 --- a/paper/fig1.py +++ b/paper/fig1.py @@ -1,3 +1,6 @@ +""" +Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. +""" import matplotlib import matplotlib.pyplot as plt from scipy.stats import wilcoxon diff --git a/paper/fig3.py b/paper/fig3.py index 3b25825..b834876 100644 --- a/paper/fig3.py +++ b/paper/fig3.py @@ -1,3 +1,6 @@ +""" +Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. +""" import matplotlib.pyplot as plt import torch from fig_utils import * diff --git a/paper/fig4.py b/paper/fig4.py index a0b9433..d546c20 100644 --- a/paper/fig4.py +++ b/paper/fig4.py @@ -1,3 +1,6 @@ +""" +Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. +""" import matplotlib.pyplot as plt import torch from fig_utils import * diff --git a/paper/fig_utils.py b/paper/fig_utils.py index bddda41..df39755 100644 --- a/paper/fig_utils.py +++ b/paper/fig_utils.py @@ -1,3 +1,6 @@ +""" +Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. +""" import string import matplotlib diff --git a/paper/kpsproc.py b/paper/kpsproc.py index 260693f..e10fc38 100644 --- a/paper/kpsproc.py +++ b/paper/kpsproc.py @@ -1,3 +1,6 @@ +""" +Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. +""" import os import cv2 diff --git a/paper/neuralpred.py b/paper/neuralpred.py index efb76fb..ab8a2de 100644 --- a/paper/neuralpred.py +++ b/paper/neuralpred.py @@ -1,3 +1,6 @@ +""" +Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. +""" import os import sys import time diff --git a/paper/suppfigs.py b/paper/suppfigs.py index e1af3c2..0fd1350 100644 --- a/paper/suppfigs.py +++ b/paper/suppfigs.py @@ -1,3 +1,6 @@ +""" +Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. +""" import fig4 import matplotlib.pyplot as plt import torch diff --git a/setup.py b/setup.py index db58baf..790f49d 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,6 @@ +""" +Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. +""" import setuptools install_deps = [ diff --git a/tests/conftest.py b/tests/conftest.py index cac7a28..1799324 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,3 +1,6 @@ +""" +Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. +""" import os import shutil import sys diff --git a/tests/test_import.py b/tests/test_import.py index 69caa27..e62c853 100644 --- a/tests/test_import.py +++ b/tests/test_import.py @@ -1,3 +1,6 @@ +""" +Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. +""" " Test imports for facemap package " diff --git a/tests/test_neural_prediction_output.py b/tests/test_neural_prediction_output.py index 1dd0713..44d9a40 100644 --- a/tests/test_neural_prediction_output.py +++ b/tests/test_neural_prediction_output.py @@ -1,3 +1,6 @@ +""" +Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. +""" " Test Facemap neural prediction output " # TODO: Add tests for neural prediction output diff --git a/tests/test_pose_estimation_output.py b/tests/test_pose_estimation_output.py index 5af611f..9a5c161 100644 --- a/tests/test_pose_estimation_output.py +++ b/tests/test_pose_estimation_output.py @@ -1,3 +1,6 @@ +""" +Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. +""" "Test Facemap's pose estimation output " import os diff --git a/tests/test_svd_output.py b/tests/test_svd_output.py index 4ecd2bc..07ee473 100644 --- a/tests/test_svd_output.py +++ b/tests/test_svd_output.py @@ -1,3 +1,6 @@ +""" +Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. +""" "Test facemap SVD processing outputs for single and multiple videos" import os