Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better way to prepare bluesky environment #141

Merged
merged 14 commits into from
Aug 18, 2023
Merged

Conversation

mrakitin
Copy link
Member

@mrakitin mrakitin commented Aug 17, 2023

This PR moves the prepare_*_env.py code from the examples/ dir to the library, so that it can be imported in IPython and Jupyter notebooks (both interactively and in the docs). The argparser CLI args parser was added so that users can specify the databroker config name and root path for the data files. This can be reused in bloptools, such as:

from sirepo_bluesky import prepare_re_env
%run -i $prepare_re_env.__file__ --db-type=temp

from bloptools import <some-srw-or-shadow-sim>  # to be implemented
%run -i <some-srw-or-shadow-sim>.__file__ --port=8082

Other additions:

Usage:

In [1]: from sirepo_bluesky import prepare_re_env
   ...: %run -i $prepare_re_env.__file__ --help
usage: prepare_re_env.py [-h] [-d DB_TYPE] [-r ROOT_DIR] [-e {stepper,flyer}]

Prepare bluesky environment

optional arguments:
  -h, --help            show this help message and exit
  -d DB_TYPE, --db-type DB_TYPE
                        Type of databroker ('local', 'temp', etc.)
  -r ROOT_DIR, --root-dir ROOT_DIR
                        The root dir to create YYYY/MM/DD dir structure
  -e {stepper,flyer}, --env-type {stepper,flyer}
                        Type of RE environment (['stepper', 'flyer'])
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@mrakitin mrakitin marked this pull request as ready for review August 17, 2023 12:59
Copy link
Contributor

@thomaswmorris thomaswmorris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be very convenient for bloptools actually

@mrakitin mrakitin merged commit 177f5e2 into NSLS-II:main Aug 18, 2023
8 checks passed
@mrakitin
Copy link
Member Author

Thanks for your reviews, @AbbyGi and @thomaswmorris!

@mrakitin mrakitin deleted the cli-prep-env branch August 18, 2023 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mention create_classes API change in release notes for v0.7.0 Sort out test failures
3 participants