Skip to content

How to use

yadizhou edited this page Nov 20, 2017 · 11 revisions

Start LabPype

To run LabPype, simply type the command:

python -m labpype.__init__

LabPype will create a folder .labpype in your home directory as the workspace (workspace) for settings and downloaded/installed widget sets.

If you don't want the terminal to show up, you can run LabPype with pythonw. For example, on Windows, create a shortcut and type in the following command for target:

pythonw.exe -m labpype.__init__

Use in specified workspace

LabPype allows you to have multiple instances of LabPype that each has its own workspace. This way, each instance can have its own installed widget sets and program settings.

For example, if you want to run LabPype in a folder called cloning, create a run.pyw file in the folder and add the following:

import os
import labpype
App = labpype.App(path=os.path.dirname(os.path.realpath(__file__)))
App.Start()

Then run the pyw file

python run.pyw

You will see several files and folders are created in the cloning folder.

The interface

  • Canvas - where you draw the pipeline and interact with widgets.
  • Tool - basic functions such as load & save, and functions for organizing the canvas.
  • Widget - where you find all the widgets you have installed.
  • Harbor - dialogs that are docked appear here
  • Misc. - more features are coming

At this point, we do not have any widgets installed. To get started, we will download a toy widget set in the next section.

A simple demo

Download the demo

We will need the following files:

ToyWidgetSet.zip - The toy widget set
demo.pa - A project save file that contains both the scheme and data
demo.pas - A scheme save file that contains only scheme
demo.py - A shortcut for you to start LabPype easily

Let's put all these files in a folder called demo, then start LabPype:

cd demo
python demo.py

Click this button in the widget panel to invoke the widget manage dialog:

Here you can add/delete widgets, download widgets, and manage groups.

Now click the button and install the file ToyWidgetSet.zip.

If you see this dialog, it means you have successfully installed the first widget set for your LabPype!

Your widget manage dialog should look like this now. Click OK.

Now you can see the widgets you just installed in the widget panel. Try to drag them to the canvas and link them using those small rectangles (anchors).

Next, let's try to load the saved project. Click this in the tool panel, then in the dialog that showed up, click and choose the file demo.pa. Click OK to load the file. Your canvas should look like this now:

Let's double click the rightmost Summer to invoke its own dialog.

Try all the buttons!

What's next

The more widget sets there are, the more useful LabPype will be for you. At this early stage of LabPype, here are the things you can do next:

  • If you can code, see How to develop. As a framework, LabPype has lots of features that simplify the making of widgets. Then you can enjoy using your own widgets! Also, it would be nice if you can share your widgets.
  • If you cannot code, you can help LabPype grow by sharing with us what new features you would want to see, and what kind of widgets can help you with your tasks.