repo_name
stringlengths
6
97
path
stringlengths
3
341
text
stringlengths
8
1.02M
thocoo/gamma-desk
gdesk/core/history.py
import sqlite3 import time import shutil from pathlib import Path try: import msvcrt except ModuleNotFoundError: #Not on Linux pass from .conf import config class LogDir(object): def __init__(self, rootpath): self.rootpath = Path(rootpath) if not self.rootpath.exists(): s...
thocoo/gamma-desk
gdesk/panels/imgview/opencv.py
<gh_stars>0 import os import time import collections from pathlib import Path import types from collections.abc import Iterable import queue import logging import numpy as np logger = logging.getLogger(__name__) from ... import config, gui if config.get('qapp', False): #only import qt stuff if process is gui ...
thocoo/gamma-desk
gdesk/panels/base.py
import pathlib import random import logging from collections import OrderedDict from qtpy import QtCore, QtGui, QtWidgets from qtpy.QtCore import Qt, Signal from qtpy.QtGui import QKeySequence, QIcon, QPixmap, QCursor from qtpy.QtWidgets import (QApplication, QWidget, QAction, QMainWindow, QDockWidget, QToolButton, ...
thocoo/gamma-desk
gdesk/panels/imgview/__init__.py
from ... import config if config.get('qapp', False): from .imgview import ImageViewer, ImageProfilePanel from .proxy import ImageGuiProxy
thocoo/gamma-desk
gdesk/utils/shared.py
# # SharedArray can be initialized in Parent or Child process # Uses anonymous mmap with tagnames # A SharedArray can be send of multiprocessing queues # Pickles only the mmap, tagname, sizes, ... but not the buffer. import numpy as np import os, time import mmap, _winapi import tempfile class SharedArray: ...
thocoo/gamma-desk
gdesk/test/__init__.py
<filename>gdesk/test/__init__.py import unittest class GammaDeskSuite(unittest.TestCase): panid = 1 def test_screenstate_1(self): from gdesk import gui from pylab import plt from pathlib import Path gui.load_layout('console') samplePath = Path(r'./samples') g...
thocoo/gamma-desk
gdesk/panels/window.py
<reponame>thocoo/gamma-desk<gh_stars>0 import sys, io import os import threading import time from pathlib import Path from collections import OrderedDict import logging import psutil import pprint import enum from qtpy import QtCore, QtGui, QtWidgets from qtpy.QtCore import (QFile, QFileInfo, QPoint, QSettings, QSign...
thocoo/gamma-desk
gdesk/version.py
<reponame>thocoo/gamma-desk """Version details of Gamma Bench""" VERSION_INFO = (0, 2, 0) VERSION = '.'.join(str(v) for v in VERSION_INFO)
thocoo/gamma-desk
gdesk/graphics/rulers.py
from qtpy import QtCore, QtGui, QtWidgets from ..utils.ticks import tickValues, Ticks fonts = [] # fonts.append(QtGui.QFont('Arial', 12)) # fonts.append(QtGui.QFont('Arial', 10)) # fonts.append(QtGui.QFont('Arial', 9)) fonts.append(QtGui.QFont('Arial', 8)) fonts.append(QtGui.QFont('Arial', 7)) fonts.append(QtG...
thocoo/gamma-desk
gdesk/matplotbe/__init__.py
<reponame>thocoo/gamma-desk<gh_stars>0 """ Render to qt from agg. """ from .. import config import os import ctypes import sys import threading import pickle import logging import warnings from distutils.version import LooseVersion import matplotlib from matplotlib.transforms import Bbox from matplotlib.figure import...
thocoo/gamma-desk
gdesk/panels/matplot/plotpanel.py
<gh_stars>0 import sys import time import logging import pickle from pathlib import Path from matplotlib.backends.backend_qt5agg import FigureCanvas, NavigationToolbar2QT as NavigationToolbar from matplotlib._pylab_helpers import Gcf from matplotlib.backends.backend_template import FigureCanvasTemplate, FigureManager...
thocoo/gamma-desk
gdesk/core/watcher.py
import logging import time import sys, os import threading import queue import socket import json import zmq from . import conf from .conf import config from .gui_proxy import gui logger = logging.getLogger(__name__) context = zmq.Context() class CommandServer(object): def __init__(self, shell): self.s...
thocoo/gamma-desk
gdesk/rectable/base.py
<filename>gdesk/rectable/base.py import textwrap import shutil from collections import OrderedDict import numpy as np from .styles import styles INCR = 100 MAXWIDTH = shutil.get_terminal_size().columns - 4 DEFAULT_STYLE = 'rst-simple' class ColumnAttributes(object): def __init__(self, rectable, colname): ...
thocoo/gamma-desk
gdesk/ezdock/dockwidgets.py
import collections import importlib import pprint import logging import pathlib from qtpy.QtWidgets import * from qtpy.QtCore import * from qtpy.QtGui import * from qtpy import QtCore, QtGui, QtWidgets from .. import gui, config from ..panels.base import BasePanel from .laystruct import LayoutStruct from .docks imp...
thocoo/gamma-desk
gdesk/graphics/plotview.py
from qtpy import QtCore, QtGui, QtOpenGL, QtWidgets from .point import Point from . import functions as fn QtSignal = QtCore.Signal HAVE_OPENGL = True class PlotView(QtWidgets.QGraphicsView): """ Re-implementation of QGraphicsView without scrollbars. Allow unambiguous control of the viewed coordinate r...
thocoo/gamma-desk
gdesk/graphics/items.py
import numpy as np from qtpy import QtCore, QtGui, QtWidgets from .functions import arrayToQPath QtSignal = QtCore.Signal class ItemSignal(object): def __init__(self): self.func = None def connect(self, func): self.func = func def emit(self, *args): if not self.func i...
thocoo/gamma-desk
gdesk/live/__init__.py
<reponame>thocoo/gamma-desk """The is the doctring of live. Example of nested live script -- scripts/info.py --------------------- def get_info(): return f'Info from {__file__}' ---------------------------------------- -- scripts/map1/hello.py --------------- from gdesk.live import using info = using.info ...
thocoo/gamma-desk
gdesk/live/console.py
import sys, os import platform import traceback import time import argparse from pathlib import Path from .interactive import interact from . import workspace, manager, using, using_top, use from .__version__ import VERSION, VERSION_INFO modname = '.'.join(globals()['__name__'].split('.')[:-1]) PATH_SEPERATOR = ';' ...
thocoo/gamma-desk
gdesk/panels/html/panel.py
from qtpy.QtCore import Qt from qtpy.QtGui import QWindow from qtpy.QtWidgets import QWidget from qtpy import QtWebEngineWidgets from ..base import BasePanel, CheckMenu HTML_BANNER = '''<html> <head> <title>A Sample Page</title> </head> <body> <h1>Hello, World!</h1> <hr /> I have nothing to say. </body> </html>''' c...
thocoo/gamma-desk
gdesk/panels/scriptwiz/__init__.py
from ... import config from .proxy import ScriptWizardProxy if config['qapp']: from .panel import ScriptWizardPanel
thocoo/gamma-desk
gdesk/dicttree/widgets.py
<reponame>thocoo/gamma-desk # -*- coding: utf-8 -*- import sys from qtpy import QtGui, QtCore, QtWidgets from .node import Node class DictionaryTreeModel(QtCore.QAbstractItemModel): """Data model providing a tree of an arbitrary dictionary""" def __init__(self, root, parent=None): super(DictionaryTre...
thocoo/gamma-desk
setup.py
<filename>setup.py #!/usr/bin/env python # -*- coding: utf-8 -*- """Build an installable package.""" import io import os import sys import glob from pathlib import Path from setuptools import find_packages, setup, Command, Distribution herepath = Path(__file__).parent.absolute() here = str(herepath) MODULE_NAME = '...
thocoo/gamma-desk
gdesk/panels/scriptwiz/panel.py
<gh_stars>0 import logging from pathlib import Path import json from collections import OrderedDict from qtpy import QtCore, QtGui, QtWidgets from qtpy.QtCore import Qt from jinja2 import Template from ... import gui, config from ...panels.base import BasePanel, CheckMenu from ...dialogs.formlayout import fedit log...
thocoo/gamma-desk
gdesk/dialogs/main.py
<reponame>thocoo/gamma-desk import threading import sys, os import ctypes from collections import OrderedDict import logging import importlib import pprint from pathlib import Path import numpy as np from qtpy import QtGui, QtWidgets, QtCore from qtpy.QtCore import Qt from .. import config, gui, __release__, PROGNAM...
thocoo/gamma-desk
gdesk/widgets/grid.py
from qtpy import QtCore, QtGui, QtWidgets class GridSplitter(QtWidgets.QGridLayout): layoutChanged = QtCore.Signal() def __init__(self, parent): super().__init__(parent=parent) self.setSpacing(0) self.setContentsMargins(0,0,0,0) self.splitters = [] def add...
thocoo/gamma-desk
gdesk/panels/imgview/imgview.py
import os import time import collections from pathlib import Path import types from collections.abc import Iterable import queue import logging import numpy as np logger = logging.getLogger(__name__) try: import scipy import scipy.ndimage has_scipy = True except: has_scipy = False try: import i...
thocoo/gamma-desk
gdesk/panels/__init__.py
<reponame>thocoo/gamma-desk<filename>gdesk/panels/__init__.py from .. import config, gui if config.get('qapp', False): from .base import BasePanel, CheckMenu, thisPanel, selectThisPanel
thocoo/gamma-desk
gdesk/panels/imgview/dialogs.py
<gh_stars>0 import logging from pathlib import Path from collections import OrderedDict import numpy as np from qtpy import QtCore, QtGui, QtWidgets from qtpy.QtCore import Qt from ... import gui, config from ...panels.base import BasePanel, CheckMenu from ...dialogs.formlayout import fedit from ...utils import get_...
thocoo/gamma-desk
gdesk/panels/panels.py
import threading import sys, os import ctypes from collections import OrderedDict import logging import importlib import pprint from pathlib import Path import numpy as np from qtpy import QtGui, QtWidgets, QtCore from qtpy.QtCore import Qt from .. import config, gui, __release__ from ..core import conf from .base ...
thocoo/gamma-desk
gdesk/panels/imgview/blueprint.py
<reponame>thocoo/gamma-desk import numpy import time import math HFG = 8 USEFORDER = True XKERN = 8 YKERN = 8 def make_thumbnail(array, max_long_side=240, hfg=HFG, bayer=False): if hasattr(array, 'tondarray'): array = image.tondarray('uint16') # reference to uint16 buffer of Bindex height, width ...
thocoo/gamma-desk
gdesk/panels/imgview/dimensions.py
<reponame>thocoo/gamma-desk """multiple dimension range and slicing virtual sequence of numbers defined by start to stop by step functions to * modify the range by applying slices * reset to full range * get default python range object * partial ranges for representations s...
thocoo/gamma-desk
gdesk/panels/console/__init__.py
<reponame>thocoo/gamma-desk from ... import config if config.get('qapp', False): from .consolepanel import MainThreadConsole, SubThreadConsole, ChildProcessConsole, ChildThreadConsole from .consoleproxy import ConsoleGuiProxy
thocoo/gamma-desk
gdesk/live/interactive.py
<filename>gdesk/live/interactive.py<gh_stars>0 import sys import platform import code from pathlib import Path def interact(workspace=None, banner=None, exitmsg=None, completer='standard'): if workspace is None: frame = sys._getframe(1) globs = frame.f_globals locs = frame.f_locals ...
thocoo/gamma-desk
gdesk/__init__.py
#------------------------------------------------------------------------------- # Copyright 2021 <NAME> # # 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...
PRHatte/Tracking-a-person-and-estimating-height-of-the-person
LogoDetecet.py
from scipy.spatial import distance as dist import cv2 import numpy as np detector=cv2.xfeatures2d.SIFT_create() FLANN_INDEX_KDITREE=0 flannParam=dict(algorithm=FLANN_INDEX_KDITREE,tree=5) flann=cv2.FlannBasedMatcher(flannParam,{}) people_cascade = cv2.CascadeClassifier("C:/Users/prh170230/Downloads/haarcascade_uppe...
PRHatte/Tracking-a-person-and-estimating-height-of-the-person
part2.py
from scipy.spatial import distance as dist import cv2 import numpy as np detector=cv2.xfeatures2d.SIFT_create() FLANN_INDEX_KDITREE=0 flannParam=dict(algorithm=FLANN_INDEX_KDITREE,tree=5) flann=cv2.FlannBasedMatcher(flannParam,{}) people_cascade = cv2.CascadeClassifier("C:/Users/prh070230/Downloads/haarcascade_uppe...
unartig/cdo-bindings
python/cdo.py
<reponame>unartig/cdo-bindings import os import re import subprocess import tempfile import random import glob import signal from pkg_resources import parse_version from io import StringIO import logging as pyLog import six # workaround for python2/3 string handling {{{ try: from string import strip except ImportErr...
Kobzol/hyperqueue
tests/benchmarks/overhead.py
<filename>tests/benchmarks/overhead.py import multiprocessing import pytest from ..conftest import HqEnv, run_hq_env def task_overhead(env: HqEnv, task_count: int): env.command( [ "submit", "--stdout", "none", "--stderr", "none", "-...
Kobzol/hyperqueue
tests/utils/job.py
<reponame>Kobzol/hyperqueue<gh_stars>0 def default_task_output(job_id=1, task_id=0, type="stdout") -> str: return f"job-{job_id}/{task_id}.{type}"
Kobzol/hyperqueue
tests/utils/table.py
<reponame>Kobzol/hyperqueue from typing import List, Optional JOB_TABLE_ROWS = 15 # TODO: create a pandas dataframe instead? class Table: def __init__(self, rows): self.rows = rows def __getitem__(self, item): if isinstance(item, slice): return Table(self.rows[item]) retu...
Kobzol/hyperqueue
tests/conftest.py
import contextlib import os import signal import subprocess import time from typing import Optional, Tuple import pytest from .utils import parse_table from .utils.mock import ProgramMock from .utils.wait import wait_until PYTEST_DIR = os.path.dirname(os.path.abspath(__file__)) ROOT_DIR = os.path.dirname(PYTEST_DIR)...
Kobzol/hyperqueue
tests/utils/check.py
import contextlib import os @contextlib.contextmanager def check_error_log(path: str): """Check that the file at the given path is either missing or empty. If not, raise an exception with its contents""" yield if not os.path.isfile(path): return with open(path) as f: data = f.read...
Kobzol/hyperqueue
tests/test_job.py
<gh_stars>0 import os import time from datetime import datetime from os.path import isdir, isfile import pytest from .conftest import HqEnv from .utils import JOB_TABLE_ROWS, wait_for_job_state from .utils.job import default_task_output def test_job_submit(hq_env: HqEnv): hq_env.start_server() table = hq_en...
Kobzol/hyperqueue
tests/test_autoalloc.py
import contextlib import json import os import time from os.path import dirname, join from typing import List, Optional from .conftest import HqEnv from .utils.check import check_error_log from .utils.wait import wait_until def test_autoalloc_descriptor_list(hq_env: HqEnv): mock = PbsMock(hq_env, qtime="Thu Aug ...
Kobzol/hyperqueue
tests/test_server.py
import json import os import signal import socket import subprocess import pytest from .conftest import HqEnv from .utils import parse_table def test_server_host(hq_env: HqEnv): args = hq_env.server_args() args += ["--host", "abcd123"] p = subprocess.Popen(args, stdout=subprocess.PIPE) try: ...
ggiinnoo/awx
awx/main/models/inventory.py
<reponame>ggiinnoo/awx<gh_stars>0 # Copyright (c) 2015 Ansible, Inc. # All Rights Reserved. # Python import datetime import time import logging import re import copy import os.path from urllib.parse import urljoin import yaml import configparser import tempfile from io import StringIO from distutils.version import Loo...
tlamadon/pygfe
pygrpfe/helpers.py
<filename>pygrpfe/helpers.py """ help functions to run BLM2 """ import torch import numpy as np import pandas as pd from sklearn.cluster import KMeans from statsmodels.discrete.discrete_model import Probit import patsy as patsy import matplotlib.pylab as plt from scipy.optimize import minimize from scipy import spar...
tlamadon/pygfe
pygrpfe/__init__.py
<reponame>tlamadon/pygfe<filename>pygrpfe/__init__.py from .helpers import group,train
tlamadon/pygfe
tests/test_pygrpfe.py
<filename>tests/test_pygrpfe.py ''' Tests for pygfe DATE: Jan 2021 ''' import pytest import pandas as pd import pygrpfe as gfe import numpy as np ax = np.newaxis def test_pygfe_group(): def dgp_simulate(ni,nt,gamma=2.0,eps_sd=1.0): """ simulates according to the model """ alpha = np.random.norm...
guozequn/code-tips
Custom_Logger.py
<filename>Custom_Logger.py<gh_stars>1-10 #!/usr/bin/env python # -*- coding:utf-8 -*- # @Time : 2019/9/6 15:33 # @Author : ZeQun # @File : logger.py import os import logbook from logbook import Logger, RotatingFileHandler from logbook.more import ColorizedStderrHandler class CustomLog(object): """ ...
kandjiabdou/turtleiutv
turtleIutv/Turtle.py
import os.path import math from ipywidgets import widgets from notebook import nbextensions from traitlets import Unicode, List, Int, Bool from IPython.display import display class Turtle(widgets.DOMWidget): _view_module = Unicode( "nbextensions/turtleIutvjs/turtlewidget").tag(sync=True) _view_name = ...
kandjiabdou/turtleiutv
turtleIutv/__init__.py
<filename>turtleIutv/__init__.py from .Turtle import Turtle from random import randint __version__ = '1.1' """ # This file initializes the turtle with a global variable # It uses the Turtle class to do procedural programming # and avoid object programming, # because beginners are not familiar with the Object. # It's ...
IfThenMaker/MutosPlan
python/youjyun.py
import json import os import pandas as pd teikei = [ "豪風命","微風命","陽照命","灯篭命", "厳山命","砂丘命","轟音命","閃光命","海水命","湖水命" ] """ sclaped text to json """ def get_textdata(file): path = os.path.join(os.getcwd(), file) with open(file,'r', encoding='utf-8') as f: dt = f.read() return dt def get_jsondata(fi...
IfThenMaker/MutosPlan
python/balance.py
import json import os import pandas as pd dic = { "豪風命": { 'kyoujyaku': 3, 'inyo': 2, 'danjyo': -1, }, "微風命": { 'kyoujyaku': -3, 'inyo': 0, 'danjyo': -4, }, "陽照命": { 'kyoujyaku': 4, 'inyo': 5, 'danjyo': 2, }, "灯篭命": { ...
IfThenMaker/MutosPlan
python/jyunsetu.py
import json import os import pandas as pd """ sclaped text to json """ def get_textdata(file): path = os.path.join(os.getcwd(), file) with open(file,'r', encoding='utf-8') as f: dt = f.read() return dt def get_jsondata(file): path = os.path.join(os.getcwd(), file) with open(path,'r', en...
IfThenMaker/MutosPlan
python/himeguri.py
import json import os import pandas as pd """ sclaped text to json """ def get_textdata(file): path = os.path.join(os.getcwd(), file) with open(file,'r', encoding='utf-8') as f: dt = f.read() return dt def get_jsondata(file): path = os.path.join(os.getcwd(), file) with open(path,'r', en...
IfThenMaker/MutosPlan
python/setu.py
import json import os import pandas as pd kata = ['ア', 'イ', 'ウ', 'エ', 'オ', 'カ', 'キ', 'ク', 'ケ', 'コ', 'サ', 'シ', 'ス', 'セ', 'ソ', 'タ', 'チ', 'ツ', 'テ', 'ト', 'ナ', 'ニ', 'ヌ', 'ネ', 'ノ', 'ハ'] head = ['4', '4', '4', '4', '4', '4', '5', '5', '5', '4', '4', '5', '5'] print(kata) """ sclaped text to json """ def get_textdata(file)...
IfThenMaker/MutosPlan
python/setu_bind.py
import json import os teikeimei = ['豪風命', '微風命', '陽照命', '灯篭命', '厳山命', '砂丘命', '轟音命', '閃光命', '海水命', '湖水命'] """ sclaped text to json """ def get_textdata(file): path = os.path.join(os.getcwd(), file) with open(file,'r', encoding='utf-8') as f: dt = f.read() return dt def get_jsondata(file): pa...
chriscampbell19/polygnome
functionOnKn.py
<reponame>chriscampbell19/polygnome import vector import tensorAlgebra import algebra import bimoduleMapDecorator class functionOnKn(vector.vector): """ File: functionOnKn.py Author: <NAME> Email: c (dot) j (dot) campbell (at) ed (dot) ac (dot) uk Github: https://github.com/campbellC Descripti...
chriscampbell19/polygnome
tensor.py
import abstractTensor import pureTensor import composite class tensor(composite.composite,abstractTensor.abstractTensor): """ File: tensor.py Author: <NAME> Email: c (dot) j (dot) campbell (at) ed (dot) ac (dot) uk Github: https://github.com/campbellC Description: A composite class of pureTens...
chriscampbell19/polygnome
bimoduleMapDecorator.py
import pureTensor class bimoduleMapDecorator(object): """ File: chainMaps.py Author: <NAME> Email: c (dot) j (dot) campbell (at) ed (dot) ac (dot) uk Github: https://github.com/campbellC Description: A decorator that extends a function defined on a tensor algebra bilinearly with respect to some...
chriscampbell19/polygnome
polygnomeObject.py
from abc import ABCMeta, abstractmethod class polygnomeObject(object): __metaclass__ = ABCMeta """ File: printableObject.py Author: <NAME> Email: c (dot) j (dot) campbell (at) ed (dot) ac (dot) uk Github: https://github.com/campbellC Description: An abstract superclass that every object mu...
chriscampbell19/polygnome
monomial.py
<reponame>chriscampbell19/polygnome import re import abstractPolynomial import coefficient import polynomial class monomial(abstractPolynomial.abstractPolynomial): """ File: monomial.py Author: <NAME> Email: c (dot) j (dot) campbell (at) ed (dot) ac (dot) uk Github: https://github.com/campbellC ...
chriscampbell19/polygnome
__init__.py
from monomial import generators,monomial from polynomial import polynomial from coefficient import coefficient from relation import relation from pureTensor import pureTensor from tensor import tensor from algebra import algebra from tensorAlgebra import tensorAlgebra from vector import vector from chainMaps import b_n...
chriscampbell19/polygnome
abstractTensor.py
<gh_stars>0 from abc import ABCMeta, abstractmethod import arithmeticInterface class abstractTensor(arithmeticInterface.arithmeticInterface): __metaclass__ = ABCMeta """ File: abstractTensor.py Author: <NAME> Email: c (dot) j (dot) campbell (at) ed (dot) ac (dot) uk Github: https://github.com/ca...
chriscampbell19/polygnome
coefficient.py
<reponame>chriscampbell19/polygnome<gh_stars>0 import re import arithmeticInterface class coefficient(arithmeticInterface.arithmeticInterface): """ File: coefficient.py Author: <NAME> Email: c (dot) j (dot) campbell (at) ed (dot) ac (dot) uk Github: https://github.com/campbellC Description: A co...
chriscampbell19/polygnome
latexWriters.py
def listOfObjectsToLatex(lst, numPerLine=5): #this prints out numPerLine vectors in a row and then prints a new line and carries on. This does add \( and \) at beginning and end. print '\\( ' for inum, i in enumerate(lst): print i.toLatex() if inum % numPerLine == numPerLine - 1: if ...
chriscampbell19/polygnome
polynomial.py
import abstractPolynomial import monomial import coefficient import composite class polynomial(composite.composite,abstractPolynomial.abstractPolynomial): """ File: polynomial.py Author: <NAME> Email: c (dot) j (dot) campbell (at) ed (dot) ac (dot) uk Github: https://github.com/campbellC Descrip...
chriscampbell19/polygnome
chainMaps.py
from pureTensor import pureTensor import relation from tensor import tensor from monomial import monomial from tensorAlgebra import tensorAlgebra from algebra import algebra from functionOnKn import functionOnKn from bimoduleMapDecorator import bimoduleMapDecorator """ File: chainMaps.py Author: <NAME> Email: c (dot) j...
chriscampbell19/polygnome
vector.py
import arithmeticInterface import composite class vector(arithmeticInterface.arithmeticInterface): """ File: vector.py Author: <NAME> Email: c (dot) j (dot) campbell (at) ed (dot) ac (dot) uk Github: https://github.com/campbellC Description: A vector class for vectors of abstractPolynomials. ...
chriscampbell19/polygnome
pureTensor.py
import abstractTensor import tensor import coefficient import monomial import relation import doublyDefined #TODO: make interface PureTensorable so we can hide all this nonsense in tensor product class pureTensor(abstractTensor.abstractTensor): """ File: pureTensor.py Author: <NAME> Email: c (dot) j (do...
chriscampbell19/polygnome
abstractPolynomial.py
from abc import ABCMeta, abstractmethod import arithmeticInterface class abstractPolynomial(arithmeticInterface.arithmeticInterface): __metaclass__ = ABCMeta """ File: abstractPolynomial.py Author: <NAME> Email: c (dot) j (dot) campbell (at) ed (dot) ac (dot) uk Github: https://github.com/campb...
chriscampbell19/polygnome
composite.py
<filename>composite.py from abc import ABCMeta, abstractmethod import polygnomeObject class composite(polygnomeObject.polygnomeObject): __metaclass__ = ABCMeta """ File: composite.py Author: <NAME> Email: c (dot) j (dot) campbell (at) ed (dot) ac (dot) uk Github: https://github.com/campbellC ...
chriscampbell19/polygnome
reductionFunction.py
import polygnomeObject import coefficient import algebra from collections import namedtuple class reductionFunction(namedtuple('reductionFunction', ['leftMonomial','relation','rightMonomial']), polygnomeObject.polygnomeObject): """ File: reductionFunction.py Author: <NAME> Email: c (dot) j (dot) campbe...
chriscampbell19/polygnome
doublyDefined.py
<reponame>chriscampbell19/polygnome import polygnomeObject import coefficient class doublyDefined(polygnomeObject.polygnomeObject): """ File: doublyDefined.py Author: <NAME> Email: c (dot) j (dot) campbell (at) ed (dot) ac (dot) uk Github: https://github.com/campbellC Description: A class to ...
chriscampbell19/polygnome
relation.py
from collections import namedtuple import polygnomeObject import coefficient relationClass = namedtuple('relation',['leadingMonomial','lowerOrderTerms']) class relation(relationClass, polygnomeObject.polygnomeObject): # type definition: relation is #a tupl...
chriscampbell19/polygnome
arithmeticInterface.py
<reponame>chriscampbell19/polygnome from abc import ABCMeta, abstractmethod import polygnomeObject class arithmeticInterface(polygnomeObject.polygnomeObject): __metaclass__ = ABCMeta """ File: arithmeticInterface.py Author: <NAME> Email: c (dot) j (dot) campbell (at) ed (dot) ac (dot) uk Github:...
chriscampbell19/polygnome
algebra.py
<filename>algebra.py import polygnomeObject import relation import reductionFunction import monomial class algebra(polygnomeObject.polygnomeObject): """ File: algebra.py Author: <NAME> Email: c (dot) j (dot) campbell (at) ed (dot) ac (dot) uk Github: https://github.com/campbellC Description: An ...
chriscampbell19/polygnome
tensorAlgebra.py
import polygnomeObject import pureTensor import tensor import abstractPolynomial class tensorAlgebra(polygnomeObject.polygnomeObject): """ File: tensorAlgebra.py Author: <NAME> Email: c (dot) j (dot) campbell (at) ed (dot) ac (dot) uk Github: https://github.com/campbellC Description: This class...
JuliusHen/gimli
pygimli/core/math.py
# -*- coding: utf-8 -*- """Collection of mathematical functions.""" import numpy as np from .core import (angle, besselI0, besselI1, besselK0, besselK1, cos, cot, det, dot, exp, exp10, imag, log, log10, max, median, min, pow, rand, randn, real, rms, round, rrms, sign, ...
JuliusHen/gimli
apps/ipynbToGalleryExample.py
#!/usr/bin/env python # -*- coding: utf-8 -*- r"""Convert jupyter notebook to sphinx gallery notebook styled examples. Modified from here:https://gist.github.com/chsasank/7218ca16f8d022e02a9c0deb94a310fe#file-ipynb_to_gallery-py Usage: python ipynbToGalleryExample.py <notebook.ipynb> Dependencies: pypandoc: install ...
JuliusHen/gimli
pygimli/core/mesh.py
# -*- coding: utf-8 -*- """ Import and extensions of the core Mesh class. """ import numpy as np from math import ceil from .core import (cat, HexahedronShape, Line, RSparseMapMatrix, Mesh, MeshEntity, Node, Boundary, RVector, RVector3, PolygonFace, TetrahedronShape, Tr...
JuliusHen/gimli
pygimli/viewer/showmatrix.py
<gh_stars>100-1000 # -*- coding: utf-8 -*- """Generic matrix visualization tools.""" import matplotlib as mpl import numpy as np import pygimli as pg from .mpl import createColorBar, updateColorBar from .mpl.matrixview import drawBlockMatrix, drawSparseMatrix def showMatrix(mat, ax=None, **kwargs): """Show var...
JuliusHen/gimli
pygimli/physics/ert/ertModelling.py
<gh_stars>100-1000 #!/usr/bin/env python # -*- coding: utf-8 -*- """ERT modelling operator classes * base class * standard BERT modelling class using pygimli.core (C++) functions * 2.5D non-optimized totalfield forward operator for ERT (reference) """ import numpy as np import pygimli as pg from pygimli.frameworks i...
JuliusHen/gimli
doc/examples/2_seismics/plot_04_koenigsee.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ .. _ex:koenigsee: Field data inversion ("Koenigsee") ================================== This minimalistic example shows how the Refraction Manager can be used to invert a field data set. Here, we consider the Koenigsee data set, which represents classical refraction s...
JuliusHen/gimli
doc/tutorials/3_inversion/plot_6-geostatConstraints.py
<filename>doc/tutorials/3_inversion/plot_6-geostatConstraints.py #!/usr/bin/env python # encoding: utf-8 r""" Geostatistical regularization ----------------------------- In this example we illustrate the use of geostatistical constraints on irregular meshes as presented by :cite:`jordi2018geostatistical`, compared to ...
JuliusHen/gimli
doc/tutorials/3_inversion/plot_0-expfit.py
#!/usr/bin/env python # encoding: utf-8 r""" Simple fit ========== This tutorial shows how to do the simplest inversion case, a curve fit, by setting up an own forward operator. The function to be fitted is` .. math:: f(x) = A * e^{-x/X} with the two unknown coefficients A (a signal amplitude) and X (a decay ...
JuliusHen/gimli
pygimli/physics/traveltime/__init__.py
<filename>pygimli/physics/traveltime/__init__.py # -*- coding: utf-8 -*- """Refraction seismics or first arrival traveltime calculations.""" from .importData import load from .tt import simulate, DataContainerTT from .plotting import drawFirstPicks, drawTravelTimeData, drawVA, showVA from .utils import (createGradien...
JuliusHen/gimli
doc/examples/3_dc_and_ip/plot_05_ert_4_point_sensitivities.py
<gh_stars>100-1000 #!/usr/bin/env python # -*- coding: utf-8 -*- """ Four-point sensitivities ------------------------ In this example, we illustrate how to visualize the sensitivities of four-point arrays. You can easily loop over the plotting command to create something like: https://www.youtube.com/watch?v=lt1qV-2d...
JuliusHen/gimli
pygimli/core/core.py
<filename>pygimli/core/core.py # -*- coding: utf-8 -*- import sys import os #if sys.platform == 'win32': # os.environ['PATH'] = os.path.abspath(__file__) + ';' + os.environ['PATH'] pgcore = None try: from . import _pygimli_ # if it works: as pgcore, replace all _pygimli_ # from . import _pygimli_ as pgco...
JuliusHen/gimli
pygimli/core/__init__.py
<reponame>JuliusHen/gimli # -*- coding: utf-8 -*- """ Imports and extensions of the C++ bindings. """ import os import sys import traceback import numpy as np from .core import pgcore from .core import * # ####################################### # ### Global convenience functions ##### # ##########################...
JuliusHen/gimli
pygimli/physics/traveltime/tt.py
<filename>pygimli/physics/traveltime/tt.py #!/usr/bin/env python # -*- coding: utf-8 -*- """Plotting functions for traveltime.""" # general purpose import pygimli as pg from .TravelTimeManager import TravelTimeManager def simulate(mesh, scheme, slowness=None, vel=None, **kwargs): """Simulate traveltime data.""" ...
JuliusHen/gimli
pygimli/viewer/mpl/matrixview.py
<reponame>JuliusHen/gimli #!/usr/bin/env python # -*- coding: utf-8 -*- """Functions to draw various pygimli matrices with matplotlib.""" import numpy as np import matplotlib.pyplot as plt import pygimli as pg def drawSparseMatrix(ax, mat, **kwargs): """Draw a view of a matrix into the axes. Parameters ...
JuliusHen/gimli
pygimli/physics/ert/ert.py
<filename>pygimli/physics/ert/ert.py<gh_stars>100-1000 #!/usr/bin/env python # -*- coding: utf-8 -*- """Electrical resistivity tomography""" import numpy as np import pygimli as pg from .ertModelling import ERTModelling from .ertScheme import createData createERTData = createData # backward compatibility def simu...
JuliusHen/gimli
pygimli/solver/__init__.py
<filename>pygimli/solver/__init__.py # -*- coding: utf-8 -*- """General physics independent solver interface.""" from .utils import (anisotropyMatrix, constitutiveMatrix, createAnisotropyMatrix, createConstitutiveMatrix) from .green import greenDiffusion1D from .solver import * from .solver impor...
JuliusHen/gimli
doc/examples/3_dc_and_ip/plot_modTank3d.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ 3D modeling in a closed geometry ================================ This is a synthetic model of an experimental tank with a highly heterogeneous resistivity, motivated by the BAM Berlin. Geometry: 0.99m x 0.5m x 1.0m Data: 48 Electrodes and 588 Measurements defined in ...
JuliusHen/gimli
pygimli/physics/ert/ves.py
# -*- coding: utf-8 -*- """ Vertical electrical sounding (VES) manager class. """ import numpy as np import pygimli as pg # from pygimli.frameworks import Modelling, Block1DModelling from pygimli.frameworks import Block1DModelling, MethodManager1d class VESModelling(Block1DModelling): """Vertical Electrical Soun...
JuliusHen/gimli
pygimli/core/trans.py
<reponame>JuliusHen/gimli # -*- coding: utf-8 -*- """Some specialization to the trans functions.""" from .core import pgcore import numpy as np __TransCumulative_addForGC__ = pgcore.RTransCumulative.add def __TransCumulative_addForGC_MP__(self, T, *args): """Don't use directly. Monkey patch to keep the GC ...
JuliusHen/gimli
pygimli/testing/test_Logger.py
<filename>pygimli/testing/test_Logger.py<gh_stars>100-1000 import pygimli as pg #log = logging.getLogger('pyGIMLi') #logging.basicConfig(level=logging.DEBUG, #format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', #datefmt='%m/%d/%Y %H:%M:%S', ##file...
JuliusHen/gimli
doc/examples/5_misc/plot_1_dcem.py
#!/usr/bin/env python # encoding: utf-8 """ DC-EM Joint inversion --------------------- This is an old script from early pyGIMLi jointly inverting direct current (DC) and electromagnetic (EM) soundings on the modelling abstraction level. Note that this is not recommended as a basis for programming, because there is a ...