pyfusion Package

pyfusion Package

H1_scan_list_old Module

pyfusion.H1_scan_list_old.database_of_scans(keyname)[source]
pyfusion.H1_scan_list_old.find_missing_shots(shot_list)[source]
pyfusion.H1_scan_list_old.get_all_shots()[source]
pyfusion.H1_scan_list_old.get_scan_keys(filename='/home/bdb112/pyfusion/working/pyfusion/pyfusion/H1_scan_list_old.pyc')[source]
pyfusion.H1_scan_list_old.make_rsync_list(shot_list, glob_expand=False)[source]

make a list for rsync -az –files-from=list.txt dest: The glob option is usually not useful, unless both filesystems are accessible with low latency: The following will exand the wildcards $ for x in cat shot_list; do ls $x;done > expanded_list

pyfusion.H1_scan_list_old.return_scan_details(keynames)[source]

keynames is a list of keynames for the various scans that have been done documentation must be populated by hand (get_scan_keys helps) options include: Feb May5 May12 Dave May19 24July2012 SeptRuns 16Aug2012FreqScan All_Shots May19Extra Test scan_5MHz low_kh_5MHz short_scan_7MHz very_short_scan_7MHz scan_7MHz scan_7MHz_high scan_5MHz_high scan_4.5MHz_16Oct scan_7MHz_16Oct_MP scan_5MHz_7MHz June16_2014_21inter aug_2013_antenna_phasing low_power_4MHz_3_4_Dec_2014 4MHz_6_Aug_2015 4MHz_6_Aug_2015 8MHz_11_Aug_2015 8MHz_54_43_20kw_11_Aug_2015 8MHz_43_20kw_26_Aug_2015 4MHz_D2_54_27kw_20_Aug_2015 4MHz_D2_54_left_55kw_20_Aug_2015 4MHz_D2_54_28kw_20_Aug_2015

debug_ Module

pyfusion.debug_.debug_(debug, level=1, key=None, msg='')[source]
Nice debug function, a line
debug_(deb, level, key=”foo”, msg=”hello”)
breaks to the debugger
if deb >=level, or if any element of <key> is a substring (“foo”) of the string value in the debug_ line
e.g. debug_(debug_num, 3) breaks if debug_num > 3
debug_(debug_var, 2, key=’svd’) breaks if debug var contains
any string containing svd or if debug_var is an int >= 2

Variables containing strings, numbers or mixed lists of both can be given as the first argument. If more than one variable is given, all are tested in sequence

debug_((pyfusion.DEBUG,local_debug), 3, key=’svd’, msg=’ at foobar’)
will break if either var meets either condition.

This way, one debug input can control several breakpoints, without too much recoding. Works interactively with python and/or with iptyhon.

Once a possible debug point is reasonably OK, its level can be raised, (level=3 etc) so that it is still accessible, but only at high debug levels, or if specifically targeted by pyfusion.DEBUG (as a string) Simple calls can be like debug_(debug,3) - where the 3 reduces the priority of this relative to other calls that share the same debug parameter. Once debugged, leave the call in, but make it specific with key=’something’ - then export PYFUSION_DEBUG=’something,local_access’ and it (or another call tagged with ‘key=’local_access’) will be triggered. msg = allows a message to be given - if the key is long enough, then there is no need for a msg, and key will be used instead.

Developer’s notes: Calls from unexpected situations (which have fixups such as try catch, can be set at low levels (such as 1), with a key that is long, and unlikely to match another. THis way, if DEBUG=0, the fixup will be used, and if DEBUG=1, the pdb will be called.

Note that as PYFUSION_DEBUG can be a string or an int, there is a try/except after reading in from the enviroment.

Further explanation: What does this mean? Say there are three possible calls to debug in a piece of code where the debug argument is passed in at one point only. Then _debug(debug,3) will break out if debug is very high, whereas debug_(debug) will more easily break out.

key is a string which allows string values of debug to selectively trigger breakout:

e.g key=’lookup’ and debug=’lookup,open’ then execution breaks

version Module

Current pyfusion version constant plus version pretty-print method.

Code copied from Fabric:
https://github.com/bitprophet/fabric/raw/master/fabric/version.py

This functionality is contained in its own module to prevent circular import problems with __init__.py (which is loaded by setup.py during installation, which in turn needs access to this version information.)

pyfusion.version.get_version(form='short')[source]

Return a version string for this package, based on VERSION.

Takes a single argument, form, which should be one of the following strings:

  • branch: just the major + minor, e.g. “0.9”, “1.0”.
  • short (default): compact, e.g. “0.9rc1”, “0.9.0”. For package filenames or SCM tag identifiers.
  • normal: human readable, e.g. “0.9”, “0.9.1”, “0.9 beta 1”. For e.g. documentation site headers.
  • verbose: like normal but fully explicit, e.g. “0.9 final”. For tag commit messages, or anywhere that it’s important to remove ambiguity between a branch and the first final release within that branch.
pyfusion.version.git_sha()[source]

Subpackages