Code Monkey home page Code Monkey logo

finddata's Introduction

finddata

A program to find data files using ONCat.

Installation

Put finddata somewhere in your path (i.e. /usr/local/bin). If you want to use finddata.publish_plot(), the configuration file /etc/autoreduce/post_processing.conf must be in place with the url and credentials. It is advised that this be readable only by the process using the functionality.

python -m build; pip install .

Optional bash completion

`pip install .[bashcompletion]

finddata's People

Contributors

peterfpeterson avatar pre-commit-ci[bot] avatar kedokudo avatar ktactac-ornl avatar peterparker avatar andreisavici avatar searscr avatar rosswhitfield avatar

Stargazers

Yuanpeng Zhang avatar

Watchers

 avatar James Cloos avatar  avatar  avatar

finddata's Issues

Bash completion bug

When using bash completion just typing the program name followed by a double tab gives:

$ finddata Usage: finddata [options] <instr> <runnumber>

finddata: error: Got 1 arguments. Expecting instrument and run number
Usage: finddata [options] <instr> <runnumber>

finddata: error: Got 1 arguments. Expecting instrument and run number

arcs     CNCS     hys      MANDI    ref_l    SEQ      venus    VULCAN
ARCS     corelli  HYS      nom      REF_L    snap     VENUS    
bss      CORELLI  hysa     NOM      ref_m    SNAP     vis      
BSS      eqsans   HYSA     pg3      REF_M    topaz    VIS      
cncs     EQSANS   mandi    PG3      seq      TOPAZ    vulcan   
$ finddata

Create a spec file

The rpm could be a noarch that depends on python, bash, and bash-completion.

Fix Listing of All Runs in a Proposal

Stacktrace

15:28 $ finddata -l DEBUG --listruns IPTS-6255 PG3
DEBUG:options Namespace(getproposal=False, inst='PG3', listruns='IPTS-6255', loglevel=10, runs=[], version=False)
Traceback (most recent call last):
  File "/usr/bin/finddata", line 230, in <module>
    print(getRunsInProp(options.facility, options.inst, options.listruns))
  File "/usr/bin/finddata", line 122, in getRunsInProp
    doc = getJson(endpoint % (facility, proposal, instrument))
  File "/usr/bin/finddata", line 65, in getJson
    handle = urlopen(req)
  File "/usr/lib64/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib64/python2.7/urllib2.py", line 437, in open
    response = meth(req, response)
  File "/usr/lib64/python2.7/urllib2.py", line 550, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib64/python2.7/urllib2.py", line 475, in error
    return self._call_chain(*args)
  File "/usr/lib64/python2.7/urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "/usr/lib64/python2.7/urllib2.py", line 558, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 404: NOT FOUND

Solution

There's a typo in line 122:

doc = getJson(endpoint % (facility, proposal, instrument))

This needs to be changed to:

doc = getJson(endpoint % (proposal, facility, instrument))

Fix Sort Direction in Call to ONCat API

I've just spotted an issue with the call to ONCat:

https://github.com/peterfpeterson/finddata/blob/105e4378d109229d80f2d9968414aeeac59796db/scripts/finddata#L141

It should be sort_direction, and not sort_by, similar to the equivalent call in Mantid and as per the API docs.

The typo as it appears here is my fault, and effectively means that finddata does not currently find the most recently-cataloged datafile for any run that has been "re-translated" (and therefore has two, duplicate entries in the DB). In such a case it will currently return the old location of the run.

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.