text
string
""" Tools for creating and manipulating 1,2, and 3D meshes. .. inheritance-diagram:: proteus.MeshTools :parts: 1 """ from __future__ import print_function from __future__ import absolute_import from __future__ import division from builtins import input from builtins import zip from builtins import next from builtin...
""" Visitor hierarchy to inspect and/or create IETs. The main Visitor class is adapted from https://github.com/coneoproject/COFFEE. """ from collections import OrderedDict from collections.abc import Iterable import cgen as c from devito.exceptions import VisitorException from devito.ir.iet.nodes import Node, Itera...
from numpy import zeros from numpy.linalg import eigvals import time import numpy as np import scipy as sp import scipy.signal as signal import scipy.sparse as sparse import osqp import matplotlib.pyplot as plt import matplotlib.cm as cm from .controller import Controller from ..learning.edmd import Edmd class MP...
from imblearn import under_sampling, over_sampling from sklearn import base, model_selection, metrics, preprocessing import numpy as np import matplotlib.pyplot as plt from scipy import stats class UndersampledEnsemble(): """ Shuffled K-fold undersampled ensemble. """ def __init__(self, base_clf, dbnam...
<reponame>yudhik11/Rootnet_3DMPPE import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import axes3d, Axes3D import numpy as np import sys from scipy.signal import savgol_filter #python utils_plt.py data/horizontal.npy def plt_lines(filename = 'data/ch_2.npy', data=None): if data is None: data = np.l...
<gh_stars>1-10 import numpy as np from scipy import constants import matplotlib.pyplot as plt import matplotlib.animation as animation import matplotlib as mpl import meep import meep_ext from numpipe import scheduler, pbar import miepy from matplotlib.backends.backend_pdf import PdfPages job = scheduler() nm = 1e-9 u...
# ! # * Copyright (c) Microsoft Corporation. All rights reserved. # * Licensed under the MIT License. See LICENSE file in the # * project root for license information. import time import numpy as np import pandas as pd from sklearn.metrics import ( mean_squared_error, r2_score, roc_auc_score, ...
# Copyright 2018 Xanadu Quantum Technologies 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 agre...
import sys try: from StringIO import StringIO except ImportError: from io import StringIO import numpy as np from numpy.testing import (assert_, assert_array_equal, assert_allclose, assert_equal) from pytest import raises as assert_raises from scipy.sparse import coo_matrix from sc...
<reponame>rickyim/ceviche import unittest import numpy as np import matplotlib.pylab as plt import autograd.numpy as npa import sys sys.path.append('../') from ceviche import fdfd_hz, fdfd_ez, jacobian from ceviche.utils import imarr import scipy.sparse.linalg as spl import scipy.sparse as sp from ceviche.utils import ...
from __future__ import division import itertools import logging import numpy as np import time import cv2 as cv import sys import tqdm from scipy import stats def exhaustive_search_block_matching(reference_img, search_img, block_size=16, max_search_range=16, norm='l1', verbose...
<filename>hera_cal/smooth_cal.py # -*- coding: utf-8 -*- # Copyright 2018 the HERA Project # Licensed under the MIT License import numpy as np import scipy from hera_cal import io, utils from collections import OrderedDict as odict from copy import deepcopy import warnings import uvtools import argparse from hera_cal....
import numpy as np import scipy.signal as signal from desidlas.datasets.datasetting import split_sightline_into_samples,select_samples_50p_pos_neg,pad_sightline from desidlas.datasets.preprocess import label_sightline from desidlas.dla_cnn.spectra_utils import get_lam_data from desidlas.dla_cnn import defs REST_RANGE =...
from imports import * from scipy.io.wavfile import read as readwav from numpy.lib.stride_tricks import as_strided sample_rate = 48000 # sample rate for samples and input def load_wavs_from_dir(path): fnames = map(lambda f: f.path, filter( lambda f: f.is_file(), ...
"""Filter design. """ from __future__ import division, print_function, absolute_import import warnings import numpy from numpy import (atleast_1d, poly, polyval, roots, real, asarray, allclose, resize, pi, absolute, logspace, r_, sqrt, tan, log10, arctan, arcsinh, sin, e...
''' ------------------------------------------------------------------------ Last updated 7/13/2015 Functions for generating omega, the T x S array which describes the demographics of the population This py-file calls the following other file(s): utils.py data\demographic\demographic_data.csv ...
<reponame>duttashi/Data-Analysis-Visualization<gh_stars>1-10 # coding: utf-8 # ## K-means clustering # #### This notebook presents the machine learning analysis of the gapminder dataset accessible from http://www.gapminder.org/data/ # In[1]: get_ipython().magic(u'matplotlib inline') # import the necessary librarie...
<gh_stars>0 #!/usr/local/bin/ python3 # This script is to compare the any FAT fitting directory and produce the plots of the Current_Status report. #Last processed is pyFAT V0.0.3 #The config file should be the only input required. The script assumes that the model/high resolution fit is in ModelInput.def #FATInput='/...
# PnP Node # # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> from scipy.spatial import transform import torch from kornia.geometry import conversions import open3d import numpy as np import random from scipy.spatial.transform import Rotation import copy from ddn.pytorch.node import * import ddn.pytorch.geometry_utilities as g...
<filename>exoplanet_transit_snr/snr_estimate.py # -*- coding: utf-8 -*- from ctypes import c_long from glob import glob from itertools import combinations from os import makedirs from os.path import basename, dirname, join, realpath from typing import Tuple, Union import matplotlib.pyplot as plt import numpy as np imp...
import argparse import random,os,sys import numpy as np import csv from scipy import stats import time from sklearn.model_selection import train_test_split from sklearn import metrics from sklearn.metrics import roc_auc_score from sklearn import preprocessing import pandas as pd import keras.backend as K from keras.mod...
import pandas as pd import math import datetime import numpy as np import statistics as stat #from portfolio import Portfolio class Finance: """ Contains methods to calculate important statistical characeristics of securities and their relationships to each other to build efficient portfolios """...
"""Define the Problem class and a FakeComm class for non-MPI users.""" import sys import pprint import os import logging import weakref import time from collections import defaultdict, namedtuple, OrderedDict from fnmatch import fnmatchcase from itertools import product from io import StringIO import numpy as np im...
''' Created on Mar 23, 2016 This module is used for multi-dimensional scaling. @author: mernberger ''' import matplotlib #from matplotlib.mlab import PCA as mlabPCA from matplotlib import pyplot as plt from matplotlib import offsetbox from mpl_toolkits.mplot3d import Axes3D import pandas as pd import pypipegraph as pp...
<filename>utils/RX.py ################################################### # FILE: rx.py # # AUTHOR: NotPike # # Function: Handles audio record, functions # # refered from alijamaliz. # # https://github.com/alijamaliz/DTMF...
#!/usr/bin/env python # coding: utf-8 # The decision which model to use or what hyperparameters are most suitable is often based on some Cross-Validation technique producing an estimate of the out-of-sample prediction error $\bar{Err}$. # # An alternative technique to produce an estimate of the out-of-sample error i...
# -*- coding: utf-8 -*- """ Created on Mon Apr 13 20:05:29 2020 @author: gosl241 """ import argparse import sys #SG: once you install the package this is unecessariy #sys.path.insert(0, "../../") import hyphalnet.hypha as hyp from hyphalnet.hypha import hyphalNetwork import hyphalnet.proteomics as prot import hyph...
import os from PIL import Image import pandas as pd import numpy as np import time, threading from multiprocessing import Pool import scipy.io as sio import my_transform as T import scipy.stats as st import time def transform(): # base_size = args.img_size + 64 # crop_size = args.img_size transforms = [] # ...
<gh_stars>1-10 import os import numpy as np import torch import torchvision import albumentations as A import pandas as pd import matplotlib.pyplot as plt import pandas as pd import random from random import Random from datetime import datetime from torch.utils.data import Dataset from glob import glob from PIL impor...
<reponame>TechnicalConsultant123/financial-maths<gh_stars>1-10 import numpy as np from scipy import stats def european_call(x, rb, T, d1, K, rq, d2): return x * np.exp(-rb * T) * stats.norm.cdf(d1) - K * np.exp(-rq * T) * stats.norm.cdf(d2) def calc_d1(x, K, rq, sg, T, rb): return (np.log(x / K) + (rq - rb ...
"""Example of a devito forward/gradient implementation for a single source with odl.""" import numpy as np import matplotlib.pyplot as plt from scipy import ndimage import odl from devito import Function from examples.seismic import Model, RickerSource, Receiver, TimeAxis, PointSource from examples.seismic.acoustic im...
<gh_stars>1-10 import numpy as np import sg_utils as utils from scipy.interpolate import interp1d from IPython.core.debugger import Tracer def calc_pr_ovr(counts, out, K): """ [P, R, score, ap] = calc_pr_ovr(counts, out, K) Input : counts : number of occurrences of this word in the ith image out :...
<reponame>bergkvist/pandapower # -*- coding: utf-8 -*- # Copyright (c) 2016-2020 by University of Kassel and Fraunhofer Institute for Energy Economics # and Energy System Technology (IEE), Kassel. All rights reserved. from scipy.optimize import minimize from pandapower.estimation.algorithm.base import BaseAlgorithm ...
import numpy as np from scipy import linalg import matplotlib as mpl import matplotlib.pyplot as plt # from plt import cm from matplotlib import rc import time import IPython # rc('font', **{'family': 'sans-serif', 'sans-serif': ['Helvetica']}) # rc('text', usetex=True) def make_meshgrid(x, y, h=.02): """Create...
# -*- coding: utf-8 -*- """ Created on Wed Nov 7 15:47:38 2018 @author: jdietric """ #pyqt import #from PyQt5 import QtCore, QtGui, QtWidgets # other imports import os import sys import numpy as np import pandas as pd import sympy.geometry as spg import matplotlib.path as mplPath from datetime import datetime from ...
<reponame>MingtaoGuo/-Chinese-Character-and-Calligraphic-Image-Processing import numpy as np import matplotlib.pyplot as plt from PIL import Image import scipy.misc as misc import os def find_row(img): row_locs = [] locs = np.zeros([2]) y = np.sum(img, axis=1, dtype=np.int32) - 10 y = np....
<reponame>rukmal/FE-621-Homework<filename>fe621/black_scholes/call.py from .util import computeD1D2 from scipy.stats import norm import numpy as np def blackScholesCall(current: float, volatility: float, ttm: float, strike: float, rf: float) -> float: """Function to compute the Black-Scholes...
<filename>delphi/AnalysisGraph.py import os import json import pickle import random from math import exp, log, pi from datetime import date from functools import partial from itertools import permutations, cycle, chain from typing import Dict, Optional, Union, Callable, Tuple, List, Iterable from uuid import uuid4 impo...
<reponame>Yin-YinjianZhao/WarpX<filename>Examples/Modules/space_charge_initialization/analysis.py #!/usr/bin/env python3 # Copyright 2019-2020 <NAME>, <NAME> # # This file is part of WarpX. # # License: BSD-3-Clause-LBNL """ This script checks the space-charge initialization routine, by verifying that the space-charg...
from PIL import Image, ImageDraw, ImageFont import io import numpy as np import pandas as pd import folium from matplotlib.colors import LinearSegmentedColormap, rgb_to_hsv, hsv_to_rgb import scipy.ndimage.filters from pathlib import Path pd.options.display.max_columns = 50 def main(dir): # Loading Data Set p...
<filename>ndispers/media/glasses/_caf2.py<gh_stars>1-10 import sympy from sympy.utilities import lambdify from ndispers._baseclass import Medium, wl, T from ndispers.helper import vars2 class CaF2(Medium): """ Ca F_2 (Calcium fluolide) crystal - Point group : Fm3m - Crystal system : cubic - Tranpa...
<gh_stars>10-100 ################################################################# # One-nearest neighbor classifier ################################################################# from optparse import OptionParser import sklearn from sklearn.neighbors import NearestNeighbors import scipy from scipy.stats import ...
import numpy as np from kamodo import Kamodo, kamodofy, gridify from scipy.interpolate import RegularGridInterpolator, interp1d from netCDF4 import Dataset import time from datetime import datetime,timedelta,timezone import numpy.ma as ma # constants and dictionaries ctipe_kamodo_variable_names = dict( density='rho'...
<reponame>LucasGab/Plane-Generator ''' Programa desenvolvido por: <NAME> - 1º Semestre NºUSP: 11218880 Curso: Ciências da Computação - USP Matéria: Geometria Analítica Professor: <NAME> Código da matéria: SMA0300 Descrição: Programa que faz o gráfico de 3 planos e sua intersecção. Data de desenvolvimento: 25 - 27 de ab...
#!/usr/bin/env python from __future__ import print_function import math import matplotlib matplotlib.use("PDF") fig_size = [8.3,11.7] # din A4 params = {'backend': 'pdf', 'axes.labelsize': 10, 'text.fontsize': 10, 'legend.fontsize': 10, 'xtick.labelsize': 8, 'ytick.labelsize...
<filename>quspin/basis/base.py from __future__ import print_function import numpy as _np import scipy.sparse as _sp import warnings,numba @numba.njit def _coo_dot(v_in,v_out,row,col,ME): n = row.shape[0] m = v_in.shape[1] for i in range(n): r = row[i] c = col[i] me = ME[i] for j in range(m): v_out[r,j] ...
# linha de comando python convolutions.py --image 3d_pokemon.png # pacotes necessários from skimage.exposure import rescale_intensity import numpy as np import argparse import cv2 import pdb import time from scipy import stats # método de convulsão def convolve(image, kernel): # dimensões espaciais da imagem,...
<reponame>vsomnath/holoprot """ Functions to compute features for a patch on the protein surface. Taken from https://github.com/LPDI-EPFL/masif """ import numpy as np from Bio.PDB import Selection from Bio.PDB.Residue import Residue from subprocess import PIPE, Popen import os from scipy.spatial import KDTree from typ...
<gh_stars>0 import networkx as nx import numpy as np from scipy.spatial import KDTree def getInputNeighbors(q, tree, knn, rnn): d, i = tree.query(q, k=knn, eps=0.0, p=2.0, distance_upper_bound=rnn) d = list(d) i = list(i) nn = 0 if d.count(float('inf')) > 0: infIndex = d.index(float('inf'...
<gh_stars>0 # -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import import math import cmath import unittest from flypy import jit from flypy.runtime import mathlib import numpy as np # ______________________________________________________________________ class TestMathLib(unittes...
<gh_stars>1-10 from pathlib import Path import argparse import scipy.misc import numpy as np import imageio from utils import load_case # Constants DEFAULT_KIDNEY_COLOR = [255, 0, 0] DEFAULT_TUMOR_COLOR = [0, 0, 255] DEFAULT_HU_MAX = 512 DEFAULT_HU_MIN = -512 DEFAULT_OVERLAY_ALPHA = 0.3 DEFAULT_PLANE = "axial" de...
<filename>mner/model.py import numpy as np import theano.tensor as T import theano from scipy.linalg import svd """ model.py (module) This module contains the basic model classes, their objective functions, gradients, constraints, and Hessians. For now, the only model is the 'MNEr' model for the low-rank ...
<filename>training-data/converge-diverge/preProcess.py<gh_stars>10-100 """ A simple pre-processing file for converting raw OpenFOAM data to PyTorch tensors. This makes reading the data by the neural network signifcantly faster. Additionally, depending on the flow, spacial averages can be taken to increase smoothness o...
# -*- coding: utf-8 -*- ################################################################################### # MIT License # Copyright (c) 2015-2017 <NAME> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in...
#!/usr/bin/env python ############################################################################ # # This file contains different functions used for the processing of Geodesy # data. # # written by <NAME> and <NAME> # # 16 July 2020 # # note that all *csv files have to be unique! # # requires - pandas versio...
<gh_stars>1-10 import numpy as np import scipy import scipy.io as sio import sys import pandas as pd import os import datetime import time import copy import estimator from tqdm import tqdm from timeit import default_timer as timer from initialize import initialize from Adaptive_SEIR import SEIR from multiprocessing...
<reponame>grlee77/dask-summit-2021-life-sciences # adapted from cuCIM, see ../LICENSE-3rdparty.txt import os import pickle import cupy import cupy as cp import cupyx.scipy.ndimage import dask.array as da import dask_image import dask_image.ndfilters import numpy as np import pandas as pd import scipy from _image_ben...
<filename>Newton-Raphson-Method.py import sympy as sp x, y, z = sp.symbols('x y z') sp.init_printing() # Here we simply give the input needed as The Following: # ( Xi ) is The Initial Point # ( Fx ) is the equation of the function # ( n ) is the number of Iterations needed Xi = 0 Fx = x**3 -0.2589*x**2+0.2262*x -...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html from gensim.summarization.textcleaner import tokenize_by_word as _tokenize_by_word from gensim.utils import to_unicode import numpy import scipy def mz_keywords(text, blocksize=1024, scores=Fal...
<filename>smt/applications/moe.py """ Author: <NAME> <<EMAIL>> This package is distributed under New BSD license. Mixture of Experts """ # TODO : support for best number of clusters # TODO : implement verbosity 'print_global' # TODO : documentation import numpy as np import warnings OLD_SKLEARN = False try: # scik...
from ctypes import CDLL, c_int, c_double, POINTER import numpy as np from config import get_library_path library = CDLL(get_library_path("eigen")) c_int_p = POINTER(c_int) c_double_p = POINTER(c_double) _solve_eigen_icholt_coo = library.solve_eigen_icholt_coo _solve_eigen_icholt_coo.restype = c_int _solve_eigen_icho...
<filename>eureka/S4_generate_lightcurves/s4_genLC.py #! /usr/bin/env python # Generic Stage 4 light curve generation pipeline # Proposed Steps # -------- ----- # 1. Read in Stage 3 data products # 2. Replace NaNs with zero # 3. Determine wavelength bins # 4. Increase resolution of spectra (optional) # 5. Smooth...
import abc import numpy as np import pandas as pd import scipy.cluster.hierarchy as sch from fipie.common import ReprMixin class ClusterAlgo(ReprMixin, metaclass=abc.ABCMeta): def __init__(self, max_clusters): self.max_clusters = max_clusters def pre_process(self, data: pd.DataFrame) -> pd.DataFra...
<reponame>impressive8/Practice # ============================================================= # This file contains helper functions and classes # # <NAME>, 2017 # # Report bugs/suggestions: # <EMAIL> # ============================================================= import png import numpy as np import scipy.misc impo...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Author: <NAME> <<EMAIL>> # Copyright (C) 2017 <NAME> <<EMAIL>> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """Scikit learn interface for :class:`gensim.models.lsimodel.LsiModel`. Follows scikit-learn API conventions to facilitate using g...
<filename>af_primitives/afSKMLPRegressor.py from typing import Any, Callable, List, Dict, Union, Optional, Sequence, Tuple from numpy import ndarray from collections import OrderedDict from scipy import sparse import os import sklearn import numpy import typing import pandas # Custom import commands if any from af_mul...
from sympy import S, Rational from sympy import re, im, conjugate, sign from sympy import sqrt, sin, cos, acos, exp, ln from sympy import trigsimp from sympy import integrate from sympy import Matrix from sympy import sympify from sympy.core.evalf import prec_to_dps from sympy.core.expr import Expr class Quaternion(E...
<gh_stars>1-10 import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plot import matplotlib.cm as cm # cm.rainbow import sys, pprint, math, numpy, sympy, simpy, getopt from math import factorial from numpy import linalg from patch import * from commonly_used import * ''' # ------------------------------...
<filename>spimcube/spimclass.py import re import copy import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib.widgets import (AxesWidget, Slider, Button, RadioButtons, CheckButtons, Cursor, MultiCursor, RectangleSelector, Lasso) from matplotlib import path from matplotlib.collections import RegularPol...
# -*- coding: utf-8 -*- """ Define functions useful for conversion between different NFW conventions This module contains the functions used to move between NFW conventions and to transform NFW parameters into lenstronomy inputs. """ import numpy as np from ..Utils import cosmology_utils import numba from scipy.interp...
import numpy as np from scipy.stats import norm, truncnorm def _em_step_body_(args): """ Does a step of the EM algorithm, needed to dereference args to support parallelism """ return _em_step_body(*args) def _em_step_body(Z, r_lower, r_upper, sigma, num_ord_updates=1): """ Iterate the rows ove...
<reponame>Abeilles14/motion_planning<filename>python_src/rrts/3D/main.py # STATE MACHINE FOR 3D PICK AND PLACE SIMULATION import numpy as np from numpy.linalg import norm from math import * from matplotlib import pyplot as plt from matplotlib.patches import Polygon from random import random from scipy.spatial import Co...
<filename>VIV_data_on_velocities.py import tensorflow.compat.v1 as tf import numpy as np import matplotlib.pyplot as plt import scipy.io from scipy.interpolate import griddata import time from plotting import newfig, savefig import matplotlib.gridspec as gridspec from mpl_toolkits.axes_grid1 import make_axes_locatable ...
<reponame>kastnerkyle/tfbldr import matplotlib matplotlib.use("Agg") import os import argparse import tensorflow as tf import numpy as np from tfbldr.datasets import fetch_fruitspeech from tfbldr.datasets.audio import soundsc from tfbldr.datasets.audio import overlap from tfbldr.plot import specgram from tfbldr.plot i...
<reponame>liningtonlab/npmrd_curator """Takes data blocks and converts to ACS style guide string. """ from typing import Dict from statistics import mean def write_all(data: Dict) -> str: n = data.get("name", "") # optr = optical_rotation(data.get("optical_rotation")) # uv = uv_spectroscopy(data.get("uv_s...
<filename>stanford/sms-tools/lectures/04-STFT/plots-code/hamming.py import matplotlib.pyplot as plt import numpy as np from scipy.fftpack import fft M = 64 N = 512 hN = N//2 hM = M//2 fftbuffer = np.zeros(N) mX1 = np.zeros(N) plt.figure(1, figsize=(7.5, 4)) fftbuffer[hN-hM:hN+hM]=np.hamming(M) plt.subplot(2,1,1)...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ # CODE NAME HERE # CODE DESCRIPTION HERE Created on 2019-08-21 at 12:28 @author: cook """ from astropy.table import Table from astropy import constants as cc from astropy import units as uu import numpy as np import os from scipy.optimize import curve_fit import warn...
import os import numpy as np import scipy.io as sio import torch ISING_GRID_H = 4 ISING_GRID_W = 4 ISING_N_EDGES = 24 CONTAMINATION_N_STAGES = 25 AEROSTRUCTURAL_N_COUPLINGS = 21 def sample_init_points(n_vertices, n_points, random_seed=None): """ :param n_vertices: 1D array :param n_points: :para...
<reponame>catalystneuro/tank-lab-to-nwb """Authors: <NAME>, <NAME>.""" import os import sys from pathlib import Path from shutil import which import numpy as np from datetime import datetime from scipy.io import loadmat, matlab from collections import Iterable try: from typing import ArrayLike except ImportError...
<reponame>prateek-rtk/jun #!/usr/bin/env python # -*- coding: utf-8 -*- import sys import scipy as sp import numpy as np import matplotlib as mpl import pandas as pd import sklearn as skl import operator as opt import pyodbc as pyodbc from io import StringIO from dateutil.parser import parse mpl.use('Agg') opers = {'<...
# -*- coding: utf-8 -*- """ Created on Thu Jan 15, 2015 @author: <NAME> """ from __future__ import print_function from .filter import \ _lowpass_ba, _highpass_ba, _bandpass_ba, \ _lowpass_ba_lanczos, _highpass_ba_lanczos import numpy as np import matplotlib.pyplot as plt from scipy.signal import freqz # -...
#coding: utf-8 import wave import pyaudio import matplotlib.pyplot as plt import numpy as np import time import wave from scipy.fftpack import fft, ifft from scipy import signal def printWaveInfo(wf): """WAVEファイルの情報を取得""" print( "chn:", wf.getnchannels()) print( "width:", wf.getsampwidth()) print( "sam...
<filename>pisa/stages/osc/pi_nusquids.py ''' Oscillation stage using nuSQuIDS ''' # TODO Check if can speed up by linking containers in certain modes (see `pi_prob3`) # TODO Update descriptions/docs from __future__ import absolute_import, print_function, division # TODO Clean these up, including numba import math i...
# Copyright 1999-2020 Alibaba Group Holding Ltd. # # 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 a...
<filename>test_IRC10420_IR.py<gh_stars>0 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Jan 3 16:27:40 2022 @author: nbadolo """ """ Code simplifié """ import numpy as np from astropy.io import fits from scipy import optimize import cv2 # pour ameliorer la résolution de l'image from astropy.ndda...
<filename>filters.py # 2014.04.29 # S.Rodney # HST Filter transmission curves: plotting and such import numpy as np from matplotlib import pylab as pl import os topdir = os.path.abspath( '.' ) try : sndataroot = os.environ['SNDATA_ROOT'] os.chdir( sndataroot+'/filters/HST_CANDELS') w435, f435 = np.loadt...
<gh_stars>10-100 from sklearn import metrics import numpy as np import time from scipy import stats from mlxtend.evaluate import permutation_test class DataSanitization(): def __init__(self, data): self.data = data def is_complete(self, column): return self.data[column].isnull().sum()...
<filename>dmtreduce/utils.py import os import pathlib as path from matplotlib import pyplot as plt from astropy.visualization import ZScaleInterval from scipy.signal import savgol_filter def quickplot_spectra(data, contrast=1, make_figure=True, show=True, outfile=None, colorbar=False): """ Quickly plot an easi...
import statistics from collections import deque from ParadoxTrading.Indicator.IndicatorAbstract import IndicatorAbstract from ParadoxTrading.Utils import DataStruct class KDJ(IndicatorAbstract): def __init__( self, _k_period: int = 20, _d_period: int = 3, _j_period...
__all__ = ['SimplicialComplex','simplicial_complex'] from warnings import warn import numpy import scipy from numpy import array, dot, inner, ones, cross, copysign from scipy import sparse, zeros, asarray, mat, hstack import pydec from pydec.mesh.simplex import simplex, simplicial_mesh from pydec.math import (circum...
from scipy.interpolate import LinearNDInterpolator, NearestNDInterpolator, interp1d from scipy.spatial import ConvexHull import numpy as np class DTL_Classifier(): def __init__(self): self.dtl = None self.nnl = None self.hull = None self.max1d = None self.min1d =...
import pickle import sympy as sp import numpy as np from racing import offboard from utils import base, racing_env from utils.constants import * def racing(args): track_layout = args["track_layout"] track_spec = np.genfromtxt("data/track_layout/" + track_layout + ".csv", delimiter=",") if args["simulation...
<filename>nerual_style/main.py<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- # File: main.py # Author: <NAME> <<EMAIL>> import os import argparse import numpy as np from scipy import misc import tensorflow as tf from utils import load_image from neural_style import NerualStyle VGG_PATH = '/home/qge2/w...
"""Most of these tests come from the examples in Bronstein's book.""" from sympy.integrals.risch import DifferentialExtension, derivation from sympy.integrals.prde import (prde_normal_denom, prde_special_denom, prde_linear_constraints, constant_system, prde_spde, prde_no_cancel_b_large, prde_no_cancel_b_small, ...
#!/usr/bin/env python """Script that parses CATME peer evaluation data and plots summary plots and statistics. The CATME Peer evaluation results are provided in a CSV file which contains more than one table and mixed in metadata. The data are separated by double line returns and are as follows: 1. Extraneous metadat...
from graph_data import graph_data import numpy as np from scipy.linalg import block_diag from typing import Final from networkx.generators.random_graphs import watts_strogatz_graph, barabasi_albert_graph, fast_gnp_random_graph from networkx.linalg.graphmatrix import adjacency_matrix class Gnp_overfit: def __init__...
import requests import json import sys import matplotlib.pyplot as plt import seaborn as sns import numpy as np from scipy.optimize import curve_fit from matplotlib.ticker import PercentFormatter # get all # url = 'http://localhost:5000/gasstat' headers = {'content-type': 'application/json'} response = requests.get(u...
<gh_stars>10-100 import os import sys import re import ast from heapq import nlargest import matplotlib import matplotlib.pyplot as plt from matplotlib.lines import Line2D from matplotlib.patches import Rectangle, Circle, PathPatch, Path import numpy as np import scipy.interpolate import tkinter as tk import cv2 import...
<filename>graph.py<gh_stars>10-100 import matplotlib.pyplot as plt import seaborn as sns sns.set(style = "whitegrid", palette = "muted") import numpy as np import matplotlib.gridspec as gridspec import csv import pandas as pd from scipy import misc def generategraph(x, accuracy, lost): fig = plt.figure(figsiz...
<reponame>Lituchy/nrpyunittesting<gh_stars>0 import NRPy_param_funcs as par import re from SIMD import expr_convert_to_SIMD_intrins from collections import namedtuple lhrh = namedtuple('lhrh', 'lhs rhs') outCparams = namedtuple('outCparams', 'preindent includebraces declareoutputvars outCfileaccess outCverbose CSE_ena...