Giter Club home page Giter Club logo

instrumentdatabaseapi's People

Contributors

junceee avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

pinkdiamond1

instrumentdatabaseapi's Issues

API first design

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)

`importlib` is built-in

importlib is built-in for python3, put it in the requirement.txt will cause error:

ModuleNotFoundError: No module named 'importlib.util'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.