text string |
|---|
import numpy as np
from scipy.optimize import linear_sum_assignment
import copy
import pmht.kalman as kalman
class Target:
def __init__(self, id, t_id, delta_t):
self.id = id
self.t_id = t_id
self.delta_t = delta_t
self.state = np.zeros((4, 1), dtype=np.float)
self.P = np.... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# PYTHON_ARGCOMPLETE_OK
# Pass --help flag for help on command-line interface
from __future__ import (absolute_import, division, print_function)
import sympy as sp
import numpy as np
from pyneqsys.symbolic import SymbolicSys, linear_exprs
def main(init_conc_molar='1... |
<reponame>NREL/reVX<filename>tests/test_hybrid_stats.py<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
pytests for Rechunk h5
"""
import numpy as np
import os
import pandas as pd
from pandas.testing import assert_frame_equal
import pytest
from scipy.stats import pearsonr, spearmanr, kendalltau
from reVX import TESTDATADIR... |
<filename>software/multifluids_icferst/legacy_reservoir_prototype/tests/multiphase_wells/Check_production.py
#!/usr/bin/env python
# arguments:: project vtu
# extracts flow parameters for a number of points
# from a vtu file
import vtk
import sys
from math import *
import matplotlib.pyplot as plt
import numpy as np
f... |
<reponame>HaldexBrake/ReducedOrderModeling
import numpy as np
import matplotlib.pyplot as plt
from assimulo.solvers import CVode
from assimulo.problem import Explicit_Problem
import sys
sys.path.append('../')
from dmd import dmd
from sympy import symbols, lambdify
from numpy.linalg import solve, norm, inv
from scipy.li... |
<filename>orca_base/scripts/nees.py<gh_stars>0
#!/usr/bin/env python3
"""
Compute Normalized Estimated Error Squared (NEES)
See https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python/blob/master/08-Designing-Kalman-Filters.ipynb
"""
from typing import List, Optional
import numpy as np
import transformations... |
<reponame>alexalemi/cancersim<gh_stars>1-10
import scipy as sp
def FIRE(x0,fprime,fmax=0.005,
Nmin=5.,finc=1.1,fdec=0.5,alphastart=0.1,fa=0.99,deltatmax=10.,
maxsteps = 10**5):
Nmin,finc,fdec,alphastart,fa,deltatmax=(5.,1.1,0.5,0.1,0.99,10.)
alpha = alphastart
deltat = 0.1
po... |
<filename>pyrnn/analysis/fixed.py
import numpy as np
import torch
from loguru import logger
from myterial import amber_light, orange
from scipy.spatial.distance import euclidean
from collections import namedtuple
from pyinspect import Report
from einops import repeat
from pyrnn._progress import fixed_points_progress
f... |
from collections import defaultdict
import statistics
from typing import List
from utils import run
valid_identifiers = {"(": ")", "[": "]", "{": "}", "<": ">"}
reverse_identifiers = {v: k for k, v in valid_identifiers.items()}
invalid_scores = {")": 3, "]": 57, "}": 1197, ">": 25137}
valid_scores = {")": 1, "]": 2, ... |
#!/usr/bin/env python
import os, sys
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)),
'agilent-n6700b-power-system'))
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)),
't2k-temperature-sensor'))
sys.path.append(os.path.join(os.path.dirnam... |
<reponame>apayeur/GIF-Ca
#############################################################
# This program computes the dynamic I-V curve following #
# the procedure in Badel et al. #
# For convenience, it uses methods from the GLIF fitting #
# protocol (Pozzorini et al.). ... |
<filename>src/pymor/algorithms/symplectic.py
# This file is part of the pyMOR project (https://www.pymor.org).
# Copyright pyMOR developers and contributors. All rights reserved.
# License: BSD 2-Clause License (https://opensource.org/licenses/BSD-2-Clause)
import numpy as np
from scipy.linalg import schur
from pymor... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
# # This library is used to align multiple arrays.
# Here, we align stereo audio wavs in the form of numpy arrays.
# Audio is presumed to be humans talking in conversation,
# with multiple conversation participants.
# We align audio from microphon... |
import matplotlib
__author__ = "<NAME> 260550226"
import Augmentor
import numpy as np
from PIL import Image
import tensorflow as tf
import pickle
from skimage.util import random_noise
import cv2
import numpy as np
from matplotlib import pyplot as plt
from scipy.ndimage.interpolation import map_coordinates
from scipy.... |
<filename>scripts/compute_transmat_shapenetv1_to_partnet.py
"""
This script compute transformation-matrix for aligning shapenetv1 mesh to partnet data
Usage: python compute_transmat_shapenetv1_to_partnet.py [anno_id] [version_id (not used in this script)] [category] [shapenet-model-id]
Method:
... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
#for simpleaudio on linux the following dependencies have to be met:
#sudo apt-get install -y python3-dev libasound2-dev
import tkinter as tk
from tkinter import ttk
from functools import partial
import time
import math
import datetime
import simpleaudio as sa
import numpy as... |
<gh_stars>10-100
try:
from scipy import integrate as i
except:
print 'Unable to find scipy library. Make sure you have downloaded scipy. See http://www.scipy.org/install.html'
try:
import numpy as np
except:
print 'Unable to find numpy library. Make sure you have downloaded numpy. See http://www.numpy.... |
<reponame>kenchan0226/dual_view_review_summarize<filename>paired_t_test.py
import csv
import os
import argparse
from scipy import stats
def main(args):
rg_keys = ['Rouge 1 R', 'Rouge 1 P', 'Rouge 1 F',
'Rouge 2 R', 'Rouge 2 P', 'Rouge 2 F',
'Rouge L R', 'Rouge L P', 'Rouge L F']
... |
<reponame>SamPaskewitz/statsrat
import numpy as np
import pandas as pd
import xarray as xr
from scipy import stats
from plotnine import *
import nlopt
def multi_sim(model, trials_list, par_val, random_resp = False, sim_type = None):
"""
Simulate one or more trial sequences from the same schedule with known par... |
"""Contains a set of misc. useful tools for the compressive learning toolbox"""
import numpy as np
from scipy.stats import multivariate_normal
import matplotlib.pyplot as plt
############################
# DATASET GENERATION TOOLS #
############################
def generatedataset_GMM(d,K,n,output_required='dataset'... |
<filename>celer/utils/testing.py
import numpy as np
from scipy import sparse
def build_dataset(n_samples=50, n_features=200, n_targets=1, sparse_X=False):
"""Build samples and observation for linear regression problem."""
random_state = np.random.RandomState(0)
if n_targets > 1:
w = random_state.... |
#
# Copyright (c) 2021 salesforce.com, inc.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
# For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
#
"""
Transforms that rescale the input or otherwise normalize it.
"""
from collections import Ordered... |
<reponame>yoheikikuta/robust_physical_perturbations
#work-around for pylint bug 1869: https://github.com/PyCQA/pylint/issues/1869
from __future__ import print_function
import numpy as np
import tensorflow as tf
from tensorflow.python.platform import flags
import flags
from scipy.misc import imread, imsave, imresize
f... |
<filename>eddy/fit_cube.py
"""
Class to load up a velocity map and fit a Keplerian profile to it. The main
functions of interest are:
disk_coords: Given geometrical properties of the disk and the emission
surface, will deproject the data into a face-on view in either polar or
cartesian coordaintes.... |
"""
Example use of vixutil to plot the term structure.
Be sure to run vixutil -r first to download the data.
"""
import vixutil as vutil
import pandas as pd
import logging as logging
import asyncio
import sys
pd.set_option('display.max_rows', 10)
#need over two months
pd.set_option('display.min_rows', 10)
pd.set_op... |
<gh_stars>1-10
import os
import sys
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import numpy as np
import pandas as pd
import random
import h5py
from skimage import io
from skimage import feature
from skimage.draw import circle
from scipy.ndimage.morphology import binary_fill_holes
from... |
<reponame>SimScaleGmbH/external-building-aerodynamics
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 2 19:34:28 2021
@author: MohamadKhairiDeiri
"""
import pathlib
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from scipy import stats
import simscale_eba.ResultProce... |
# Routines for general quantum chemistry (no particular software package)
# Python3 and pandas
# <NAME>
#
import re, sys
#import string, copy
import copy
import numpy as np
import pandas as pd
import quaternion
from scipy.spatial.distance import cdist
from scipy import interpolate
from scipy import optimize
import mat... |
<reponame>Loisel/colorview2d<filename>colorview2d/mods/Smooth.py<gh_stars>0
"""
This mod performs a gaussian filter on the data. The window size for the
filter is specified by wx.lib.masked.NumCtrl widgets.
"""
from scipy.ndimage.filters import gaussian_filter
from colorview2d import imod
class Smooth(imod.IMod):
... |
<reponame>coreyabshire/marv<gh_stars>0
import time
import picamera
import numpy as np
import scipy.misc
#vw, vh = (640, 480)
vw, vh = (1920, 1440)
fps = 60
output = np.empty((vh * vw + (int(vh/2) * int(vw/2) * 2)), dtype=np.uint8)
with picamera.PiCamera(resolution=(vw,vh), framerate=fps) as camera:
time.sleep(1)
... |
import scipy.misc
import numpy as np
import random
ntrain = 1000
nval = 100
ntest = 2000
datafolder = '/storage/hpc_kuz/squares/images/raw'
def genimg(c):
image = [0] * 4
image[c] = 1
image = np.reshape(image, (2, 2))
return image
print 'Generating training images...'
with open(datafolder + '/train... |
<reponame>fagonzalezo/sklearn-kdcrf<gh_stars>0
"""
Class for RBF Sampler with Orthogonal Random Features
"""
import warnings
import numpy as np
import scipy.stats as stats
from scipy.linalg import hadamard
from sklearn.base import BaseEstimator
from sklearn.base import TransformerMixin
from sklearn.utils import check... |
<reponame>LeiShi/Synthetic-Diagnostics-Platform<gh_stars>1-10
""" Reading and post-processing functions for NSTX correlation reflectometry output. Raw data given by Dr. <NAME>.
Program by <NAME>, 05/16/2014
modules needed: h5py, numpy, scipy
"""
import h5py as h5
import numpy as np
from scipy.interpolate import inte... |
#!/usr/bin/env python
"""@package docstring
File: pde_uw_solver.py
Author: <NAME>
Email: <EMAIL>
Description:
"""
from .pde_solver import PDESolver
from scipy import sparse
import numpy as np
class PDEUWSolver(PDESolver):
"""!Solve the Fokker-Planck equation for passive crosslinkers using the
using the Crank... |
<reponame>malyvsen/unifit
import scipy.stats
# some distributions were excluded because they were:
# * deprecated
# * raising errors during fitting
# * taking ages to fit (levy_stable)
names = [
'alpha',
'anglit',
'arcsine',
'argus',
'beta',
'betaprime',
'bradford',
'burr',
'burr12... |
<gh_stars>0
# This file is part of the master thesis "Variational crimes in the Localized orthogonal decomposition method":
# https://github.com/TiKeil/Masterthesis-LOD.git
# Copyright holder: <NAME>
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
# This file is motivated by gridlod: ht... |
<reponame>kmiddleton/Pic-Numero
import numpy as np
from scipy import misc
from skimage.color import rgb2gray
from skimage.feature import greycomatrix, greycoprops
import Display
import Helper
import matplotlib.pyplot as plt
from skimage import data
from skimage import img_as_ubyte
from sklearn import linear_model
PATC... |
# -*- encoding: utf-8 -*-
import numpy as np
from scipy import sparse
import six
from autosklearn.constants import *
from autosklearn.data.abstract_data_manager import AbstractDataManager
class XYDataManager(AbstractDataManager):
def __init__(self, data_x, y, task, metric, feat_type, dataset_name,
... |
<filename>regreg/affine/__init__.py
from __future__ import print_function, division, absolute_import
from operator import add, mul
import warnings
import numpy as np
from scipy import sparse
def broadcast_first(a, b, op):
""" apply binary operation `op`, broadcast `a` over axis 1 if necessary
Parameters
... |
<gh_stars>1-10
#! /usr/bin/env python3
from functools import partial
import numpy as np
import scipy as sp
from scipy import stats
from math import ceil
from dataclasses import dataclass
from typing import Callable, Optional
from random import randint, random
from ca import Cell, CAType, CAShape, CA
from util.rand... |
import numpy as np
from loop_hafnian_batch import loop_hafnian_batch
from loop_hafnian_batch_gamma import loop_hafnian_batch_gamma
from scipy.special import factorial
from strawberryfields.decompositions import williamson
from thewalrus.quantum import (
Amat,
Qmat,
photon_number_mean_vector,
mean_clic... |
<gh_stars>1-10
import numpy as np
from scipy.special import jv
lambdaR = 3.83170597020751231561
R = 0.1
U = 1.0
lam = lambdaR / R
def magnetic_A(x, y, Lx, Ly):
return 0.0
def velocity_P(x, y, Lx, Ly):
r = np.sqrt(x**2 + y**2)
theta = np.arctan2(y, x)
if r < R:
return 2. * l... |
<gh_stars>0
import json
import networkx as nx
import numpy as np
import plotly
import plotly.graph_objects as go
import sympy as sp
def result(func):
def wrapper(params):
fig = go.Figure()
matrix = np.matrix(
[[int(x) for x in row.split()] for row in params["matrix"].split("\r\n")]
... |
"""
Numpy是python很多科学计算与工程库的基础库,在量化数据分析中最常使用的Pandas
也是基于Numpy的封装。可以说Numpy就是量化数据分析领域中的基础数组,学会使用Numpy
是量化分析中关键的一步
Numpy底层实现中使用了C语言和Fortran语言的机制分配内存。可以理解为它的输出是一个非常大且
联系的并且由同类型数据组成的内存区域,所以可以通过Numpy来构造一个比普通列表大的多的数组,并且
灵活高效地对数组中所有的元素进行并行化操作
"""
import timeit
import time
import numpy as np
import matplotlib.pyplot as plt
""... |
<reponame>astyler/hybridpy<gh_stars>1-10
__author__ = 'astyler'
import numpy as np
from scipy.interpolate import interp1d
from hybridpy.models import vehicles, batteries
def compute(trip, controls, soc_states=50, gamma=1.0,
cost_function=lambda fuel_rate, power, duration: fuel_rate * duration, vehicle=ve... |
"""Reading and Writing
"""
from pathlib import Path, PurePath
from typing import Optional, Union
from anndata import AnnData
import numpy as np
from PIL import Image
import pandas as pd
import stlearn
from .._compat import Literal
import scanpy
import scipy
_QUALITY = Literal["fulres", "hires", "lowres"]
def Read10X(... |
import numpy as np
from scipy import interpolate
##
# filter a list given indices
# @param alist a list
# @param indices indices in that list to select
def filter(alist, indices):
rlist = []
for i in indices:
rlist.append(alist[i])
return rlist
##
# Given a list of 1d time arrays, find the seq... |
<reponame>carina-kauf/ngym_usage
import pickle
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import os
from pathlib import Path
from scipy.spatial import distance
from sklearn import metrics
from sklearn.cluster import AgglomerativeClustering
from sklearn.metrics import si... |
import math
import os
import random
import sys
import time
from scipy.stats import binom
from scipy.stats import norm
from multiprocessing import Process, freeze_support
from genome import OMGenome
"""
Class responsible for conversion of fragment lengths into pixel image and back into operating resolution.
Methods... |
<reponame>nilqed/spadlib
import math
import numpy as np
import matplotlib.pyplot as plt
from collections.abc import MutableMapping
from fractions import Fraction
from mpmath import quad
from mpl_toolkits.mplot3d import axes3d, Axes3D
from matplotlib import cm
class Stack(MutableMapping):
'''
Implements a stack... |
import numpy as np
def find_similar_points(arr, elem, tols, input_dim=None):
if input_dim is None:
input_dim = arr.shape[1]
arr = arr[:, :input_dim]
elem = elem.reshape(-1)
bls = np.zeros(len(arr), dtype=bool)
for i in range(arr.shape[1]):
bls = np.logical_or(bls, (abs(arr[:, i] - e... |
<gh_stars>10-100
# Code créé par <NAME> le 7 Mai 2018
# Kolmogorov-Smyrnov Test extended to two dimensions.
# References:s
# [1] <NAME>. (1983). Two-dimensional goodness-of-fit testing
# in astronomy. Monthly Notices of the Royal Astronomical Society,
# 202(3), 615-627.
# [2] <NAME>., & <NAME>. (1987). A multidime... |
import numpy as np
from scipy.integrate._ivp.rk import (RungeKutta, RkDenseOutput, rk_step, norm,
SAFETY, MAX_FACTOR, MIN_FACTOR) # using scipy's values, not rksuite's
class BS45(RungeKutta):
"""Explicit Runge-Kutta method of order 5(4).
This uses the Bogacki-Shampine pair of formulas [1]_. It is d... |
<reponame>crpurcell/pythonFitting
#!/usr/bin/env python
from __future__ import print_function
#=============================================================================#
# #
# NAME: fit_1D_line_multinest.py ... |
<reponame>ryanp543/agrobottools<gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
import os
import csv
import time
import rospy
import matplotlib.pyplot as plt
import matplotlib.colors
from scipy.interpolate import interp1d
from tinkerforge.ip_connection import IPConnection
from tinkerforge... |
"""module to deal with gaussian cube type data
NB: for all transformations, the cubes coordinate system is understood to be
A = np.array([
[['(x0,y0,z0)', '(x0,y0,z1)'],
['(x0,y1,z0)', '(x0,y1,z1)']],
[['(x1,y0,z0)', '(x1,y0,z1)'],
['(x1,y1,z0)', '(x1,y1,z1)']]
])
which leads to;
A.shape -> (x... |
"""
{This script tests best fit SMHM for all surveys and compares the resulting
model SMF for both red and blue galaxies with those from data}
"""
# Libs
from halotools.empirical_models import PrebuiltSubhaloModelFactory
from cosmo_utils.utils.stats_funcs import Stats_one_arr
from cosmo_utils.utils import work_paths... |
<reponame>erslog/QGrain
__all__ = ["Resolver"]
from enum import Enum, unique
from typing import Dict, Iterable, List, Tuple
import numpy as np
from scipy.optimize import OptimizeResult, basinhopping, minimize
from QGrain.algorithms import AlgorithmData, DistributionType
from QGrain.models.AlgorithmSettings import Al... |
"""
Provides an interface to CUDA for running the parallel IBDTW and
partial IBDTW algorithms
"""
import pycuda.autoinit
import pycuda.driver as drv
import pycuda.gpuarray as gpuarray
import pycuda.cumath
import numpy as np
import matplotlib.pyplot as plt
import time
import scipy.io as sio
import pkg_resources
import ... |
<filename>detector_YOLO_v3_REID/YOLOv3_lindernoren/julius_display_detections_from_file.py<gh_stars>0
# Test PyTorch implementation of Yolov3 by <NAME>
# <NAME>, 2021, VUB
# PyTorch implementation of Yolov3 by <NAME>
import numpy as np
np.set_printoptions(suppress=True)
import detect
from models import *
import cv2
... |
<filename>velocileptors/Utils/spherical_bessel_transform.py
import numpy as np
from scipy.special import loggamma
import time
from velocileptors.Utils.loginterp import loginterp
class SphericalBesselTransform:
def __init__(self, qs, L=15, low_ring=True, fourier=False):
'''
Class to perform ... |
import pandas as pd
import numpy as np
np.random.seed(99)
from sklearn.model_selection import train_test_split
from sklearn.model_selection import KFold
from sklearn.model_selection import GridSearchCV
from sklearn.multioutput import MultiOutputClassifier, MultiOutputRegressor
from sklearn.multiclass import OneVsRestCl... |
<filename>esteem/tests/testdata.py
import os.path as op
import numpy as np
from scipy.io import loadmat
from ..basissets import BasisSet, BasisFunction
class TestCase:
def __init__(self, testid=None, molecule=None, atoms=None,
xyz=None, charge=None, basisset=None, method=None,
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 20 11:09:03 2020
@author: <NAME>
"""
import sys, os
import numpy as np
from math import ceil
import xarray as xr
import multiprocessing as mpi
import time
from joblib import Parallel, delayed
from tqdm import tqdm
import scipy.stats as st
from scipy... |
<reponame>ctralie/PublicationsCode<gh_stars>1-10
import wx
from wx import glcanvas
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
from OpenGL.arrays import vbo
from sys import exit, argv
import numpy as np
import scipy.io as sio
from scipy.io import wavfile
from pylab import cm
import os
im... |
"""
Analyze the output file in .pk format. The y_preds are continuous float numbers. The
rests are integers.
The results are print out and written to a json file when the write() method is
executed.
"""
import os
import pickle as pk
from collections import defaultdict
from statistics import mean, stdev
import json
f... |
# -*- coding: utf-8 -*-
"""Classes and functions that create the bandwidth measurements document
(v3bw) used by bandwidth authorities."""
# flake8: noqa: E741
# (E741 ambiguous variable name), when using l.
import copy
import logging
import math
import os
from itertools import combinations
from statistics import media... |
<filename>src/classifiers.py<gh_stars>1-10
from sklearn.naive_bayes import GaussianNB
from sklearn import svm
from sklearn.linear_model import LogisticRegression
from sklearn import tree
from sklearn.neighbors import KNeighborsClassifier
from sklearn.ensemble import RandomForestClassifier
from statistics import c... |
<reponame>edyounis/distributed
"""
Efficient serialization of SciPy sparse matrices.
"""
import scipy
from distributed.protocol.serialize import (
dask_deserialize,
dask_serialize,
register_generic,
)
register_generic(scipy.sparse.spmatrix, "dask", dask_serialize, dask_deserialize)
@dask_serialize.regis... |
<filename>kuka_arm/scripts/IK_server.py
#!/usr/bin/env python
# Copyright (C) 2017 Udacity Inc.
#
# This file is part of Robotic Arm: Pick and Place project for Udacity
# Robotics nano-degree program
#
# All Rights Reserved.
# Author: <NAME>
# import modules
import rospy
import tf
from kuka_arm.srv import *
from tra... |
<reponame>SCNUJackyChen/Visual_Impairment_Assistance_System
import cv2
import numpy as np
from keras_vggface.vggface import VGGFace
# 如果报错,打开keras_vggface/models.py将报错的import改为from keras.utils.layer_utils import get_source_inputs
from scipy.spatial.distance import cosine
detector = cv2.CascadeClassifier('./haarcascade... |
<gh_stars>1-10
from graphik.utils.geometry import skew
import graphik
import numpy as np
import networkx as nx
from numpy.typing import ArrayLike
from typing import Dict, List, Any, Union
from scipy.optimize import minimize
from liegroups.numpy import SE3, SO3, SE2, SO2
from numpy import pi
from graphik.utils.roboturdf... |
#!/usr/bin/env python3.7
# -*- coding: utf8 -*-
import numpy as np
import scipy.signal as signal
import scipy.integrate as integral
import os
home=os.environ['HOME']
dir='proyectos/scicrt/scibar-fitting'
name='{0}/{1}/19aug-7phe.adc'.format(home,dir)
Fs=2e9
f_mv=1000.0
f_ns=1e9
echarg=1.602e-7
# ganancia a -900V
#mu,... |
<reponame>max-centre/LabQSM
#! /usr/bin/env python3
import os
import sys
import numpy as np
import matplotlib.pyplot as plt
from scipy.interpolate import UnivariateSpline, interp1d
def main(argv):
#
# units
# 1 Ha/Bohr3 = 29421.02648438959 GPa
#
conv_RYAU_2_GPA=14710.513242194795
if (len(argv)==1):
... |
""" Generator for RNA of random in silico organisms
:Author: <NAME> <<EMAIL>>
:Date: 2018-06-11
:Copyright: 2018, Karr Lab
:License: MIT
"""
from numpy import random
import numpy
import scipy.constants
import wc_kb
import wc_kb_gen
class RnaGenerator(wc_kb_gen.KbComponentGenerator):
""" Generator for RNA for ra... |
<reponame>cosanlab/facesync<gh_stars>1-10
from __future__ import division
'''
FaceSync Utils Class
==========================================
VideoViewer: Watch video and plot data simultaneously.
AudioAligner: Align two audios manually
neutralface: points that show a face
ChangeAU: change AUs ... |
# Copyright 2020 Turbonomic, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
"""Module for extracting phase features
"""
import argparse
import numpy as np
from scipy.fftpack import dct
import scipy.io.wavfile as wavfile
import soundfile as sf
from python_speech_features.sigproc import preemphasis, framesig
import kaldi_io
from multiprocessing import Process
import os
# from data_reader.plot ... |
import typing
from pathlib import Path
import diffpy.srfit.pdf.characteristicfunctions
import matplotlib.pyplot as plt
import numpy as np
from diffpy.srfit.fitbase import FitRecipe, FitContribution, Profile, FitResults
from diffpy.srfit.fitbase.parameterset import ParameterSet
from diffpy.srfit.pdf import PDFGenerator... |
from typing import Dict, List, Set, cast, Tuple
import trio
import numpy
import math
import random
from lahja import EndpointAPI
from scipy import stats as st
from p2p.abc import NodeAPI, SessionAPI
from p2p.constants import KADEMLIA_BUCKET_SIZE
from trinity.constants import TO_NETWORKING_BROADCAST_CONFIG
from trini... |
<filename>main/transform.py<gh_stars>0
class Transform:
import numpy as np
import math
import cv2
from scipy import ndimage
def __init__(self):
# Nothing needs to be done except get the libraries and functions ready
pass
def getBestShift(self, img):
# TODO co... |
<reponame>gifford-lab/seqgra
"""
MIT - CSAIL - Gifford Lab - seqgra
ROC evaluator: creates ROC curves
@author: <NAME>
"""
from typing import Any, List
import numpy as np
import matplotlib.pyplot as plt
from sklearn.metrics import roc_curve, auc
from scipy import interp
import seqgra.constants as c
from seqgra.learn... |
<reponame>Jinsan-Dev/BaroDetector
import os
import numpy as np
import statistics as stat
import csv
import sys
from scipy.stats import kurtosis
def getZeroCrossingRate(arr):
np_array = np.array(arr)
return float("{0:.4f}".format((((np_array[:-1] * np_array[1:]) < 0).sum()) / len(arr)))
def getMea... |
<filename>b3_data_iter.py
""" Data iterator"""
import mxnet as mx
import numpy as np
import sys, os
import cv2
import time
import multiprocessing
import itertools
from scipy import ndimage
from sklearn import neighbors
sys.path.append('../')
from utils import get_rgb_data
from utils import get_spectral_data
from uti... |
#!/usr/bin/env python
# coding: utf-8
import os
import ee
import datetime
import tqdm
import json
import pandas as pd
import geopandas as gp
import numpy as np
import rsfuncs as rs
import multiprocessing as mp
import scipy.interpolate as interp
import matplotlib.pyplot as plt
from tqdm import tqdm
from tqdm.contrib... |
import numpy as np
from scipy import io as sio
from datetime import datetime, timedelta
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
def digits_dictionary():
"""
Dictionary containing the number of decimal places to be used for various variables
"""
dict= { 'index': ... |
from __future__ import print_function
import os
import re
import numpy as np
import scipy.stats as st
import matplotlib.pyplot as plt
import matplotlib.cm as mpl_cm
import matplotlib.colors as colors
from matplotlib import ticker
from collections import namedtuple
from typing import List
from scipy.signal import s... |
## modified from https://github.com/alno/kaggle-allstate-claims-severity/blob/master/keras_util.py
# This is not an ideal implementation of Polyak averaging.
# It adds a significant wait time to the end of each epoch when it saves
# a copy of the latest moving average version of the model.
import numpy as np
import s... |
<reponame>joshfuchs/ZZCeti_analysis<gh_stars>0
'''
Written May 2016 by JTF
Reads in grids of chi-square values and computes minimum for each one.
Eventually will want to create surface plots.
Can use Axes3D.scatter to plot individual points
To Do:
- Determine actual minumun chi square value at lowest point for plott... |
<filename>quantum-dot/Model.py
import kwant
import numpy as np
import scipy.sparse.linalg as sla
import logging
def make_system(a=1, t=1.0, r=10):
"""Make QD system with magnetic field
Docs: https://kwant-project.org/doc/1/tutorial/spectrum
"""
lat = kwant.lattice.square(a, norbs=1)
syst = kwant.... |
<filename>kn_iris/iris_matching.py
import os
from kn_iris.feature_vec import *
import pickle, numpy as np, re
import threading
try:
import queue
que=queue.Queue()
except ImportError:
from multiprocessing import Queue
que=Queue()
from scipy.spatial import distance
try:
import itertools.imap as ... |
<reponame>iMoonLab/THU-HyperG<filename>hyperg/learning/classification/inductive.py
# coding=utf-8
import numpy as np
import scipy.sparse as sparse
from hyperg.hyperg import HyperG, IMHL
from hyperg.utils import print_log, init_label_matrix, calculate_accuracy
def inductive_fit(hg, y, lbd, mu, eta, max_iter, log=True... |
import numpy as np
import scipy.integrate as scint
def get_traj(system, iv, tmax=1.0, sampling_period=0.1):
"""given a system with the signature f(t, x), return a time evolution
trajectory at initial value iv"""
sol = scint.solve_ivp(system,
[0, tmax],
i... |
<filename>models/load_data.py
import os
import random
from time import time
from scipy.io import loadmat
from scipy import misc
from PIL import Image
import numpy as np
random.seed(0)
TRAIN_FOLDER = '/hd1/imagenet-data/train'
VALIDATION_FOLDER = '/hd1/imagenet-data/validation'
META_PATH = '/home/yangfan/meta.mat'
BA... |
import csv
import sys
from scipy.spatial import cKDTree
import numpy as np
from utils import (
get_mdsd_cbow_embedding_weights_file,
get_mdsd_cbow_wordvec_closest_neighbors_file,
get_mdsd_cbow_wordvec_closest_neighbors_csv_file,
read_mdsd_index2word_pck_file,
INDEX_UNKNOWN_WORD,
WORD_UNKNOWN_W... |
<reponame>Mr-Milk/SpatialTis
from ast import literal_eval
from typing import Any, Dict, Optional
import pandas as pd
from anndata import AnnData
from scipy.spatial.distance import euclidean
from spatialtis.abc import AnalysisBase
from spatialtis.config import Config
from spatialtis.utils import NeighborsNotFoundError... |
#! /usr/bin/env python
# Copyright(c) 2014, The mtSet developers (<NAME>, <NAME>, <NAME>)
# All rights reserved.
from limix.mtSet.core.simPhenoCore import simPheno
from optparse import OptionParser
import scipy as SP
def entry_point():
parser = OptionParser()
parser.add_option("--bfile", dest='bfile', ... |
<filename>convert_matfile.py
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 27 13:10:15 2016
@author: ksansom
"""
"""
Tool converts matfile from dan's ultrasound images to
a format that can be read by vtk, or ITK-SNAP
"""
import scipy.io as io
import numpy as np
from evtk.hl import imageToVTK
from evtk.hl impor... |
<reponame>amrkh97/Arabic-OCR-Using-Python
import csv
import cv2
import feature_extractor as FE
import glob
import numpy as np
import os
import pandas as pd
import time
import torch
import neural_network as NN
import NN2
from commonfunctions import *
from scipy import stats
def save_letters_to_csv(letter):
hw = FE... |
<reponame>gngdb/llamass
# AUTOGENERATED! DO NOT EDIT! File to edit: 06_dip.ipynb (unless otherwise specified).
__all__ = ['sparse_to_full', 'SMPL_ForwardKinematics_Sparse', 'iter_pkl_in']
# Cell
import os
import pickle
from pathlib import Path
import numpy as np
import torch
import llamass.core
import llamass.transfo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.