Skip to content

Conversation

@genematx
Copy link
Contributor

A tutorial on implementing the integration of Tiled and Bluesky.

@danielballan
Copy link
Member

Two more considerations for TempTiledServer. My goals are:

  • slick / succinct in the tutorial
  • but not too "weird" / different from normal (client) usage
  • avoid teaching bad / insecure habits

To that end, some thoughts to consider:

  • Should the dir_path default to a temporary directory? More succinct, and unique by default. Notebooks can set a deterministic path when desired.
  • Should the API key be random hex by default? I would like to avoid teaching users to hard code api_key in notebooks. (Technically it's best to set it in the env vars. In practice I think users will be logging it interactively to servers that have proper auth, not single-user API key.) Maybe this is a good balance of convenience and not teaching bad habits?
server = TempTiledServer()
from_uri(server.url)  # server.url is 'http://localhost:8000?api_key=<random hex>'

Just an idea. I do think it's nice to pass a string to from_uri rather than this special variable...but I like that this avoids teaching two bad habits: setting api_key to something trivial (insecure) and passing it explicitly in code.

@genematx
Copy link
Contributor Author

genematx commented Dec 12, 2024

Two more considerations for TempTiledServer.

Great ideas! thank you, Dan. Refernced in bluesky/tiled#826.
The writing directory is already temporary by default, and setting the api_key to a random value makes perfect sense.

@danielballan
Copy link
Member

I see use cases for setting a deterministic non-temporary directory: create data in one notebook, analyze it in another. Maybe we should go back from TempTiledServer to plain TiledServer. It's "temp" by default, but not in general.

We can potentially use the rich repr in Jupyer to communicate something about how this is a special approach and what the CLI equivalent is.

@jkxray
Copy link
Contributor

jkxray commented Jun 11, 2025

Consider putting this content into (or in place of) https://github.com/bluesky/bluesky-cookbook/blob/main/docs/tutorials/flyscanning/orch-daq.md so it can follow the tutorial pages so far defined.

@jkxray
Copy link
Contributor

jkxray commented Aug 5, 2025

Is this work superseded by PR 37?

@genematx
Copy link
Contributor Author

genematx commented Aug 5, 2025

Is this work superseded by PR 37?

It is related, but mostly outdated. Still, there are some useful bits here. I will review it, keep the relevant code, and close this PR.

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.

3 participants