Skip to content

Commit

Permalink
adding copyright and fixing np.bool deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
carsen-stringer committed Jun 13, 2023
1 parent b40a61e commit 9f1bb02
Show file tree
Hide file tree
Showing 41 changed files with 126 additions and 3 deletions.
3 changes: 3 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions facemap/__init__.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
name = "facemap"
3 changes: 3 additions & 0 deletions facemap/__main__.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions facemap/gui/cluster.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import os

import cv2
Expand Down
3 changes: 3 additions & 0 deletions facemap/gui/gui.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions facemap/gui/guiparts.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions facemap/gui/help_windows.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import os

import numpy as np
Expand Down
3 changes: 3 additions & 0 deletions facemap/gui/io.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import glob
import os
import pickle
Expand Down
3 changes: 3 additions & 0 deletions facemap/gui/menus.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions facemap/keypoints.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import os

import numpy as np
Expand Down
3 changes: 3 additions & 0 deletions facemap/neural_prediction/keypoints_utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import os

import numpy as np
Expand Down
3 changes: 3 additions & 0 deletions facemap/neural_prediction/neural_activity.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions facemap/neural_prediction/neural_model.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import time
from io import StringIO

Expand Down
3 changes: 3 additions & 0 deletions facemap/neural_prediction/prediction_utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import os
import time

Expand Down
3 changes: 3 additions & 0 deletions facemap/pose/datasets.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import os
from glob import glob

Expand Down
3 changes: 3 additions & 0 deletions facemap/pose/facemap_network.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Network ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
import numpy as np
import torch
Expand Down
3 changes: 3 additions & 0 deletions facemap/pose/model_loader.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions facemap/pose/model_training.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions facemap/pose/pose.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import os
import pickle
import time
Expand Down
3 changes: 3 additions & 0 deletions facemap/pose/pose_gui.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions facemap/pose/pose_helper_functions.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Import packages ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
import numpy as np

Expand Down
3 changes: 3 additions & 0 deletions facemap/pose/refine_pose.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions facemap/pose/transforms.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions facemap/process.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 4 additions & 1 deletion facemap/pupil.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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()
Expand Down
7 changes: 5 additions & 2 deletions facemap/roi.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions facemap/running.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions facemap/utils.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions paper/fig1.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions paper/fig3.py
Original file line number Diff line number Diff line change
@@ -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 *
Expand Down
3 changes: 3 additions & 0 deletions paper/fig4.py
Original file line number Diff line number Diff line change
@@ -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 *
Expand Down
3 changes: 3 additions & 0 deletions paper/fig_utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import string

import matplotlib
Expand Down
3 changes: 3 additions & 0 deletions paper/kpsproc.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import os

import cv2
Expand Down
3 changes: 3 additions & 0 deletions paper/neuralpred.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import os
import sys
import time
Expand Down
3 changes: 3 additions & 0 deletions paper/suppfigs.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import setuptools

install_deps = [
Expand Down
3 changes: 3 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import os
import shutil
import sys
Expand Down
3 changes: 3 additions & 0 deletions tests/test_import.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
" Test imports for facemap package "


Expand Down
3 changes: 3 additions & 0 deletions tests/test_neural_prediction_output.py
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions tests/test_pose_estimation_output.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
3 changes: 3 additions & 0 deletions tests/test_svd_output.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit 9f1bb02

Please sign in to comment.