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

Tiled integration #24

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open

Conversation

genematx
Copy link

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
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.

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.

2 participants