repo
stringlengths
2
99
file
stringlengths
13
225
code
stringlengths
0
18.3M
file_length
int64
0
18.3M
avg_line_length
float64
0
1.36M
max_line_length
int64
0
4.26M
extension_type
stringclasses
1 value
gwsky
gwsky-master/gwsky/para_sampler/__init__.py
from .para_sampler import ParameterSampler from .prior_dict import PriorDictSampler from .mass import O3aMassSampler from .sky import uniform_sky_sampler, SHSkySampler, DipoleSkySampler
185
45.5
68
py
gwsky
gwsky-master/gwsky/para_sampler/sky.py
import numpy as np from scipy.special import lpmv, eval_legendre from healpy.rotator import rotateDirection, dir2vec from bilby.core.prior import Prior, Uniform, Sine, Cosine, Interped, PriorDict from .para_sampler import ParameterSampler from .prior_dict import PriorDictSampler from ..utils import sh_normal_coeff, r...
6,291
34.954286
110
py
wgenpatex
wgenpatex-main/model.py
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu") # Generator's convolutional blocks 2D class Conv_block2D(nn.Module): def __init__(self, n_ch_in, n_ch_out, m=0.1): ...
3,143
33.173913
160
py
wgenpatex
wgenpatex-main/run_optim_synthesis.py
import argparse import wgenpatex parser = argparse.ArgumentParser() parser.add_argument('target_image_path', help='paths of target texture image') parser.add_argument('-s', '--size', default=None, help="size of synthetized texture [nrow, ncol] (default: target texture size)") parser.add_argument('-w', '--patch_size', ...
1,523
68.272727
188
py
wgenpatex
wgenpatex-main/wgenpatex.py
import torch from torch import nn from torch.autograd.variable import Variable import matplotlib.pyplot as plt import numpy as np import math import time import model from os import mkdir from os.path import isdir DEVICE = torch.device('cuda' if torch.cuda.is_available() else 'cpu') print(DEVICE) def imread(img_name)...
14,073
34.185
157
py
wgenpatex
wgenpatex-main/run_cnn_synthesis.py
import argparse import wgenpatex import model import torch parser = argparse.ArgumentParser() parser.add_argument('target_image_path', help='paths of target texture image') parser.add_argument('-w', '--patch_size', type=int,default=4, help="patch size (default: 4)") parser.add_argument('-nmax', '--n_iter_max', type=in...
1,562
54.821429
188
py
descqa
descqa-master/setup.py
#!/usr/bin/env python """ DESCQA: LSST DESC QA Framework for mock galaxy catalogs Copyright (c) 2018 LSST DESC http://opensource.org/licenses/MIT """ import os from setuptools import setup with open(os.path.join(os.path.dirname(__file__), 'descqa', 'version.py')) as f: exec(f.read()) #pylint: disable=W0122 setup...
1,291
33
145
py
descqa
descqa-master/descqa/base.py
from __future__ import division, unicode_literals, absolute_import import os __all__ = ['BaseValidationTest', 'TestResult'] class TestResult(object): """ class for passing back test result """ def __init__(self, score=None, summary=None, passed=False, skipped=False, inspect_only=False): """ ...
3,403
27.366667
105
py
descqa
descqa-master/descqa/readiness_test.py
from __future__ import print_function, division, unicode_literals, absolute_import import os import re import fnmatch from itertools import cycle from collections import defaultdict, OrderedDict import numpy as np import numexpr as ne from scipy.stats import norm from .base import BaseValidationTest, TestResult from ....
17,354
40.92029
252
py
descqa
descqa-master/descqa/DensityVersusSkyPosition.py
from __future__ import unicode_literals, absolute_import, division import os import numpy as np from scipy.stats import binned_statistic from .base import BaseValidationTest, TestResult from .plotting import plt import healpy as hp __all__ = ['DensityVersusSkyPosition'] def create_hp_map(ra, dec, nside): """ ...
2,990
46.47619
125
py
descqa
descqa-master/descqa/SizeDistribution.py
import os import numpy as np from itertools import count import re from .base import BaseValidationTest, TestResult from .plotting import plt from .utils import get_opt_binpoints __all__ = ['SizeDistribution'] class SizeDistribution(BaseValidationTest): """ validation test to check the slope of the size distr...
6,607
48.313433
107
py
descqa
descqa-master/descqa/basic_test.py
from __future__ import division, unicode_literals, absolute_import import os from builtins import str #pylint: disable=W0622 import yaml import numpy as np import healpy as hp from .base import BaseValidationTest, TestResult from .plotting import plt __all__ = ['ListAvailableQuantities', 'SkyArea'] class ListAvailabl...
4,516
39.693694
148
py
descqa
descqa-master/descqa/plotting.py
import matplotlib mpl = matplotlib mpl.use('Agg') # Must be before importing matplotlib.pyplot mpl.rcParams['font.size'] = 13.0 mpl.rcParams['font.family'] = 'serif' mpl.rcParams['mathtext.fontset'] = 'stix' mpl.rcParams['legend.frameon'] = False mpl.rcParams['legend.fontsize'] = 'small' mpl.rcParams['figure.dpi'] = 2...
696
29.304348
59
py
descqa
descqa-master/descqa/truth_galaxy_verification.py
from __future__ import unicode_literals, absolute_import, division import os import re import numpy as np from .base import BaseValidationTest, TestResult from .plotting import plt __all__ = ['TruthGalaxyVerification'] class TruthGalaxyVerification(BaseValidationTest): """ Verify the galaxy components of the ...
4,557
41.598131
161
py
descqa
descqa-master/descqa/clf_test.py
from __future__ import unicode_literals, absolute_import, division import os import numpy as np from GCR import GCRQuery from .base import BaseValidationTest, TestResult from .plotting import plt __all__ = ['ConditionalLuminosityFunction'] class ConditionalLuminosityFunction(BaseValidationTest): def __init__(sel...
6,179
42.216783
115
py
descqa
descqa-master/descqa/stats.py
from __future__ import division from builtins import range # pylint: disable=W0622 import numpy as np from scipy.stats import chi2 def get_subvolume_indices(x, y, z, box_size, n_side): side_size = box_size/n_side return np.ravel_multi_index(np.floor(np.vstack((x, y, z))/side_size).astype(int), (n_side,)*3, 'w...
2,681
30.928571
132
py
descqa
descqa-master/descqa/SizeStellarMassLuminosity.py
from __future__ import print_function, division, unicode_literals, absolute_import import os import numpy as np import re from GCR import GCRQuery from scipy import interpolate from scipy.stats import binned_statistic try: from itertools import zip_longest except ImportError: from itertools import izip_longest ...
16,283
56.744681
166
py
descqa
descqa-master/descqa/shear_test.py
from __future__ import unicode_literals, absolute_import, division import os import time import numpy as np from scipy.interpolate import interp1d from scipy.integrate import quad from sklearn.cluster import k_means import treecorr import pyccl as ccl import camb import camb.correlations import astropy.units as u imp...
17,211
42.574684
163
py
descqa
descqa-master/descqa/ColorDistribution.py
from __future__ import unicode_literals, absolute_import, division import os import re import numpy as np import numexpr as ne from astropy.table import Table from scipy.ndimage.filters import uniform_filter1d from GCR import GCRQuery from .base import BaseValidationTest, TestResult from .plotting import plt from .sta...
22,014
48.250559
127
py
descqa
descqa-master/descqa/BiasVersusRedshift.py
from __future__ import print_function, division, unicode_literals, absolute_import import os import numpy as np import scipy.optimize as op import re from GCR import GCRQuery import pyccl as ccl from .base import TestResult from .CorrelationsTwoPoint import CorrelationsAngularTwoPoint from .plotting import plt from ...
13,544
48.615385
128
py
descqa
descqa-master/descqa/EllipticityDistribution.py
from __future__ import print_function, division, unicode_literals, absolute_import import os try: from itertools import zip_longest except ImportError: from itertools import izip_longest as zip_longest from itertools import count import re import numpy as np from scipy.interpolate import interp1d from GCR impo...
24,835
49.997947
192
py
descqa
descqa-master/descqa/utils.py
""" utility functions for descqa """ from __future__ import unicode_literals, division, print_function, absolute_import import numpy as np import healpy as hp __all__ = [ 'get_sky_volume', 'get_opt_binpoints', 'get_healpixel_footprint', 'generate_uniform_random_ra_dec', 'generate_uniform_random_ra...
7,981
27.609319
152
py
descqa
descqa-master/descqa/DeltaSigmaTest.py
import os import numpy as np import treecorr from scipy.interpolate import interp1d from astropy import units as u from astropy.coordinates import SkyCoord, search_around_sky import astropy.constants as cst from astropy.cosmology import WMAP7 # pylint: disable=no-name-in-module from .base import BaseValidationTest, Tes...
14,192
47.773196
248
py
descqa
descqa-master/descqa/CheckColors.py
from __future__ import print_function, unicode_literals, absolute_import, division import os import sys import re import numpy as np import numexpr as ne from .base import BaseValidationTest, TestResult from .plotting import plt from astropy.table import Table from scipy.spatial import distance_matrix import ot from nu...
19,030
45.079903
157
py
descqa
descqa-master/descqa/EmlineRatioTest.py
# pylint: disable=E1101,E0611,W0231,W0201 # E1101 throws errors on my setattr() stuff and astropy.units.W and astropy.units.Hz # E0611 throws an error when importing astropy.cosmology.Planck15 # W0231 gives a warning because __init__() is not called for BaseValidationTest # W0201 gives a warning when defining attribute...
23,850
41.139576
221
py
descqa
descqa-master/descqa/version.py
__version__ = '2.0.0-0.7.0'
28
13.5
27
py
descqa
descqa-master/descqa/QuickBkgTest.py
from __future__ import unicode_literals, absolute_import, division import os import sqlite3 import numpy as np from .base import BaseValidationTest, TestResult from .plotting import plt __all__ = ['QuickBkgTest'] def compute_bkg(image): """ Routine to give an estimate of the mean, median and std of the b...
5,339
34.131579
131
py
descqa
descqa-master/descqa/CorrelationsTwoPoint.py
from __future__ import print_function, division, unicode_literals, absolute_import import os from collections import defaultdict import re import numpy as np import scipy.special as scsp import treecorr import healpy as hp from sklearn.cluster import k_means from GCR import GCRQuery from .base import BaseValidationTes...
37,232
41.796552
145
py
descqa
descqa-master/descqa/ImgPkTest.py
from __future__ import unicode_literals, absolute_import, division import os import numpy as np from scipy.stats import binned_statistic, chi2 from astropy.table import Table from .base import BaseValidationTest, TestResult from .plotting import plt from .utils import first, is_string_like __all__ = ['ImgPkTest'] cla...
5,597
39.273381
134
py
descqa
descqa-master/descqa/NumberDensityVersusRedshift.py
from __future__ import print_function, division, unicode_literals, absolute_import import os import math import re try: from itertools import zip_longest except ImportError: from itertools import izip_longest as zip_longest import numpy as np from GCR import GCRQuery from sklearn.cluster import k_means from ....
24,043
44.973231
145
py
descqa
descqa-master/descqa/StellarMassFunction.py
from __future__ import print_function, division, unicode_literals, absolute_import import os try: from itertools import zip_longest except ImportError: from itertools import izip_longest as zip_longest from itertools import count import numpy as np from GCR import GCRQuery from .base import BaseValidationTest,...
15,804
46.893939
133
py
descqa
descqa-master/descqa/__init__.py
""" DESCQA Validation Tests """ from .register import * from .base import * from .version import __version__
109
14.714286
32
py
descqa
descqa-master/descqa/register.py
import os import importlib import yaml from .base import BaseValidationTest __all__ = ['available_validations', 'load_validation', 'load_validation_from_config_dict'] def load_yaml(yaml_file): """ Load *yaml_file*. Ruturn a dictionary. """ with open(yaml_file) as f: config = yaml.safe_load(f...
3,051
28.066667
126
py
descqa
descqa-master/descqa/ColorRedshiftTest.py
from __future__ import unicode_literals, absolute_import, division import os import re import numpy as np from scipy.stats import binned_statistic as bs import matplotlib.colors as clr from .base import BaseValidationTest, TestResult from .plotting import plt __all__ = ['ColorRedshiftTest'] class _CatalogDoesNotHaveQ...
16,610
50.747664
175
py
descqa
descqa-master/descqa/StellarMassDistribution.py
import os import numpy as np from GCR import GCRQuery from .base import BaseValidationTest, TestResult from .plotting import plt __all__ = ["StellarMassTest"] class StellarMassTest(BaseValidationTest): """ This validation test looks at stellar mass distribution of DC2 catalogs to make sure it matches...
4,241
36.539823
120
py
descqa
descqa-master/descqa/CheckAstroPhoto.py
from __future__ import print_function, division import os import numpy as np from scipy.stats import binned_statistic from CatalogMatcher.match import spatial_closest # https://github.com/LSSTDESC/CatalogMatcher from GCR import GCRQuery from .base import BaseValidationTest, TestResult from .plotting import plt from ma...
6,989
48.928571
142
py
descqa
descqa-master/descqa/apparent_mag_func_test.py
from __future__ import unicode_literals, absolute_import, division import os import re import numpy as np from scipy.interpolate import interp1d from .utils import get_sky_area from .base import BaseValidationTest, TestResult from .plotting import plt possible_observations = { 'HSC': { 'filename_template'...
11,963
41.728571
131
py
descqa
descqa-master/descqa/example_test.py
from __future__ import unicode_literals, absolute_import, division import os import numpy as np from .base import BaseValidationTest, TestResult from .plotting import plt __all__ = ['ExampleTest'] class ExampleTest(BaseValidationTest): """ An example validation test """ def __init__(self, **kwargs): ...
1,841
29.7
84
py
descqa
descqa-master/descqa/PositionAngle.py
import os from itertools import count import numpy as np import scipy.stats from .base import BaseValidationTest, TestResult from .plotting import plt __all__ = ['PositionAngle'] class PositionAngle(BaseValidationTest): """ validation test to check that the distribution of galaxy position sizes is random. ...
3,335
40.7
102
py
descqa
descqa-master/descqa/virialscale_test.py
from __future__ import unicode_literals, absolute_import, division from .plotting import plt from .base import BaseValidationTest, TestResult import numpy as np import matplotlib from matplotlib.colors import LogNorm from astropy.cosmology import WMAP7 as cosmo # pylint: disable=E0611 import astropy.stats as stat im...
11,227
51.223256
259
py
descqa
descqa-master/v1/descqa/base.py
import os __all__ = ['BaseValidationTest'] class BaseValidationTest(object): """ very abstract class for validation test class """ def run_validation_test(self, catalog_instance, catalog_name, output_dir): raise NotImplementedError def plot_summary(self, output_file, catalog_list): ...
1,830
30.568966
85
py
descqa
descqa-master/v1/descqa/ValidationTest.py
from __future__ import division, print_function import os from warnings import warn import itertools zip = itertools.izip import numpy as np import matplotlib mpl = matplotlib mpl.use('Agg') # Must be before importing matplotlib.pyplot mpl.rcParams['font.size'] = 13.0 mpl.rcParams['font.family'] = 'serif' mpl.rcParam...
15,735
36.466667
164
py
descqa
descqa-master/v1/descqa/HaloMassFunctionTest.py
from __future__ import division, print_function import os import subprocess import numpy as np from .BinnedStellarMassFunctionTest import BinnedStellarMassFunctionTest class HaloMassFunctionTest(BinnedStellarMassFunctionTest): """ validation test class object to compute halo mass function bins """ _p...
5,114
39.595238
121
py
descqa
descqa-master/v1/descqa/CalcStats.py
from __future__ import division, print_function import numpy as np from scipy.stats import chi2 def get_subvolume_indices(x, y, z, box_size, n_side): side_size = box_size/n_side return np.ravel_multi_index(np.floor(np.vstack((x, y, z))/side_size).astype(int), (n_side,)*3, 'wrap') def jackknife(data, jack_in...
2,561
29.5
108
py
descqa
descqa-master/v1/descqa/WprpTest.py
from __future__ import division, print_function import os import numpy as np from warnings import warn from .ValidationTest import * from helpers.CorrelationFunction import projected_correlation class WprpTest(ValidationTest): """ validation test class object to compute project 2-point correlation function w...
2,671
31.585366
107
py
descqa
descqa-master/v1/descqa/ColorDistributionTest.py
from __future__ import division, print_function import os from warnings import warn import numpy as np from scipy.ndimage.filters import uniform_filter1d from .ValidationTest import TestResult, plt from .base import BaseValidationTest from .CalcStats import CvM_statistic from .ComputeColorDistribution import load_SDS...
21,099
43.514768
195
py
descqa
descqa-master/v1/descqa/ComputeColorDistribution.py
from __future__ import division, print_function import numpy as np from astropy.io import fits from astropy.table import Table import os import kcorrect from astropy.cosmology import FlatLambdaCDM def load_SDSS(filename, colors, SDSS_kcorrection_z): """ Compute the CDF of SDS...
3,610
32.435185
182
py
descqa
descqa-master/v1/descqa/__init__.py
# This is an empty file to make this directory a python package """ DESCQA Validation Tests """ from .register import * __version__ = '1.1.0'
142
19.428571
63
py
descqa
descqa-master/v1/descqa/StellarMassHaloMassTest.py
from __future__ import division, print_function import os import subprocess import numpy as np from .ValidationTest import * def mean_y_in_x_bins(y, x, bins, sorter=None): y = np.asanyarray(y) k = np.searchsorted(x, bins, sorter=sorter) res = [] for i, j in zip(k[:-1], k[1:]): if j == i: ...
4,421
33.015385
116
py
descqa
descqa-master/v1/descqa/register.py
import os import importlib import yaml from .base import BaseValidationTest __all__ = ['available_validations', 'load_validation', 'load_validation_from_config_dict'] def load_yaml(yaml_file): """ Load *yaml_file*. Ruturn a dictionary. """ with open(yaml_file) as f: config = yaml.safe_load(f...
2,922
27.656863
126
py
descqa
descqa-master/v1/descqa/BinnedStellarMassFunctionTest.py
from __future__ import division, print_function import os import numpy as np from .ValidationTest import * class BinnedStellarMassFunctionTest(ValidationTest): """ validation test class object to compute stellar mass function bins """ _plot_config = dict(\ xlabel=r'$M_* \; [{\rm M}_\odot]$',...
5,060
37.930769
125
py
descqa
descqa-master/v1/GCRCatalogs/YaleCAMGalaxyCatalog.py
# Yale CAM galaxy catalogue class # Duncan Campbell # Yale University # February, 2016 # load modules import os import re import numpy as np import h5py from astropy.cosmology import FlatLambdaCDM import astropy.units as u from .GalaxyCatalogInterface import GalaxyCatalog __all__ = ['YaleCAMGalaxyCatalog'] class Yal...
7,150
36.835979
100
py
descqa
descqa-master/v1/GCRCatalogs/MB2GalaxyCatalog.py
# Massive Black 2 galaxy catalog class import numpy as np from astropy.table import Table import astropy.units as u import astropy.cosmology from .GalaxyCatalogInterface import GalaxyCatalog class MB2GalaxyCatalog(GalaxyCatalog): """ Massive Black 2 galaxy catalog class. """ def __init__(self, **kwar...
7,881
51.198675
134
py
descqa
descqa-master/v1/GCRCatalogs/GalaxyCatalogInterface.py
# DESCQA galaxy catalog interface. This defines the GalaxyCatalog base class # and, on import, registers all of the available catalog readers. Convenience # functions are defined that enable automatic detection of the appropriate # catalog type. # Note: right now we are working with galaxy properties as floats, with #...
6,439
38.268293
90
py
descqa
descqa-master/v1/GCRCatalogs/config.py
__all__ = ['base_catalog_dir'] base_catalog_dir = '/global/cfs/cdirs/lsst/groups/CS/descqa/catalog'
100
32.666667
68
py
descqa
descqa-master/v1/GCRCatalogs/GalacticusGalaxyCatalog.py
# Argonne galaxy catalog class. import os import re import numpy as np import h5py import astropy.cosmology import astropy.units as u from .GalaxyCatalogInterface import GalaxyCatalog class GalacticusGalaxyCatalog(GalaxyCatalog): """ Argonne galaxy catalog class. Uses generic quantity and filter mechanisms ...
19,154
44.176887
113
py
descqa
descqa-master/v1/GCRCatalogs/SHAMGalaxyCatalog.py
# SHAM galaxy catalog class # Contact: Yao-Yuan Mao <[email protected]> import os import numpy as np from astropy.cosmology import FlatLambdaCDM #from GalaxyCatalogInterface import GalaxyCatalog GalaxyCatalog = object class SHAMGalaxyCatalog(GalaxyCatalog): """ SHAM galaxy catalog class. """ def ...
3,934
44.755814
115
py
descqa
descqa-master/v1/GCRCatalogs/SAGGalaxyCatalog.py
#! /usr/bin/env python import os import h5py import numpy as np import astropy.cosmology import astropy.units as u from .GalaxyCatalogInterface import GalaxyCatalog class SAGGalaxyCatalog(GalaxyCatalog): """ Semi-Analytic Galaxies (SAG) model galaxy catalog class. Uses generic quantity and filter mechanis...
22,166
37.753497
120
py
descqa
descqa-master/v1/GCRCatalogs/__init__.py
""" DESCQA v1 reader interface """ from .register import * __version__ = '1.1.1'
81
12.666667
26
py
descqa
descqa-master/v1/GCRCatalogs/iHODGalaxyCatalog.py
# Massive Black 2 galaxy catalog class import numpy as np import astropy.cosmology import h5py import astropy.units as u from .GalaxyCatalogInterface import GalaxyCatalog class iHODGalaxyCatalog(GalaxyCatalog): """ iHOD galaxy catalog class. """ def __init__(self, **kwargs): fn = kwargs.get('...
5,592
39.528986
90
py
descqa
descqa-master/v1/GCRCatalogs/register.py
import os import importlib import yaml from .config import base_catalog_dir __all__ = ['available_catalogs', 'get_catalog_config', 'get_available_catalogs', 'load_catalog'] def load_yaml(yaml_file): """ Load *yaml_file*. Ruturn a dictionary. """ with open(yaml_file) as f: config = yaml.safe_...
3,261
26.644068
117
py
descqa
descqa-master/descqarun/master.py
from __future__ import print_function, unicode_literals, absolute_import import os import sys import shutil import time import json import logging import traceback import importlib import argparse import collections import fnmatch import subprocess try: from StringIO import StringIO except ImportError: from io...
18,221
36.64876
145
py
descqa
descqa-master/descqarun/config.py
__all__ = ['base_url'] base_url = 'https://portal.nersc.gov/cfs/lsst/descqa/v2/'
81
26.333333
57
py
descqa
descqa-master/descqarun/__init__.py
""" DESCQA Execution Script """ from .master import main __version__ = '2.1.1'
79
12.333333
24
py
descqa
descqa-master/descqaweb/twopanels.py
from __future__ import unicode_literals, print_function import os import sys from . import config from .interface import DescqaRun, b64encode __all__ = ['prepare_leftpanel', 'print_file'] def prepare_leftpanel(run, test=None, catalog=None, right=None): try: descqa_run = DescqaRun(run, config.root_dir) ...
3,473
34.814433
102
py
descqa
descqa-master/descqaweb/main.py
from __future__ import print_function, unicode_literals import sys import cgi from jinja2 import Environment, PackageLoader from . import config from .bigtable import prepare_bigtable from .twopanels import prepare_leftpanel, print_file from .matrix import prepare_matrix __all__ = ['run'] env = Environment(loader=Pa...
2,516
33.958333
132
py
descqa
descqa-master/descqaweb/config.py
from __future__ import unicode_literals __all__ = ['site_title', 'root_dir', 'general_info', 'static_dir', 'run_per_page', 'logo_filename', 'github_url', 'months_to_search'] root_dir = '/global/cfs/cdirs/lsst/groups/CS/descqa/run/v2' site_title = 'DESCQA (v2): LSST DESC Quality Assurance for Galaxy Catalogs' run_per...
1,232
46.423077
182
py
descqa
descqa-master/descqaweb/bigtable.py
from __future__ import unicode_literals import html from .interface import iter_all_runs, DescqaRun from . import config __all__ = ['prepare_bigtable'] try: unicode # pylint: disable=used-before-assignment except NameError: unicode = str # pylint: disable=redefined-builtin def format_status_count(status_c...
3,735
40.054945
140
py
descqa
descqa-master/descqaweb/__init__.py
""" DESCQA Web Interface """ from .main import run __version__ = '2.1.0'
73
11.333333
21
py
descqa
descqa-master/descqaweb/interface.py
from __future__ import unicode_literals import os import re import json import datetime import base64 __all__ = ['b64encode', 'iter_all_runs', 'DescqaRun'] ALLOWED_EXT = {'txt', 'dat', 'csv', 'log', 'json', 'yaml', 'pdf', 'png', 'html'} STATUS_COLORS = {'PASSED': 'green', 'SKIPPED': 'gold', 'INSPECT': 'blue', 'FAILED...
8,045
31.443548
181
py
descqa
descqa-master/descqaweb/matrix.py
from __future__ import unicode_literals import time import html from . import config from .interface import iter_all_runs, DescqaRun __all__ = ['prepare_matrix'] def find_last_descqa_run(): last_run = None for run in iter_all_runs(config.root_dir): descqa_run = DescqaRun(run, config.root_dir, validat...
4,624
40.294643
148
py
descqa
descqa-master/tests/test_descqa_subclasses.py
import descqa def test_subclass_name_in_config(): for validation_name, validation_config in descqa.available_validations.items(): assert 'subclass_name' in validation_config, "{}.yaml has no `subclass_name`".format(validation_name) def test_subclass_importable(): validations = set(v['subclass_name'] f...
491
43.727273
109
py
descqa
descqa-master/tests/test_descqa_utils.py
from __future__ import division import numpy as np from scipy.stats import chi2 import healpy as hp from descqa.utils import * def check_ra_dec_basic(ra, dec, n): assert ra.size == n assert dec.size == n assert (ra <= 360.0).all() assert (ra >= 0.0).all() assert (dec <= 90.0).all() assert (dec...
1,327
29.181818
77
py
descqa
descqa-master/descqagen/app_mag_func_test/data/__init__.py
0
0
0
py
Transformers-From-Optimization
Transformers-From-Optimization-main/combination_energy.py
import torch as tc import torch.nn as nn import matplotlib.pyplot as plt from tqdm import tqdm from utils import set_random_seed import pdb import sklearn import sklearn.decomposition from matplotlib.patches import ConnectionPatch set_random_seed(233) def F_norm(Y): return (Y ** 2).sum() n = 500 d = 128 W1 = tc....
3,850
24.335526
125
py
Transformers-From-Optimization
Transformers-From-Optimization-main/divergence.py
import torch as tc import torch.nn as nn import matplotlib.pyplot as plt from tqdm import tqdm from utils import set_random_seed import pdb import sklearn import sklearn.decomposition import scipy.spatial as spt import itertools set_random_seed(23333) def norm(x): return (x ** 2).sum(-1) ** 0.5 W = tc.randn(2,2)...
1,504
19.902778
67
py
Transformers-From-Optimization
Transformers-From-Optimization-main/utils.py
import random import torch as tc import numpy as np def set_random_seed(seed): random.seed(seed) np.random.seed(seed) tc.manual_seed(seed) tc.cuda.manual_seed_all(seed) tc.backends.cudnn.deterministic = True tc.backends.cudnn.benchmark = False
269
21.5
42
py
Transformers-From-Optimization
Transformers-From-Optimization-main/apollo_circle.py
import torch as tc import torch.nn as nn import matplotlib.pyplot as plt from tqdm import tqdm from utils import set_random_seed import pdb import sklearn import sklearn.decomposition import scipy.spatial as spt import itertools set_random_seed(23333) def norm(x): return (x ** 2).sum(-1) ** 0.5 def paint(xf,xh,C...
1,370
25.365385
81
py
Transformers-From-Optimization
Transformers-From-Optimization-main/energy_curve/main.py
from model import Transformer import torch as tc import torch.nn as nn import torch.nn.functional as F from fastNLP.io import IMDBLoader from fastNLP.io import IMDBPipe from fastNLP.embeddings import StaticEmbedding import pdb import pickle from pathlib import Path import matplotlib.pyplot as plt from load_data import ...
1,428
24.517857
64
py
Transformers-From-Optimization
Transformers-From-Optimization-main/energy_curve/paint.py
from model import Transformer import torch as tc import torch.nn as nn import torch.nn.functional as F from fastNLP.io import IMDBLoader from fastNLP.io import IMDBPipe from fastNLP.embeddings import StaticEmbedding import pdb import pickle from pathlib import Path import matplotlib.pyplot as plt from load_data import ...
2,092
28.069444
85
py
Transformers-From-Optimization
Transformers-From-Optimization-main/energy_curve/model.py
import torch as tc import torch.nn as nn import torch.nn.functional as F import pdb alpha_1 = 1 alpha_2 = 1 def norm2(X): return (X ** 2).sum() def inner(x,y): return (x.view(-1) * y.view(-1)).sum() idxs_cache = {} class Attention(nn.Module): def __init__(self , d): super().__init__() ...
4,459
21.989691
90
py
Transformers-From-Optimization
Transformers-From-Optimization-main/energy_curve/load_data.py
from model import Transformer import torch as tc import torch.nn as nn import torch.nn.functional as F from fastNLP.io import IMDBLoader , SST2Loader from fastNLP.io import IMDBPipe , SST2Pipe from fastNLP.embeddings import StaticEmbedding import pdb import pickle from pathlib import Path import matplotlib.pyplot as pl...
1,638
29.351852
82
py
pybullet-gym
pybullet-gym-master/setup.py
from setuptools import setup, find_packages import sys, os.path # Don't import gym module here, since deps may not be installed sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'pybulletgym')) VERSION = 0.1 setup_py_dir = os.path.dirname(os.path.realpath(__file__)) need_files = [] datadir = "pybulletgym/e...
1,288
32.921053
202
py
pybullet-gym
pybullet-gym-master/__init__.py
0
0
0
py
pybullet-gym
pybullet-gym-master/pybulletgym/__init__.py
from pybulletgym.envs import register # this is included to trigger env loading
80
80
80
py
pybullet-gym
pybullet-gym-master/pybulletgym/envs/gym_utils.py
import inspect import os from pybulletgym.envs.roboschool.robots.robot_bases import BodyPart currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(currentdir) os.sys.path.insert(0, parentdir) import pybullet_data def get_cube(p, x, y, z): body = p.loa...
889
31.962963
100
py
pybullet-gym
pybullet-gym-master/pybulletgym/envs/__init__.py
from gym.envs.registration import register # roboschool envs ## pendula register( id='InvertedPendulumPyBulletEnv-v0', entry_point='pybulletgym.envs.roboschool.envs.pendulum.inverted_pendulum_env:InvertedPendulumBulletEnv', max_episode_steps=1000, reward_threshold=950.0, ) register( id='InvertedDoublePendulumPy...
4,367
26.130435
127
py
pybullet-gym
pybullet-gym-master/pybulletgym/envs/assets/__init__.py
0
0
0
py
pybullet-gym
pybullet-gym-master/pybulletgym/envs/mujoco/__init__.py
0
0
0
py
pybullet-gym
pybullet-gym-master/pybulletgym/envs/mujoco/envs/env_bases.py
import gym, gym.spaces, gym.utils, gym.utils.seeding import numpy as np import pybullet from pybullet_utils import bullet_client from pkg_resources import parse_version class BaseBulletEnv(gym.Env): """ Base class for Bullet physics simulation environments in a Scene. These environments create single-player scene...
3,411
24.654135
91
py
pybullet-gym
pybullet-gym-master/pybulletgym/envs/mujoco/envs/__init__.py
0
0
0
py
pybullet-gym
pybullet-gym-master/pybulletgym/envs/mujoco/envs/manipulation/pusher_env.py
from pybulletgym.envs.mujoco.envs.env_bases import BaseBulletEnv from pybulletgym.envs.mujoco.robots.manipulators.pusher import Pusher from pybulletgym.envs.mujoco.scenes.scene_bases import SingleRobotEmptyScene class PusherBulletEnv(BaseBulletEnv): def __init__(self): self.robot = Pusher() BaseBu...
2,136
35.844828
112
py
pybullet-gym
pybullet-gym-master/pybulletgym/envs/mujoco/envs/manipulation/reacher_env.py
from pybulletgym.envs.mujoco.envs.env_bases import BaseBulletEnv from pybulletgym.envs.mujoco.robots.manipulators.reacher import Reacher from pybulletgym.envs.mujoco.scenes.scene_bases import SingleRobotEmptyScene import numpy as np class ReacherBulletEnv(BaseBulletEnv): def __init__(self): self.robot = R...
1,556
38.923077
131
py
pybullet-gym
pybullet-gym-master/pybulletgym/envs/mujoco/envs/manipulation/striker_env.py
from pybulletgym.envs.mujoco.envs.env_bases import BaseBulletEnv from pybulletgym.envs.mujoco.robots.manipulators.striker import Striker from pybulletgym.envs.mujoco.scenes.scene_bases import SingleRobotEmptyScene import numpy as np class StrikerBulletEnv(BaseBulletEnv): def __init__(self): self.robot = S...
3,262
39.283951
176
py
pybullet-gym
pybullet-gym-master/pybulletgym/envs/mujoco/envs/manipulation/__init__.py
0
0
0
py
pybullet-gym
pybullet-gym-master/pybulletgym/envs/mujoco/envs/manipulation/thrower_env.py
from pybulletgym.envs.mujoco.envs.env_bases import BaseBulletEnv from pybulletgym.envs.mujoco.robots.manipulators.thrower import Thrower from pybulletgym.envs.mujoco.scenes.scene_bases import SingleRobotEmptyScene import numpy as np class ThrowerBulletEnv(BaseBulletEnv): def __init__(self): self.robot = T...
2,849
39.140845
182
py
pybullet-gym
pybullet-gym-master/pybulletgym/envs/mujoco/envs/locomotion/ant_env.py
from pybulletgym.envs.mujoco.envs.locomotion.walker_base_env import WalkerBaseMuJoCoEnv from pybulletgym.envs.mujoco.robots.locomotors.ant import Ant class AntMuJoCoEnv(WalkerBaseMuJoCoEnv): def __init__(self): self.robot = Ant() WalkerBaseMuJoCoEnv.__init__(self, self.robot)
299
32.333333
87
py
pybullet-gym
pybullet-gym-master/pybulletgym/envs/mujoco/envs/locomotion/walker_base_env.py
from pybulletgym.envs.mujoco.envs.env_bases import BaseBulletEnv from pybulletgym.envs.roboschool.scenes import StadiumScene import pybullet as p import numpy as np class WalkerBaseMuJoCoEnv(BaseBulletEnv): def __init__(self, robot, render=False): print("WalkerBase::__init__") BaseBulletEnv.__init...
5,349
44.338983
179
py
pybullet-gym
pybullet-gym-master/pybulletgym/envs/mujoco/envs/locomotion/half_cheetah_env.py
from pybulletgym.envs.mujoco.envs.locomotion.walker_base_env import WalkerBaseMuJoCoEnv from pybulletgym.envs.mujoco.robots.locomotors.half_cheetah import HalfCheetah import numpy as np class HalfCheetahMuJoCoEnv(WalkerBaseMuJoCoEnv): def __init__(self): self.robot = HalfCheetah() WalkerBaseMuJoCo...
1,316
30.357143
170
py
pybullet-gym
pybullet-gym-master/pybulletgym/envs/mujoco/envs/locomotion/hopper_env.py
from pybulletgym.envs.mujoco.envs.locomotion.walker_base_env import WalkerBaseMuJoCoEnv from pybulletgym.envs.mujoco.robots.locomotors.hopper import Hopper import numpy as np class HopperMuJoCoEnv(WalkerBaseMuJoCoEnv): def __init__(self): self.robot = Hopper() WalkerBaseMuJoCoEnv.__init__(self, se...
1,583
31.326531
170
py