Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
prjemian committed Jul 12, 2022
1 parent 79ca27e commit 6ccfb95
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions bluesky/console/__start_bluesky_instrument__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"""
start bluesky in IPython console session
"""

# start a Bluesky data collection console session
import pathlib, sys

# add the "bluesky/" directory to the system path
__BLUESKY_IN_HOME_DIRECTORY__ = False
# first, identify the parent directory
if __BLUESKY_IN_HOME_DIRECTORY__:
BLUESKY_DIRECTORY = pathlib.Path.home()
else:
# <training repository directory>
BLUESKY_DIRECTORY = pathlib.Path(__file__).absolute().parent.parent.parent
# next, name the "bluesky" subdirectory
BLUESKY_DIRECTORY = BLUESKY_DIRECTORY / "bluesky"
if not BLUESKY_DIRECTORY.exists():
raise FileNotFoundError(
f"Cannot find bluesky directory: {BLUESKY_DIRECTORY}"
)
# put bluesky directory on the import path
sys.path.append(str(BLUESKY_DIRECTORY))

# terse error dumps (Exception tracebacks)
get_ipython().run_line_magic('xmode', 'Minimal')

from instrument.collection import *

0 comments on commit 6ccfb95

Please sign in to comment.