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

API first design #1

Open
4 of 10 tasks
shervin86 opened this issue Feb 4, 2022 · 0 comments
Open
4 of 10 tasks

API first design #1

shervin86 opened this issue Feb 4, 2022 · 0 comments
Assignees

Comments

@shervin86
Copy link
Collaborator

shervin86 commented Feb 4, 2022

A first discussion about design of the API is available here:
PaNOSC-ViNYL/ViNYL-project#65 (comment)

  • SimEx lite source + beamline + sample + detector working example
  • McStasScript source + beamline + sample + detector working example
  • Splitting example files in subfiles to test re-usage of same code parts in multiple instruments

Single class API with:

  • .init(url=the default repository, local_repo=some default local directory)
    • url: url of the github central repository
    • local_repo: local checkout directory. The user need the possibility to set it, but for the average user a default is ok
  • .ls_instrument()
    prints the names of the available instruments
  • .ls_versions(instrument)
    prints the available versions for the required instrument
  • .load_instrument (instrument_sample, version=HEAD)
    • instrument: can be a short name or the full path of the file the instrument file as include of source, beamline, effective instrument with detector
    • version:
      • HEAD: for the most recent
      • YYY_MM_DD: for a given old version
        if HEAD does not exist, it automagically pick up the most recent
        version? or return error to make sure the user knows?
    • returns the instrument object
  • .get_last_instrument_info()
    • returns a json with the following info:
      • instrument repository url
      • instrument file path in repository
      • git commit hash
  • .dump_instrument(outputfile)
    saves in .py format the instrument description
  • .diff_instrument(instrument_obj, instrument_name, version)
@PaNOSC-ViNYL PaNOSC-ViNYL deleted a comment from shervin86 Feb 25, 2022
@shervin86 shervin86 self-assigned this Feb 28, 2022
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

1 participant