Code Monkey home page Code Monkey logo

cutlass's Introduction

cutlass


Installation

Using easy_install

Cutlass requires the osdf-python project as a dependency to work properly. Verify that you already have osdf-python installed and in the PYTHONPATH. One way of doing this is by using the Python REPL:

  $ python
  > from osdf import OSDF
  > <CNTRL-D>
  

If there are no errors or exceptions, then you should be ready to proceed with the installation of Cutlass. Download or clone the cutlass source code from github.

  $ git clone https://github.com/ihmpdcc/cutlass
  
  $ cd cutlass
  

Then one can use easy_install to install . If you have root privileges:

  # easy_install .
  

or with sudo:

  $ sudo easy_install .
  

If you are performing a non-root installation, you can still use easy_install. First, pick an installation directory. In this example we'll use /tmp. Then add the installation directory to your PYTHONPATH environment variable if it isn't already there:

  $ export PYTHONPATH=$PYTHONPATH:/tmp
  

Then invoke easy_install with the --install-dir option. Note the final '.', which tells easy_install where to look for the setup.py script.

$ easy_install --install-dir /tmp .

Using pip

Another tool that is commonly used to install Python modules is pip. To use pip to install Cutlass, download the source code as shown above, then invoke pip as root or using sudo:

  $ cd cutlass
  
  $ sudo pip install .
  

Verify installation

Verify installation using Python REPL again:

  $ python
  > from cutlass import *
  > <CNTRL-D>
  

Overview

An iHMP domain specific API using osdf-python

import sys
from cutlass import iHMPSession

# Need to provide credentials to do things with OSDF
session = iHMPSession(username, password)

sample = session.create_sample()

sample.body_site = “tongue dorsum”
sample.supersite = “oral”

# ...more data

# See if we are valid and, if so, save the data
if sample.is_valid():
    sample.save()
else
    validation_errors = sample.validate()
    sys.stderr.write(“\n”.join(validation_errors))

Testing

Cutlass comes with bundled tests to enable developers to make changes and check for regressions. Since cutlass is primarly written in Python, we use the unittest module. To invoke any of the tests, we recommend that you first change directories into the base of the cutlass code

  $ cd cutlass
  

Then, to invoke the a single test script (in this case test_project.py can be found in the tests/ directory):

  $ python -m unittest tests.test_project
  

To autodiscover all tests and run them all:

  $ python -m unittest discover
  

cutlass's People

Contributors

abhishek9691 avatar cometsong avatar victor73 avatar

Watchers

 avatar  avatar

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.