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

Docs on config setup #532

Open
stan-dot opened this issue Jul 1, 2024 · 11 comments · May be fixed by #634
Open

Docs on config setup #532

stan-dot opened this issue Jul 1, 2024 · 11 comments · May be fixed by #634
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@stan-dot
Copy link
Collaborator

stan-dot commented Jul 1, 2024

That would be good as well, but I think having examples in the docs without having to read through the code would be helpful for setting up new environments.

Originally posted by @tpoliaw in #408 (comment)

@stan-dot stan-dot changed the title examples in the docs without having to read through the code would be helpful for setting up new environments. examples in the docs Jul 1, 2024
@callumforrester
Copy link
Collaborator

@stan-dot could you add more description/context to this issue please?

@stan-dot stan-dot changed the title examples in the docs examples of the ophyd-async device creation process and reasoning Jul 2, 2024
@callumforrester
Copy link
Collaborator

This has been done in the dodal and ophyd-async documentation. I think we should close this issue, or at most just include links in the blueapi docs.

@stan-dot
Copy link
Collaborator Author

stan-dot commented Sep 9, 2024

what do you think @tpoliaw ?

@tpoliaw
Copy link
Contributor

tpoliaw commented Sep 9, 2024

I still think there needs to be something prominent in the docs/ getting started that details what should go in the config file. It currently says use blueapi --config path/to/file.yaml to pass configuration but not what should go in the file, only that "An example of this yaml file is found in config/defaults.yaml" which no longer exists.

@callumforrester
Copy link
Collaborator

...true, reading your original comment, I think the title of this issue may just be wrong. @stan-dot could you rename it to be about the blueapi config, rather than ophyd-async devices?

@stan-dot stan-dot changed the title examples of the ophyd-async device creation process and reasoning Docs on config setup Sep 9, 2024
@stan-dot stan-dot added documentation Improvements or additions to documentation enhancement New feature or request labels Sep 9, 2024
@stan-dot
Copy link
Collaborator Author

stan-dot commented Sep 9, 2024

I think to add

env:
  sources:
    - kind: dodal
      module: dodal.beamlines.p38
    - kind: planFunctions
      module: dls_bluesky_core.plans
    - kind: planFunctions
      module: dls_bluesky_core.stubs
  data_writing:
    visit_directory: /dls/p38/data/2023/cm33874-1
    group_name: BL38P

to blueapi.config.ConfigLoader as docstring. What do you think @tpoliaw , @callumforrester ?

@tpoliaw
Copy link
Contributor

tpoliaw commented Sep 9, 2024

That would be a useful start. Do the docstrings end up on the docs site somewhere? It would be good if there was detail about what the various kinds were as well as where it is looking for modules etc. It would be good to add a link to the cli as well so that blueapi --help will direct users to something useful

@callumforrester
Copy link
Collaborator

Yeah, it would be good to have a reference here: https://diamondlightsource.github.io/blueapi/main/reference.html

@stan-dot A complete example would be good but it would be ideal if we didn't have to rely on a human to remember to keep it up-to-date. I.e. we should make an example in code, generate some yaml for the docs from it, and that way it should fail if we ever change the config model and cause a validation error.

@stan-dot
Copy link
Collaborator Author

stan-dot commented Sep 9, 2024

@callumforrester would a test with a hard-coded yml string asserting a correct read be ok?

@callumforrester
Copy link
Collaborator

I would accept that, although I would personally prefer the other way around (generate the yml string from hard-coded python), but for no other reason than it seems neater.

@stan-dot
Copy link
Collaborator Author

stan-dot commented Sep 9, 2024

getting the raw yml string is more similar to parsing a raw .yml file contents from the filesystem (the previous setup). I'll make the new test soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants