.. _instrument.create_bluesky_ipython_profile: Create a bluesky IPython profile -------------------------------- .. note:: Compare with :ref:`reference.configure_ipython_profile` This bash command create a new IPython profile for bluesky: .. raw:: html
$ ipython profile create bluesky --ipython-dir="~/.ipython"Next, create the starter script for this profile. This will ensure that the instrument package gets loaded when starting a bluesky IPython session. .. note:: Copy *all* these lines and paste them exactly into your terminal. .. code:: bash cat > ~/.ipython/profile_bluesky/startup/00-start-bluesky.py << EOF import pathlib, sys sys.path.append(str(pathlib.Path().home() / "bluesky")) from instrument.collection import * EOF To start an IPython session with the new bluesky profile, you can now use the following command: .. raw:: html
$ ipython --profile=bluesky.. raw:: html
~/.bashrc
and ~/.bash_aliases
files, which are configuration files for your bash shell.
Here's a simple step-by-step guide:
~/.bashrc
and ~/.bash_aliases
files with your prefered text editor,
e.g.:
$ gedit ~/.bashrc ~/.bash_aliasesIf any of those files do not exist, this command will create blank ones.
~/.bash_aliases
, scroll down to the end of the file or find a suitable place to add your alias.
On a new line, type:
export BLUESKY_CONDA_ENV=bluesky_2023_3 alias start_bluesky='conda activate ${BLUESKY_CONDA_ENV}; ipython --profile=bluesky'Note: this lines may already be included in your
~/.bash_aliases
,
e.g., if you have created an alias to activate the bluesky conda environment.
~/.bashrc
, scroll down to the end of the file or find a suitable place to add the following lines:
source ~/.bash_aliases
bash
and press enter, or open a new terminal windows to make the new alias available.start_bluesky
to activate the conda environment and
and start a new bluesky session in a terminal.