This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from traits.api import HasTraits, Str, List, Button, Any | |
from traitsui.api import TreeNode, TreeEditor, View, ModelView, Group, VGroup, Item | |
from pkg_resources import resource_filename | |
tree_icon_path = resource_filename("traitsui", "wx/images") | |
class Measurement(HasTraits): | |
name = Str("Measurement") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Note that: | |
dblCalVar1 = Va Gain | |
dblCalVar2 = Vs Gain | |
dblCalVar3 = Ia Gain | |
dblCalVar4 = Is Gain | |
dblCalVar5 = Vsupp | |
dblCalVar6 = Vgrid(40V) | |
dblCalVar7 = VglowA | |
dblCalVar8 = Vgrid(4V) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Idiom - C struct container simple values | |
# | |
# Idiom - Use ctypedef so we can can pass this | |
# easily in and out of functions. | |
# | |
cdef struct book: | |
int uid | |
ctypedef book book_t | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#cython: language_level=3 | |
import cython | |
import numpy | |
cimport numpy as cnumpy | |
# Silly example C struct | |
cdef struct example: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"annotations": { | |
"list": [ | |
{ | |
"builtIn": 1, | |
"datasource": "-- Grafana --", | |
"enable": true, | |
"hide": true, | |
"iconColor": "rgba(0, 211, 255, 1)", | |
"name": "Annotations & Alerts", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ClearAll["Global`*"]; | |
eqns = {X'[t] == P - (k1 + k2) X[t] + A k1 X[t], Y'[t] == k1 X[t] - A k1 X[t] - k3 Y[t], X[0] == 0, Y[0] == 0} | |
s = Assuming[k0 > 0 && k1 > 0 && k2 > 0 && k3 > 0 && P > 0 && A >= 0 && A < 1, Limit[DSolveValue[eqns,{X[t], Y[t]}, t], t -> \[Infinity]]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3" | |
services: | |
traefik: | |
image: traefik:v2.0 | |
container_name: traefik | |
restart: unless-stopped | |
security_opt: | |
- no-new-privileges:true | |
networks: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Reworked code based on | |
http://trevorius.com/scrapbook/uncategorized/pyqt-custom-abstractitemmodel/ | |
Adapted to Qt5 and fixed column/row bug. | |
TODO: handle changing data. | |
""" | |
import sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import traceback | |
import enum | |
import functools | |
class InvalidVisitedState(Exception): | |
""" Raised when an state change sequence is incorrect. | |
""" | |
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if __name__ == "__main__": | |
from PyQt5.QtCore import QAbstractItemModel, QFile, QIODevice, QModelIndex, Qt | |
from PyQt5.QtWidgets import QApplication, QTreeView | |
import sys | |
from tree_model import TreeModel, TreeNode, RefNode | |
class NamedElement(object): # your internal structure | |
def __init__(self, name, subelements): |
NewerOlder