Giter VIP home page Giter VIP logo

sprokit's Introduction

sprokit

Sprokit is the "Stream Processing Toolkit", a library aiming to make processing a stream of data with various algorithms easy. It supports divergent and convergent data flows with synchronization between them, connection type checking, all with full, first-class Python bindings.

Sprokit tends towards making enforced checks (though escape hatches are available) to avoid common errors in code. These checks allow for code to make more assumptions while threading or sharing data. Sprokit "pipelines" consist of "processes" (which have data "ports") and connections between the ports. Each data port describes the data it is expecting in with a "type" string and a set of flags describing what it expects of the data. These flags describe the data sharing policy for the ports so that the pipeline can detect that two threads may be doing improper data sharing. Once a pipeline is constructed, a "scheduler" runs the pipeline by telling which processes should run when. There is also a domain-specific language for its pipelines so that combining processes together requires no code to write or compile.

Mailing Lists

User's list:

http://public.kitware.com/cgi-bin/mailman/listinfo/sprokit-users
[email protected]

Developer's list:

http://public.kitware.com/cgi-bin/mailman/listinfo/sprokit-developers
[email protected]

Development

When developing on sprokit, please keep to the prevailing style of the code. Some guidelines to keep in mind for different languages in the codebase are as follows:

CMake

  • 2-space indentation
  • Lowercase for private variables
  • Uppercase for user-controlled variables
  • Prefer functions over macros
    • They have variable scoping and debugging them is much easier
  • Prefer foreach (IN LISTS) and list(APPEND)
  • Prefer sprokit_configure_file over configure_file when possible to avoid adding dependencies to the configure step
  • Use the sprokit_ wrappers of common commands (e.g., add_library, add_test, etc.) as they automatically Do The Right Thing with installation, compile flags, build locations, and more)
  • Quote all paths and variable expansions unless list expansion is required (usually in command arguments or optional arguments)

C++

  • 2-space indentation
  • Use lowercase with underscores for symbol names
  • Store intermediate values into local const variables so that they are easily available when debugging
  • There is no fixed line length, but keep it reasonable
  • Default to using const everywhere
  • All modifiers of a type go after the type (e.g., char const*, not const char*)
  • Export symbols (or import them if possible)
  • Use braces around all control (even single-line if) blocks
  • Use typedefs
  • Use exceptions and return values, not error codes and output parameters
    • This allows for chaining functions, works with <algorithm> better, and allows more variables to be const

Python

  • Follow PEP8
  • When catching exceptions, catch the type then use sys.exc_info() so that it works in Python versions from 2.4 to 3.3
  • No metaclasses; they don't work with the same syntax in Python2 and Python3
  • Avoid 'with' since it doesn't work in Python 2.4

Testing

Generally, all new code should come with tests. The goal is sustained 95% coverage and higher (due to impossible-to-generically-create corner cases such as files which are readable, but error out in the middle). Tests should be grouped into a single executable for each class, group of cooperating classes (e.g., process tests), or higher-level use case (e.g., running a pipeline). In C++, use the TEST_ macros which will hook into the testing infrastructure automatically and in Python, name functions so that they start with test_ and they will be picked up automatically.

Submitting Patches

Patches may be sent to the developer's list with the standard git format-patch and git send-email combo. Here's an example submission:

# Base the new branch off of master.
% git checkout -b dev/topic master
# Edit code.
% $EDITOR
# Make commits.
% git commit
# When done, create a set of patches with a cover letter.
% git format-patch --output-directory patches/topic \
    --signoff --cover-letter master..
# Describe the branch in the cover letter.
% $EDITOR patches/topic/0000*
# Send the patches to the list.
% git send-email --to [email protected] \
    --no-chain-reply-to patches/topic/*.patch

sprokit's People

Contributors

kfieldho avatar kylelutz avatar linus-sherrill avatar mathstuf avatar mleotta avatar mwoehlke-kitware avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sprokit's Issues

How to register new processes to Sprokit?

I have found following description to Sprokit here:
https://github.com/Kitware/kwiver/blob/dev/add-track-oracle/sprokit/doc/running-notes.md

Modules are loaded from a set of directories that are configured into the loader at build time. The default directory is 'lib/sprokit' subdirectory of the install tree. Additionally, at build time, The build directory can be added to the loading path by selecting the cmake variable KWIVER_USE_BUILD_TREE Set environment variable SPROKIT_MODULE_PATH to list directories of loadable modules

  • So I have to put a new module into the subdirectory 'lib/sprokit' and rebuild Kwiver?

Following processes aren't registered.

  • kw_archive_writer_process
  • kw_print_number_process

I tried to set the environment variable SPROKIT_MODULE_PATH and to rebuild Kwiver, but it didn't worked.
So the question is:
What is the standard approach to register a process to Sprokit?

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.