Skip to content

Instantly share code, notes, and snippets.

View mrakitin's full-sized avatar

Max Rakitin mrakitin

View GitHub Profile
from time import sleep
import click
from tqdm import trange
@click.command()
@click.option("-c", "--count", default=60, help="Duration in seconds to wait")
def timer(count):
"""Wait for the specified number of seconds and print the progress bar."""
#!/bin/bash
export GHA_TOKEN="${GITHUB_TOKEN}"
repo_name="nsls2-collection"
# https://github.com/nsls2-conda-envs/nsls2-collection/suites/11056519298/artifacts/562062216
artifact_id="562062216"
envname="2023-1.2-py39"
archive_name="${envname}.zip"
curl -L -H "Authorization: token ${GHA_TOKEN}" "https://api.github.com/repos/nsls2-conda-envs/${repo_name}/actions/artifacts/${artifact_id}/zip" > ${archive_name}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import datetime
import pprint
import uuid
import cv2
import matplotlib.pyplot as plt
from bloptools.gp.utils import get_beam_stats
from bluesky_kafka import RemoteDispatcher
from bluesky_kafka.consume import BasicConsumer
from nslsii.kafka_utils import _read_bluesky_kafka_config_file
from pyOlog.ophyd_tools import _normalize_positioners, _print_pos
def log_pos(positioners=None, extra_msg=None, objlen=200):
"""Get the current position of Positioners and make a logbook entry.
Print to the screen the position of the positioners and make a logbook text
entry. This routine also creates session information in the logbook so
positions can be recovered.
Parameters
----------

Commands to identify all importable modules/packages for a Python git repo


Update on 2024-10-29

find nslsii -name "*.py" | grep -v tests | sed 's/.__init__.py//g' | sed 's/._version//g' | sed 's/__main__.py//g' | sed 's;/;.;g' | sed 's/\.py//g'| sort -u
nslsii
nslsii.ad33
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mrakitin
mrakitin / run.py
Last active November 30, 2021 16:15
#!/usr/bin/env python
import os
try:
__IPYTHON__
import sys
del sys.argv[1:]
except:
pass
@mrakitin
mrakitin / bluesky_org_releases.py
Last active October 13, 2021 18:40
Get a list of releases for `suitcase` packages in the `bluesky` org
import os
from github import Github
token = os.getenv("GITHUB_API_TOKEN", "")
g = Github(token)
repos = g.get_organization("bluesky").get_repos()
repos = [r for r in repos]
repos_releases = {}