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 |
|---|---|---|---|---|---|---|
MCEvidence | MCEvidence-master/planck_mcevidence.py | '''
Planck MCMC chains evidence analysis. The data is available from [1].
Parameters
---------
Parallized version to compute evidence from Planck chains
We will analyze all schains in PLA folder
Returns
---------
The code writes results to terminal as well as a file. The default path
to the output files is
.. path... | 16,750 | 33.467078 | 1,117 | py |
GXN | GXN-main/main.py | import sys
import os
import torch
import random
import datetime
import numpy as np
from tqdm import tqdm
import torch.nn as nn
import torch.optim as optim
import math
from network import GXN
from mlp_dropout import MLPClassifier
from sklearn import metrics
from util import cmd_args, load_data, sep_data
sys.path.appen... | 12,080 | 39.676768 | 136 | py |
GXN | GXN-main/network.py | from __future__ import print_function
import os
import ops
import sys
import torch
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.functional as F
sys.path.append('%s/pytorch_structure2vec-master/s2v_lib' % os.path.dirname(os.path.realpath(__file__)))
from s2v_lib import S2VLIB # noqa
from pyt... | 5,853 | 39.652778 | 117 | py |
GXN | GXN-main/util.py | from __future__ import print_function
import random
import os
import numpy as np
import networkx as nx
import argparse
import torch
from sklearn.model_selection import StratifiedKFold
cmd_opt = argparse.ArgumentParser(description='Argparser for graph_classification')
cmd_opt.add_argument('-mode', default='cpu', help=... | 7,339 | 41.183908 | 153 | py |
GXN | GXN-main/ops.py | import torch
import torch.nn as nn
import torch.nn.functional as F
import math
import numpy as np
import scipy.sparse as sp
def spec_normalize_adj(adj, high_order=False):
adj = adj.to_dense().cpu().numpy()
adj = sp.coo_matrix(adj)
rowsum = np.array(adj.sum(1))
d_inv_sqrt = np.power(rowsum, -0.5).flat... | 10,385 | 31.867089 | 107 | py |
GXN | GXN-main/mlp_dropout.py | from __future__ import print_function
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.functional as F
class MLPRegression(nn.Module):
def __init__(self, input_size, hidden_size):
super(MLPRegression, self).__init__()
self.h1_weights = nn.Linear(input_size, hidden_size)
... | 1,575 | 28.735849 | 87 | py |
GXN | GXN-main/lib/pytorch_util.py | from __future__ import print_function
import os
import sys
import numpy as np
import torch
import random
from torch.autograd import Variable
from torch.nn.parameter import Parameter
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from tqdm import tqdm
from gnn_lib import GNNLIB
def ... | 1,850 | 25.070423 | 80 | py |
GXN | GXN-main/lib/gnn_lib.py | import ctypes
import numpy as np
import os
import sys
import torch
import pdb
class _gnn_lib(object):
def __init__(self, args):
dir_path = os.path.dirname(os.path.realpath(__file__))
self.lib = ctypes.CDLL('%s/build/dll/libgnn.so' % dir_path)
self.lib.GetGraphStruct.restype = ctypes.c_voi... | 3,813 | 40.912088 | 114 | py |
GXN | GXN-main/pytorch_structure2vec-master/graph_classification/main.py | import sys
import os
import torch
import random
import numpy as np
from tqdm import tqdm
from torch.autograd import Variable
from torch.nn.parameter import Parameter
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
sys.path.append('%s/../s2v_lib' % os.path.dirname(os.path.realpath(__fi... | 4,506 | 35.346774 | 116 | py |
GXN | GXN-main/pytorch_structure2vec-master/graph_classification/util.py | from __future__ import print_function
import numpy as np
import random
from tqdm import tqdm
import os
import cPickle as cp
import networkx as nx
import argparse
cmd_opt = argparse.ArgumentParser(description='Argparser for graph_classification')
cmd_opt.add_argument('-mode', default='cpu', help='cpu/gpu')
cmd_opt.add... | 3,574 | 39.625 | 127 | py |
GXN | GXN-main/pytorch_structure2vec-master/s2v_lib/s2v_lib.py | import ctypes
import numpy as np
import os
import sys
import torch
class _s2v_lib(object):
def __init__(self, args):
dir_path = os.path.dirname(os.path.realpath(__file__))
self.lib = ctypes.CDLL('%s/build/dll/libs2v.so' % dir_path)
self.lib.GetGraphStruct.restype = ctypes.c_void_p
... | 6,308 | 43.429577 | 118 | py |
GXN | GXN-main/pytorch_structure2vec-master/s2v_lib/embedding.py | from __future__ import print_function
import os
import sys
import numpy as np
import torch
import random
from torch.autograd import Variable
from torch.nn.parameter import Parameter
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from tqdm import tqdm
from s2v_lib import S2VLIB
from ... | 4,855 | 33.685714 | 91 | py |
GXN | GXN-main/pytorch_structure2vec-master/s2v_lib/pytorch_util.py | from __future__ import print_function
import os
import sys
import numpy as np
import torch
import random
from torch.autograd import Variable
from torch.nn.parameter import Parameter
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from tqdm import tqdm
from s2v_lib import S2VLIB
def ... | 1,885 | 25.194444 | 80 | py |
GXN | GXN-main/pytorch_structure2vec-master/s2v_lib/mlp.py | from __future__ import print_function
import os
import sys
import numpy as np
import torch
import random
from torch.autograd import Variable
from torch.nn.parameter import Parameter
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from tqdm import tqdm
from pytorch_util import weights... | 1,710 | 25.734375 | 80 | py |
GXN | GXN-main/pytorch_structure2vec-master/harvard_cep/main.py | import sys
import os
from mol_lib import MOLLIB, MolGraph
import torch
import random
import numpy as np
from tqdm import tqdm
from torch.autograd import Variable
from torch.nn.parameter import Parameter
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
sys.path.append('%s/../s2v_lib' % ... | 6,670 | 42.888158 | 174 | py |
GXN | GXN-main/pytorch_structure2vec-master/harvard_cep/mol_lib.py | import ctypes
import numpy as np
import os
import sys
import torch
from tqdm import tqdm
class _mol_lib(object):
def __init__(self):
dir_path = os.path.dirname(os.path.realpath(__file__))
self.lib = ctypes.CDLL('%s/build/dll/libmol.so' % dir_path)
# self.lib.Smiles2Graph.restype = ctypes.... | 4,800 | 34.828358 | 129 | py |
GXN | GXN-main/pytorch_structure2vec-master/harvard_cep/util.py | from __future__ import print_function
import numpy as np
import random
from tqdm import tqdm
import os
import cPickle as cp
def load_raw_data():
print('loading data')
raw_data_dict = {}
for fname in ['train', 'valid', 'test']:
d = []
with open('./data/%s.txt' % fname, 'r') as f:
... | 2,341 | 26.232558 | 67 | py |
GEL | GEL-master/setup.py | import setuptools
from glob import glob
from shutil import copyfile, copytree
from setuptools import setup
from os import path,makedirs
with open("README.md", "r") as fh:
long_description = fh.read()
# Create the build directory
makedirs("build/pygel3d",exist_ok=True)
# Now copy the python files to build directo... | 1,458 | 31.422222 | 113 | py |
GEL | GEL-master/GEL_UNIX/buildPyGEL.py | #!/usr/bin/python
import os
import glob
from fabricate import *
flags = ['-std=c++11', '-I../src', '-lGEL', '-fPIC']
build_dir = 'build/PyGEL'
target = 'libPyGEL.so'
dirs = ['../src/PyGEL']
dependencies = ['-lGEL', '-lGL', '-lGLEW', '-lm', '-lglfw', '-lstdc++']
sources = []
for dir in dirs:
for file in glob.glob... | 1,039 | 21.12766 | 125 | py |
GEL | GEL-master/GEL_UNIX/buildGEL.py | #!/usr/bin/python
import os
import glob
from fabricate import *
flags = ['-std=c++11', '-I../src/GEL', '-fPIC']
build_dir = 'build/GEL'
target = 'libGEL.so'
dirs = ['../src/GEL/CGLA', '../src/GEL/GLGraphics', '../src/GEL/Geometry', '../src/GEL/HMesh', '../src/GEL/Util']
dependencies = ['-lGL', '-lGLU', '-lGLEW', '-lc... | 1,183 | 23.666667 | 125 | py |
GEL | GEL-master/GEL_UNIX/fabricate.py | #!/usr/bin/env python
"""Build tool that finds dependencies automatically for any language.
fabricate is a build tool that finds dependencies automatically for any
language. It's small and just works. No hidden stuff behind your back. It was
inspired by Bill McCloskey's make replacement, memoize, but fabricate works ... | 65,637 | 40.075094 | 115 | py |
GEL | GEL-master/src/PyGEL/pygel3d/graph.py | """ This module provides a Graph class and functionality for skeletonization using graphs. """
from pygel3d import hmesh, lib_py_gel, IntVector
import ctypes as ct
import numpy as np
class Graph:
""" This class is for representing graphs embedded in 3D. The class does not in
itself come with many features: it ... | 8,162 | 48.174699 | 125 | py |
GEL | GEL-master/src/PyGEL/pygel3d/jupyter_display.py | """ This is a module with a function, display, that provides functionality for displaying a
Manifold or a Graph as an interactive 3D model in a Jupyter Notebook. """
from pygel3d import hmesh, graph
from numpy import array
import plotly.graph_objs as go
import plotly.offline as py
EXPORT_MODE = False
def set_expo... | 3,849 | 43.252874 | 91 | py |
GEL | GEL-master/src/PyGEL/pygel3d/hmesh.py | """ The hmesh module provides an halfedge based mesh representation."""
import ctypes as ct
import numpy as np
from numpy.linalg import norm
from pygel3d import lib_py_gel, IntVector, Vec3dVector, spatial
from scipy.sparse import csc_matrix, vstack
from scipy.sparse.linalg import lsqr
from collections import defaultdic... | 34,729 | 47.505587 | 166 | py |
GEL | GEL-master/src/PyGEL/pygel3d/__init__.py | """ PyGEL is a collection of classes and functions that expose features in the
GEL library. The primary purpose of PyGEL (and GEL) is to be useful for geometry
processing tasks. Especially tasks that involve 3D polygonal meshes, but there is
also a graph component useful e.g. for skeletonization. The PyGEL package is c... | 16,560 | 53.837748 | 199 | py |
GEL | GEL-master/src/PyGEL/pygel3d/spatial.py | """ This module provides a kD-tree implementation but specialized to 3D """
from pygel3d import lib_py_gel, Vec3dVector, IntVector
import ctypes as ct
class I3DTree:
""" kD tree specialized for 3D keys and integer values.
This tree data structure is useful for storing 3D points and
associated integer valu... | 1,728 | 42.225 | 100 | py |
GEL | GEL-master/src/PyGEL/pygel3d/gl_display.py | """ This modules provides an OpenGL based viewer for graphs and meshes """
from pygel3d import hmesh, graph, lib_py_gel
import ctypes as ct
import numpy as np
from os import getcwd, chdir
try:
lib_py_gel.GLManifoldViewer_new.restype = ct.c_void_p
lib_py_gel.GLManifoldViewer_delete.argtypes = (ct.c_void_p,)
... | 5,764 | 56.65 | 179 | py |
GEL | GEL-master/src/demo/FEQ-Remeshing/feq-remeshing-example.py | #!/opt/local/bin/python
from pygel3d import hmesh, graph, gl_display as gl
from os import getcwd
graphs = [
'hand.graph',
'armadillo_symmetric.graph',
'bunny.graph',
'feline.graph',
'fertility.graph',
'warrior.graph']
objs = [
'usai_hand_tri.obj',
'armadillo.obj',
'bunny.obj',
'feline.obj',
'fertility_tri.obj',
'warr... | 1,097 | 21.875 | 73 | py |
cudaImageWarp | cudaImageWarp-master/python/setup.py | from setuptools import setup
setup(
name='pyCudaImageWarp',
version='0.1',
description='Warp images with CUDA',
author='Blaine Rister',
author_email='blaine@stanford.edu',
license='MIT'
)
| 237 | 20.636364 | 44 | py |
cudaImageWarp | cudaImageWarp-master/python/pyCudaImageWarp/cudaImageWarp.py | """
Warp an image using CUDA. Python wrapper for the C library.
(c) Blaine Rister 2018
"""
import numpy as np
import ctypes
import pyCudaImageWarp
"""
Verify that the inputs are correct. Returns default parameter values.
"""
def __check_inputs(im, A, shape, device):
# Make sure device is positive
if... | 6,830 | 32.485294 | 80 | py |
cudaImageWarp | cudaImageWarp-master/python/pyCudaImageWarp/augment3d.py | import math
import numpy as np
import scipy.ndimage as nd
from pyCudaImageWarp import cudaImageWarp
"""
Pad the image to have a singleton channel dimension.
"""
def __pad_channel__(im):
ndim = 3
return np.expand_dims(im, ndim) if len(im.shape) < ndim + 1 else im
"""
As __pad_channel__, but for shapes... | 20,411 | 34.685315 | 97 | py |
cudaImageWarp | cudaImageWarp-master/python/pyCudaImageWarp/__init__.py |
"""
Python module initializer for CUDA image warper.
(c) Blaine Rister 2018
"""
import os
import ctypes
# Import queue -- annoying that the name keeps changing
try:
import queue
except:
import Queue as queue
# Initialize a queue for recording inputs
try:
q = queue.queue()
except:
q = queue.Queue()
... | 2,064 | 20.736842 | 72 | py |
cudaImageWarp | cudaImageWarp-master/python/pyCudaImageWarp/scipyImageWarp.py | """
Warp an image using scipy. This is a CPU-only implementation of cudaImageWarp.py.
(c) Blaine Rister 2018-2021
"""
import numpy as np
import scipy.ndimage as nd
import pyCudaImageWarp
import concurrent.futures
import os
from .cudaImageWarp import __check_inputs
# Place to store worker threads
threadPool = concu... | 2,561 | 23.4 | 83 | py |
cudaImageWarp | cudaImageWarp-master/test/test.py | import nibabel as nib
import numpy as np
import sys
from pyCudaImageWarp import cudaImageWarp
# Usage: python test.py [input.nii.gz] [output.nii.gz]
inPath = sys.argv[1]
outPath = sys.argv[2]
# Warping matrix
A = np.array([[1, 0, 0, 30],
[0, 1, 0, 0],
[0, 0, 2, 0]])
zMin = 100
zMax = ... | 1,051 | 22.377778 | 80 | py |
cudaImageWarp | cudaImageWarp-master/test/test_augment3d.py | """
Test the data augmentation in augment3d.py
Usage: python test_augment3d.py [input.nii.gz]
"""
import sys
import numpy as np
import nibabel as nib
from pyCudaImageWarp import augment3d
def apply_and_write_output(im, xform, name, api='cuda', oob=0):
out = augment3d.apply_xforms([xform], [im.get_data()], api=a... | 1,828 | 30.534483 | 70 | py |
Stimela | Stimela-master/setup.py | #!/usr/bin/env python3
import os
import sys
from setuptools import setup
import glob
PACKAGE_NAME = "stimela"
__version__ = "1.7.9"
build_root = os.path.dirname(__file__)
def readme():
"""Get readme content for package long description"""
with open(os.path.join(build_root, 'README.rst')) as f:
retur... | 1,487 | 29.367347 | 72 | py |
Stimela | Stimela-master/examples/simulation_pipeline.py | # import stimela package
import stimela
import os
# Recipe I/O configuration
INPUT = "input" # This folder must exist
OUTPUT = "output"
MSDIR = "msdir"
PREFIX = "stimela-example" # Prefix for output images
try:
SINGULARTITY_IMAGE_DIR = os.environ["STIMELA_SINGULARTITY_IMAGE_DIR"]
except KeyError:
SINGULARTIT... | 4,293 | 35.389831 | 93 | py |
Stimela | Stimela-master/stimela/main.py | # -*- coding: future_fstrings -*-
import os
import argparse
from argparse import ArgumentParser
import textwrap as _textwrap
import signal
import stimela
from stimela import docker, singularity, podman, utils
from stimela.utils import logger
from stimela.cargo import cab
BASE = stimela.BASE
CAB = stimela.CAB
GLOBALS =... | 14,491 | 34.004831 | 153 | py |
Stimela | Stimela-master/stimela/exceptions.py | # -*- coding: future_fstrings -*-
class StimelaCabParameterError(Exception):
pass
class StimelaRecipeExecutionError(Exception):
pass
class StimelaBaseImageError(Exception):
pass
class PipelineException(Exception):
"""
Encapsulates information about state of pipeline when an
exception occurs... | 839 | 20.538462 | 74 | py |
Stimela | Stimela-master/stimela/pathformatter.py | from __future__ import print_function
import re
import copy
#placeholders
class placeholder:
def __init__(self, val):
if val not in ["input", "msfile", "output"]:
raise ValueError("Only accepts input, output or msfile for placeholder argument")
self.__val = val
def __call__(self):... | 2,877 | 34.975 | 107 | py |
Stimela | Stimela-master/stimela/singularity.py | import subprocess
import os
import sys
from stimela import utils
from stimela.cargo import cab
import json
import stimela
import time
import datetime
import tempfile
import hashlib
from shutil import which
version = None
for item in ["apptainer", "singularity"]:
BINARY = which(item)
BINARY_NAME = item
if... | 4,511 | 30.333333 | 138 | py |
Stimela | Stimela-master/stimela/docker.py | # -*- coding: future_fstrings -*-
import subprocess
import os
import sys
from io import StringIO
from stimela import utils
import json
import stimela
import time
import datetime
import tempfile
class DockerError(Exception):
pass
def build(image, build_path, tag=None, build_args=None, fromline=None, args=[]):
... | 7,200 | 31.147321 | 114 | py |
Stimela | Stimela-master/stimela/podman.py | # -*- coding: future_fstrings -*-
import subprocess
import os
import sys
from io import StringIO
from stimela import utils
import json
import stimela
import time
import datetime
import tempfile
class DockerError(Exception):
pass
def build(image, build_path, tag=None, build_args=None, fromline=None, args=[]):
... | 7,316 | 31.52 | 114 | py |
Stimela | Stimela-master/stimela/__init__.py | # -*- coding: future_fstrings -*-
import os
import sys
import inspect
import pkg_resources
import logging
from logging import StreamHandler
import re
from pathlib import Path
import getpass
import time
try:
__version__ = pkg_resources.require("stimela")[0].version
except pkg_resources.DistributionNotFound:
__v... | 3,703 | 33.296296 | 107 | py |
Stimela | Stimela-master/stimela/dismissable.py | # -*- coding: future_fstrings -*-
class dismissable:
'''
Wrapper for optional parameters to stimela
Initialize with val == None to force stimela to skip
parsing parameter.
'''
def __init__(self, val=None):
self.__val = val
def __call__(self):
return self.__val
| 307 | 21 | 56 | py |
Stimela | Stimela-master/stimela/recipe.py | # -*- coding: future_fstrings -*-
import os
import sys
import pwd, grp
import time
import stimela
from stimela import docker, singularity, utils, cargo, podman, main
from stimela.cargo import cab
import logging
import inspect
import re
from stimela.exceptions import *
from stimela.dismissable import dismissable
from st... | 32,121 | 39.919745 | 211 | py |
Stimela | Stimela-master/stimela/tests/acceptance_tests/stimela-test-meerkat.py | # -*- coding: future_fstrings -*-
import stimela
from stimela.pathformatter import pathformatter as spf
import os
import unittest
import subprocess
from nose.tools import timed
import shutil
class mk_reduce(unittest.TestCase):
@classmethod
def setUpClass(cls):
unittest.TestCase.setUpClass()
#... | 9,147 | 37.762712 | 112 | py |
Stimela | Stimela-master/stimela/tests/acceptance_tests/stimela-test-kat7.py | # -*- coding: future_fstrings -*-
import stimela
import os
import unittest
import subprocess
from nose.tools import timed
import shutil
class kat7_reduce(unittest.TestCase):
@classmethod
def setUpClass(cls):
unittest.TestCase.setUpClass()
# I/O
global INPUT
INPUT = 'input'
... | 19,391 | 34.386861 | 132 | py |
Stimela | Stimela-master/stimela/tests/unit_tests/test-containertech.py | # -*- coding: future_fstrings -*-
import stimela
import os
import sys
import unittest
import subprocess
from nose.tools import timed
import shutil
import glob
from stimela.exceptions import *
from stimela.dismissable import dismissable as sdm
from stimela.pathformatter import pathformatter as spf
from stimela import ca... | 4,777 | 35.473282 | 108 | py |
Stimela | Stimela-master/stimela/tests/unit_tests/test-addcab.py | # -*- coding: future_fstrings -*-
import stimela
import os
import sys
import unittest
import subprocess
from nose.tools import timed
import shutil
import glob
from stimela.exceptions import *
from stimela.dismissable import dismissable as sdm
from stimela.pathformatter import pathformatter as spf
import stimela.cargo a... | 7,141 | 31.912442 | 108 | py |
Stimela | Stimela-master/stimela/tests/unit_tests/cab/custom/src/run.py | import os
import sys
import yaml
import glob
import shutil
import shlex
import subprocess
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
OUTPUT = os.environ["OUTPUT"]
MSDIR = os.environ["MSDIR"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_load(_std)
junk = cab["junk"]
args = []
url = None
for para... | 1,041 | 22.155556 | 91 | py |
Stimela | Stimela-master/stimela/utils/xrun_livelog.py | import sys, os, codecs, time, hashlib, subprocess
from threading import Event, Thread
from . import StimelaCabRuntimeError
DEBUG = False
INTERRUPT_TIME = 2.0 # seconds -- do not want to constantly interrupt the child process
LIVELOG_TIME = 0.1
def xrun(command, options, log=None, _log_container_as_started=False,... | 5,204 | 36.446043 | 116 | py |
Stimela | Stimela-master/stimela/utils/logger.py | import os
import sys
import json
import yaml
import time
import subprocess
from io import StringIO
import codecs
from datetime import datetime
import logging
class MultiplexingHandler(logging.Handler):
"""handler to send INFO and below to stdout, everything above to stderr"""
def __init__(self, info_stream=sys... | 3,242 | 34.637363 | 118 | py |
Stimela | Stimela-master/stimela/utils/xrun_poll.py | import select, traceback, subprocess, errno, re, time, logging, os, sys
DEBUG = 0
from . import StimelaCabRuntimeError, StimelaProcessRuntimeError
log = None
def get_stimela_logger():
"""Returns Stimela's logger, or None if no Stimela installed"""
try:
import stimela
return stimela.logger()
... | 8,781 | 37.017316 | 129 | py |
Stimela | Stimela-master/stimela/utils/__init__.py | import os
import sys
import json
import yaml
import time
import tempfile
import inspect
import warnings
import re
import math
import codecs
class StimelaCabRuntimeError(RuntimeError):
pass
class StimelaProcessRuntimeError(RuntimeError):
pass
CPUS = 1
from .xrun_poll import xrun
def assign(key, value):
... | 2,647 | 21.827586 | 84 | py |
Stimela | Stimela-master/stimela/cargo/__init__.py | import os
ekhaya = os.path.dirname(__file__)
# Path to base images
BASE_PATH = "{:s}/base".format(ekhaya)
# Path to executor images
CAB_PATH = "{:s}/cab".format(ekhaya)
# Path to config templates
CONFIG_TEMPLATES = "{:s}/configs".format(ekhaya)
| 249 | 18.230769 | 48 | py |
Stimela | Stimela-master/stimela/cargo/base/__init__.py | 0 | 0 | 0 | py | |
Stimela | Stimela-master/stimela/cargo/cab/__init__.py | # -*- coding: future_fstrings -*-
import stimela
from stimela import utils, recipe
import logging
import os
import sys
import textwrap
from stimela.pathformatter import pathformatter, placeholder
from stimela.exceptions import *
import time
TYPES = {
"str": str,
"float": float,
"bool": bool,
"int... | 17,365 | 42.415 | 166 | py |
Stimela | Stimela-master/stimela/cargo/cab/update_casa_version_tag.py | import json
import glob
from collections import OrderedDict
for cabfile in glob.glob("casa_*/*.json"):
print(cabfile)
with open(cabfile, 'rb') as stdr:
cabdict = json.load(stdr, object_pairs_hook=OrderedDict)
cabdict["version"] = ["4.7.2", "5.6.1-8", "5.8.0"]
cabdict["tag"] = ["0.3.0-2", "1.6.3... | 469 | 30.333333 | 64 | py |
Stimela | Stimela-master/stimela/cargo/cab/aimfast/src/run.py | import os
import sys
import shlex
import shutil
import subprocess
import yaml
import glob
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
OUTPUT = os.environ["OUTPUT"]
MSDIR = os.environ["MSDIR"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_load(_std)
junk = cab["junk"]
args = []
for param in cab[... | 1,759 | 28.333333 | 91 | py |
Stimela | Stimela-master/stimela/cargo/cab/cubical_ddf/src/run.py | import os
import sys
import shlex
import shutil
import subprocess
import glob
import yaml
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
MSDIR = os.environ["MSDIR"]
OUTPUT = os.environ["OUTPUT"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_load(_std)
junk = cab["junk"]
args = {}
parset = []
for p... | 1,630 | 23.343284 | 91 | py |
Stimela | Stimela-master/stimela/cargo/cab/sofia/src/run.py | import os
import sys
import Tigger
import numpy
import tempfile
import json
import codecs
import shlex
import shutil
import glob
import subprocess
from astLib.astWCS import WCS
from Tigger.Models import SkyModel, ModelClasses
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
MSDIR = os.environ["MSDIR"]
OUTPU... | 1,606 | 21.319444 | 91 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa_flagmanager/src/run.py | # -*- coding: future_fstrings -*-
import Crasa.Crasa as crasa
from scabha import config, parameters_dict, prun
print(f"Running CASA task '{config.binary}'")
task = crasa.CasaTask(config.binary, **parameters_dict)
task.run()
| 226 | 24.222222 | 55 | py |
Stimela | Stimela-master/stimela/cargo/cab/shadems/src/run.py | import os
import sys
import shlex
import yaml
import subprocess
import json
import shutil
import glob
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
OUTPUT = os.environ["OUTPUT"]
MSDIR = os.environ["MSDIR"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_load(_std)
junk = cab["junk"]
args = []
for par... | 1,422 | 25.351852 | 127 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa_gencal/src/run.py | # -*- coding: future_fstrings -*-
import Crasa.Crasa as crasa
from scabha import config, parameters_dict, prun
from casacore.table import table
import os
import numpy
print(f"Running CASA task '{config.binary}'")
args = parameters_dict
task = crasa.CasaTask(config.binary, **args)
task.run()
gtab = args["caltable"]
... | 974 | 26.083333 | 150 | py |
Stimela | Stimela-master/stimela/cargo/cab/rfinder/src/run.py | import os
import sys
import yaml
import rfinder
import glob
import subprocess
import shlex
import shutil
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
MSDIR = os.environ["MSDIR"]
OUTPUT = os.environ["OUTPUT"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_load(_std)
junk = cab["junk"]
args = []
msn... | 1,919 | 23.935065 | 91 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa_mstransform/src/run.py | # -*- coding: future_fstrings -*-
import Crasa.Crasa as crasa
from scabha import config, parameters_dict, prun
print(f"Running CASA task '{config.binary}'")
task = crasa.CasaTask(config.binary, **parameters_dict)
task.run()
| 226 | 24.222222 | 55 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa_makemask/src/run.py | # -*- coding: future_fstrings -*-
import Crasa.Crasa as crasa
from scabha import config, parameters_dict, prun
print(f"Running CASA task '{config.binary}'")
makemask_args = {}
immath_args = {}
for name, value in parameters_dict.items():
if value is None:
continue
if name in ['threshold', 'inpimage', ... | 1,053 | 27.486486 | 70 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa47_bandpass/src/run.py | import os
import sys
import logging
import Crasa.Crasa as crasa
from casacore.tables import table
import numpy
import yaml
import glob
import shutil
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
OUTPUT = os.environ["OUTPUT"]
MSDIR = os.environ["MSDIR"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_l... | 1,667 | 23.895522 | 159 | py |
Stimela | Stimela-master/stimela/cargo/cab/autoflagger/src/run.py | import os
import sys
import shlex
import shutil
import subprocess
import yaml
import glob
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
MSDIR = os.environ["MSDIR"]
OUTPUT = os.environ["OUTPUT"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_load(_std)
junk = cab["junk"]
args = []
msname = None
for ... | 1,324 | 22.660714 | 91 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa_applycal/src/run.py | # -*- coding: future_fstrings -*-
import Crasa.Crasa as crasa
from scabha import config, parameters_dict, prun
print(f"Running CASA task '{config.binary}'")
task = crasa.CasaTask(config.binary, **parameters_dict)
task.run()
| 226 | 24.222222 | 55 | py |
Stimela | Stimela-master/stimela/cargo/cab/tigger_convert/src/run.py | import os
import sys
import subprocess
import yaml
import glob
import shutil
import shlex
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
OUTPUT = os.environ["OUTPUT"]
MSDIR = os.environ["MSDIR"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_load(_std)
junk = cab["junk"]
mslist = []
field = []
args... | 1,806 | 24.097222 | 91 | py |
Stimela | Stimela-master/stimela/cargo/cab/aegean/src/run.py | import os
import sys
import numpy
import Tigger
import tempfile
import pyfits
import shutil
import shlex
import subprocess
import yaml
import glob
from astLib.astWCS import WCS
from astropy.table import Table
from Tigger.Models import SkyModel, ModelClasses
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
OU... | 3,876 | 27.718519 | 91 | py |
Stimela | Stimela-master/stimela/cargo/cab/rfimasker/src/run.py | # -*- coding: future_fstrings -*-
import sys
from scabha import config, parse_parameters, prun
# If a list of MSs is given, insert them as repeated arguments.
# Other arguments not allowed to be lists.
args = [config.binary] + parse_parameters(repeat=None,
positional=["ms"], ... | 463 | 28 | 78 | py |
Stimela | Stimela-master/stimela/cargo/cab/rmclean3d/src/run.py | # -*- coding: future_fstrings -*-
import sys
from scabha import config, parse_parameters, prun
# If a list of fields is given, insert them as repeated arguments.
# Other arguments not allowed to be lists.
args = [config.binary] + parse_parameters(repeat=True,
positional=["dir... | 435 | 30.142857 | 118 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa_plotms/src/run.py | # -*- coding: future_fstrings -*-
import Crasa.Crasa as crasa
from scabha import config, parameters_dict, prun
print(f"Running CASA task '{config.binary}'")
task = crasa.CasaTask(config.binary, **parameters_dict)
task.run()
| 226 | 24.222222 | 55 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa_uvcontsub/src/run.py | # -*- coding: future_fstrings -*-
import Crasa.Crasa as crasa
from scabha import config, parameters_dict, prun
print(f"Running CASA task '{config.binary}'")
task = crasa.CasaTask(config.binary, **parameters_dict)
task.run()
| 226 | 24.222222 | 55 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa_plotuv/src/run.py | # -*- coding: future_fstrings -*-
import Crasa.Crasa as crasa
from scabha import config, parameters_dict, prun
print(f"Running CASA task '{config.binary}'")
task = crasa.CasaTask(config.binary, **parameters_dict)
task.run()
| 226 | 24.222222 | 55 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa_importfits/src/run.py | # -*- coding: future_fstrings -*-
import Crasa.Crasa as crasa
from scabha import config, parameters_dict, prun
print(f"Running CASA task '{config.binary}'")
task = crasa.CasaTask(config.binary, **parameters_dict)
task.run()
| 226 | 24.222222 | 55 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa_immath/src/run.py | import os
import sys
import logging
import Crasa.Crasa as crasa
import yaml
import glob
import shutil
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
OUTPUT = os.environ["OUTPUT"]
MSDIR = os.environ["MSDIR"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_load(_std)
junk = cab["junk"]
unstack_params = ... | 2,223 | 28.263158 | 95 | py |
Stimela | Stimela-master/stimela/cargo/cab/catdagger/src/run.py | import os
import sys
import shlex
import shutil
import subprocess
import glob
import yaml
OUTPUT = os.environ["OUTPUT"]
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
MSDIR = os.environ["MSDIR"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_load(_std)
junk = cab["junk"]
args = []
for param in cab['... | 1,170 | 23.914894 | 91 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa_tclean/src/run.py | import os
import sys
import logging
import Crasa.Crasa as crasa
import astropy.io.fits as pyfits
import yaml
import glob
import shutil
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
OUTPUT = os.environ["OUTPUT"]
MSDIR = os.environ["MSDIR"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_load(_std)
jun... | 3,301 | 29.293578 | 134 | py |
Stimela | Stimela-master/stimela/cargo/cab/rmsynth1d/src/run.py | # -*- coding: future_fstrings -*-
import sys
from scabha import config, parse_parameters, prun
# If a list of fields is given, insert them as repeated arguments.
# Other arguments not allowed to be lists.
args = [config.binary] + parse_parameters(repeat=True,
positional=["dat... | 408 | 28.214286 | 90 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa47_plotuv/src/run.py | import os
import sys
import logging
import Crasa.Crasa as crasa
import yaml
import glob
import shutil
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
OUTPUT = os.environ["OUTPUT"]
MSDIR = os.environ["MSDIR"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_load(_std)
junk = cab["junk"]
args = {}
for par... | 927 | 21.634146 | 91 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa_plotcal/src/run.py | # -*- coding: future_fstrings -*-
import Crasa.Crasa as crasa
from scabha import config, parameters_dict, prun
print(f"Running CASA task '{config.binary}'")
task = crasa.CasaTask(config.binary, **parameters_dict)
task.run()
| 226 | 24.222222 | 55 | py |
Stimela | Stimela-master/stimela/cargo/cab/calibrator/src/run.py | import numpy
import os
import sys
from pyrap.tables import table
import subprocess
import Cattery
from scabha import config, parameters_dict, prun, OUTPUT, log
CODE = os.path.join(os.environ["STIMELA_MOUNT"], "code")
CONFIG = os.environ["CONFIG"]
binary = config.binary
jdict = {}
for name, value in parameters_dict.i... | 9,936 | 36.640152 | 97 | py |
Stimela | Stimela-master/stimela/cargo/cab/owlcat_plotelev/src/run.py | # -*- coding: future_fstrings -*-
import sys
from scabha import config, parse_parameters, prun
# If a list of fields is given, insert them as repeated arguments.
# Other arguments not allowed to be lists.
args = [config.binary] + parse_parameters(repeat=True,
positional=["msna... | 403 | 30.076923 | 86 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa_exportfits/src/run.py | # -*- coding: future_fstrings -*-
import Crasa.Crasa as crasa
from scabha import config, parameters_dict, prun
print(f"Running CASA task '{config.binary}'")
task = crasa.CasaTask(config.binary, **parameters_dict)
task.run()
| 226 | 24.222222 | 55 | py |
Stimela | Stimela-master/stimela/cargo/cab/casa_polfromgain/src/run.py | # -*- coding: future_fstrings -*-
import Crasa.Crasa as crasa
from scabha import config, parameters_dict, prun
print(f"Running CASA task '{config.binary}'")
save_result = parameters_dict.pop("save_result", None)
task = crasa.CasaTask(config.binary, save_result=save_result, **parameters_dict)
task.run()
| 307 | 27 | 80 | py |
Stimela | Stimela-master/stimela/cargo/cab/lwimager/src/run.py | import pyrap.images
import os
import sys
from pyrap.tables import table
from MSUtils import msutils
import tempfile
import astropy.io.fits as pyfits
import subprocess
import shlex
import shutil
import yaml
CONFIG = os.environ['CONFIG']
OUTPUT = os.environ['OUTPUT']
INPPUT = os.environ['INPUT']
MSDIR = os.environ['MSD... | 8,053 | 34.324561 | 119 | py |
Stimela | Stimela-master/stimela/cargo/cab/lwimager/src/predict_from_fits.py | import pyfits as fitsio
import numpy
from pyrap.tables import table
import numpy
import os
import sys
import tempfile
import subprocess
import shlex
imagename = sys.argv[1]
msname = sys.argv[2]
cell = sys.argv[3]
hdulist = fitsio.open(imagename)
if isinstance(hdulist, list):
hdu = hdulist[0]
else:
hdu = hduli... | 2,835 | 30.511111 | 147 | py |
Stimela | Stimela-master/stimela/cargo/cab/mProjectCube/src/run.py | # -*- coding: future_fstrings -*-
import sys
from scabha import config, parse_parameters, prun
# If a list of fields is given, insert them as repeated arguments.
# Other arguments not allowed to be lists.
args = [config.binary] + parse_parameters(repeat=True)
# run the command
if prun(args) != 0:
raise SystemErr... | 394 | 29.384615 | 92 | py |
Stimela | Stimela-master/stimela/cargo/cab/simulator/src/run.py | import numpy
import os
import sys
from pyrap.tables import table
import yaml
import math
import Cattery
from scabha import config, parameters_dict, prun
CODE = os.path.join(os.environ["STIMELA_MOUNT"], "code")
CONFIG = os.environ["CONFIG"]
def compute_vis_noise(msname, sefd, spw_id=0):
"""Computes nominal per-vis... | 5,845 | 33.591716 | 108 | py |
Stimela | Stimela-master/stimela/cargo/cab/cubical/src/run.py | # -*- coding: future_fstrings -*-
import os
import sys
import shlex
import configparser
import ast
from scabha import config, parameters_dict, prun
args = {}
parset = []
for name, value in parameters_dict.items():
if value is None:
continue
elif value is False:
value = 0
elif value is True... | 1,571 | 23.5625 | 69 | py |
Stimela | Stimela-master/stimela/cargo/cab/msutils/src/run.py | import sys
import os
from MSUtils import msutils
import MSUtils.ClassESW as esw
import inspect
from MSUtils.imp_plotter import gain_plotter
import glob
import shutil
import yaml
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
OUTPUT = os.environ["OUTPUT"]
MSDIR = os.environ["MSDIR"]
with open(CONFIG, "r") ... | 2,371 | 27.578313 | 104 | py |
Stimela | Stimela-master/stimela/cargo/cab/mosaicsteward/src/run.py | import os
import sys
import subprocess
import shlex
import glob
import shutil
import yaml
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
MSDIR = os.environ["MSDIR"]
OUTPUT = os.environ["OUTPUT"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_load(_std)
junk = cab["junk"]
args = []
targets = None
for... | 1,532 | 24.983051 | 91 | py |
Stimela | Stimela-master/stimela/cargo/cab/politsiyakat_cal_phase/src/run.py | import sys
import os
import json
import yaml
import subprocess
import shlex
import shutil
import glob
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
OUTPUT = os.environ["OUTPUT"]
MSDIR = os.environ["MSDIR"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_load(_std)
junk = cab["junk"]
args = {}
tasksu... | 1,050 | 20.44898 | 91 | py |
Stimela | Stimela-master/stimela/cargo/cab/flagms/src/run.py | import os
import sys
import shlex
import shutil
import subprocess
import yaml
import glob
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
OUTPUT = os.environ["OUTPUT"]
MSDIR = os.environ["MSDIR"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_load(_std)
junk = cab["junk"]
args = []
for param in cab['... | 1,479 | 23.666667 | 91 | py |
Stimela | Stimela-master/stimela/cargo/cab/ragavi_vis/src/run.py | # -*- coding: future_fstrings -*-
import sys
from scabha import config, parameters, prun
args = [config.binary]
# convert arguments to flat list of PrefixName Arguments
for name, value in parameters.items():
if value in [None, "", " ", False]:
continue
args.append(f'{config.prefix}{name}')
if no... | 462 | 19.130435 | 56 | py |
Stimela | Stimela-master/stimela/cargo/cab/crystalball/src/run.py | import os
import sys
import glob
import shutil
import shlex
import subprocess
import yaml
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
MSDIR = os.environ["MSDIR"]
OUTPUT = os.environ["OUTPUT"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_load(_std)
junk = cab["junk"]
args = []
ms = None
for para... | 1,144 | 21.45098 | 91 | py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.