Merge branch 'master' of https://gitlab.psi.ch/slic/slic
This commit is contained in:
@@ -3,10 +3,20 @@ from . import core
|
||||
from . import devices
|
||||
from . import utils
|
||||
|
||||
from .utils.termtitle import termtitle as _termtitle
|
||||
_termtitle("⊚slic")
|
||||
|
||||
from .utils.logcfg import logcfg as _logcfg
|
||||
_logcfg()
|
||||
|
||||
from .utils.pvpreload import pvpreload as _pvpreload
|
||||
_pvpreload()
|
||||
|
||||
#TODO: add rich to dependency list
|
||||
try:
|
||||
from .utils.richcfg import richcfg as _richcfg
|
||||
_richcfg()
|
||||
except Exception as e:
|
||||
print("setting up rich failed:", e)
|
||||
|
||||
|
||||
|
||||
@@ -9,7 +9,11 @@ from slic.utils import typename
|
||||
from .baseacquisition import BaseAcquisition
|
||||
|
||||
from slic.core.acquisition.detcfg import DetectorConfig
|
||||
from jungfrau_utils.geometry import detector_geometry
|
||||
|
||||
try:
|
||||
from jungfrau_utils.geometry import detector_geometry
|
||||
except ImportError:
|
||||
detector_geometry = {}
|
||||
|
||||
|
||||
class FakeAcquisition(BaseAcquisition):
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
import re
|
||||
import numpy as np
|
||||
from matplotlib import pyplot as plt
|
||||
from jungfrau_utils.geometry import detector_geometry
|
||||
|
||||
try:
|
||||
from jungfrau_utils.geometry import detector_geometry
|
||||
except ImportError:
|
||||
print("could not import detector_geometry from jungfrau_utils")
|
||||
detector_geometry = {}
|
||||
|
||||
|
||||
JF_PATTERN = r"(JF)(\d{2})(T)(\d{2})(V)(\d{2})"
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
from IPython import get_ipython
|
||||
|
||||
import rich
|
||||
import rich.pretty
|
||||
|
||||
|
||||
def richcfg():
|
||||
rich.pretty.install()
|
||||
replace_ipython_inspect()
|
||||
|
||||
|
||||
def replace_ipython_inspect():
|
||||
ipy = get_ipython()
|
||||
if ipy is None:
|
||||
return
|
||||
|
||||
def _inspect(obj, oname="", formatter=None, info=None, detail_level=0, enable_html_pager=True, omit_sections=()):
|
||||
if isinstance(obj, type):
|
||||
title = f"{obj.__module__}.{obj.__name__}"
|
||||
else:
|
||||
title = f"{oname} = {obj}"
|
||||
methods = (detail_level > 0)
|
||||
rich.inspect(obj, title=title, methods=methods)
|
||||
|
||||
ipy.inspector.pinfo = _inspect
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
|
||||
def termtitle(title):
|
||||
title = "\33]0;" + str(title) + "\a"
|
||||
print(title, end="", flush=True)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user