API#

This section details the components of the mmqprop application. The information generated here is extracted automatically from the application code.

Primary mmqprop class#

mmqprop.version()[source]#

Command Line Event Loop#

This class is responsible for loading all installed command plugins, creating the application context for this run and starting the user command loop. A simple > prompt is provided as a prompt. The app_debug flag can be set in the code to debug the application during development.

class mmqprop.EventLoop.CLI(debug)[source]#

Bases: object

Primitive event loop for commandline

app_debug = False#
process_command(cmd)[source]#
run()[source]#

Application Context#

The Context class constructs a data store passed to all commands.

class mmqprop.Context.Context[source]#

Bases: object

manages data passed between commands

CD = []#
CL = []#
CM = []#
airfoil = 'simplex'#
airfoil_data = ()#
argcount = 0#
data_dir = 'data'#
debug = False#
model = 'hodson-wart'#
model_data = {}#
motorfile = 'default_motor'#
propfile = 'default_prop'#

Application Command Plugins#

Each application command is implemented in a separate file with a name starting with cmd_. New commands can be added by simple writing a new file and placing it in the commands directory.

class mmqprop.commands.cmd_versions.Plugin[source]#

Bases: object

version command plugin

help = 'display dependency versions'#
name = 'versions'#
process(ctx)[source]#

fetch and display dependency versions

class mmqprop.commands.cmd_debug.Plugin[source]#

Bases: object

debug command plugin

help = 'toggle application debug flag'#
name = 'debug'#
process(ctx)[source]#

flip current debug flag setting

Load Standard QPROP Data Files#

These files support loading example data files found in the QPROP Fortran source files.

Basic File Input#

The input files have a Fortram flavor, using the ! character to start an end-of-line comment. Thif file provides code that loads a neded file, deletes all comments, and returns a simple list of data chinks from the file.

mmqprop.file_io.load_data(fname)[source]#

load a data file, strip whitespace, return data

The next file processes a propeller data file.

class mmqprop.Propeller.Propeller(ctx, fname='data/default_prop')[source]#

Bases: object

Load standard QPROP propeller file from data dir

dump()[source]#
parse()[source]#
prepare()[source]#

use splines to henerate fine grid of data

read_error(msg)[source]#

Next, we process a motor data file

class mmqprop.Motor.Motor(ctx, fname='default_motor')[source]#

Bases: object

dump()[source]#
parse()[source]#
read_error(msg)[source]#

Circulation#

Standard Atmosphere Model#

class mmqprop.StdAtm.StdAtm(u, z)[source]#

Bases: object

1976 us standard Atmosphere

T()[source]#

return temperature vs altitude

a()[source]#

return speed of sound vs altitude

mu()[source]#

return viscosity vs altitude

p()[source]#

return pressure vs altitude

properties()[source]#
rho()[source]#

return density vs altitude

sl_properties()[source]#