Skip to main content

No project description provided

Project description

https://circleci.com/gh/AndreaCensi/quickapp.svg?style=svg

QuickApp

QuickApp is a library that composes the functionality of Compmake, Reprep in high-level constructs for extremely rapid development of scientific applications.

Simplest QuickApp application

This is an example of the simplest QuickApp application. It does not use Compmake functionality.

from quickapp import QuickAppBase

class VideoMaker(QuickAppBase):
    """ Basic example of a QuickApp (no Compmake support) """
    def define_program_options(self, params):
        params.add_int('param_name', default=1)

    def go(self):
        self.info('you passed: %s' % self.get_options().param_name)

main = VideoMaker.get_sys_main()

Here’s an example that uses Compmake to define jobs:

#!/usr/bin/env python
from quickapp import QuickApp

class AppExample(QuickApp):
    """ Simplest app example """

    def define_options(self, params):
        params.add_int('x', default=1)

    def define_jobs_context(self, context):
        options = self.get_options()
        # create a job
        context.comp(f, options.x)

def f(x):
    print('x = %s' % x)

app_example_main = AppExample.get_sys_main()

if __name__ == '__main__':
    app_example_main()

QuickApp with subcommands

Define the parent app by deriving from QuickMultiCmdApp:

class DemoApp(QuickMultiCmdApp):
    cmd = 'dp'

    def define_multicmd_options(self, params):
        params.add_string('config', help='Config Joint')
        params.add_int('param2', help='Second parameter')

    def initial_setup(self):
        options = self.get_options()
        self.info('Loading configuration from %r.' % options.config)
        self.info('My param2 is %r.' % options.param2)

main_func = DemoApp.

Define the subapps by deriving from DemoApp.get_sub():

class DemoAppCmd1(QuickApp, DemoApp.get_sub()):
    cmd = 'cmd1'
    short = 'First command'

    def define_options(self, params):
        params.add_int('param1', help='First parameter', default=1)
        params.add_int('param2', help='Second parameter')

    def define_jobs(self, context):
        options = self.get_options()
        self.info('My param2 is %r.' % options.param2)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

QuickApp-z6-6.0.5.tar.gz (46.2 kB view details)

Uploaded Source

File details

Details for the file QuickApp-z6-6.0.5.tar.gz.

File metadata

  • Download URL: QuickApp-z6-6.0.5.tar.gz
  • Upload date:
  • Size: 46.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.7.5

File hashes

Hashes for QuickApp-z6-6.0.5.tar.gz
Algorithm Hash digest
SHA256 5a3829097635428a3d18485e508133544f576128590bfa1a324028e8992dd452
MD5 01f345192a50e1a27cb521ab9c90d915
BLAKE2b-256 a0061b4f1f1475b146bd09de6f8f0e2bce80640e3743b89a614eb018db22102d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page