-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
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
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 * |