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

ENH: A new experiment command #85

Open
ke-zhang-rd opened this issue May 22, 2020 · 4 comments
Open

ENH: A new experiment command #85

ke-zhang-rd opened this issue May 22, 2020 · 4 comments

Comments

@ke-zhang-rd
Copy link
Contributor

ke-zhang-rd commented May 22, 2020

Expected Behavior

What will happen after execuate bsui
1.

Welcome to XXX beamline. May I have your name:
>>> 
If you know your gup number, type in below:
>>>
If you know your saf number, type in below:
>>>
  1. Create session.json and store above data, if session.json exist, overwrite it.
  2. init conda and ipython(other bsui task)

After entering bsui(ipython)

  • new_experiment(gup=0, saf=0, name='Def'...) could overwrite session.json
  • list_experiment_info will print session.json
  • end_experiment will delete session.json
  • RE() will check if session.json exist. If it's, load it as equivalent RE.md['saf'] = "123456"

Options
bsui --develop will skip prompt to make development easier
bsui --continue won't overwrite existing session.json

Possible Solution

  1. Three functions in packagenslsii. BMM has a example in 08-user.py
  • new_experiment
  • list_experiment_info
  • end_experiment
  1. Update bsui. A good source of prompt code might be cookiecutter. It's depend on click

  2. A location and format of file session.json, maybe:

{
    'name': "Abc",
    'date': "yyyy-mm-dd HH:mm:ss.SSS",
    'gup': "123456",
    'saf': "123456"
}
@ke-zhang-rd
Copy link
Contributor Author

ke-zhang-rd commented Jun 5, 2020

@stuartcampbell
@danielballan

This is a checklist of features of new command function

  • 1. It's a python module
  • 2. A API(function) take user's input
  • 3. prefer use prompt.py from cookiecutter
  • 4. It should have a schema to verify user's input's format and type
    • a. name: str
    • b. gup: int
    • c. saf: int
  • 5. It should have one or several TODO functions for future authentication verify with PASS database, return True now
  • 6. return a dict or update through dict reference in argument
  • 7. tests and docs

@danielballan
Copy link
Contributor

For (3) an IPython magic might be used instead, since it can occur in the same process where RE.md is defined. But I think that's an open question, and we may want both.

For (4) I am unclear on whether we want to collect the saf or just the proposal number. (Is that what "gup" means?") I think we should treat them all as strings, because we are not in control of the specification and have to assume that they may not always be integers.

@prjemian
Copy link

prjemian commented Jun 8, 2020 via email

@prjemian
Copy link

prjemian commented Jun 8, 2020 via email

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

No branches or pull requests

3 participants