Flow11_AT — Test task copying a File_BDP to the output.

This module defines the Flow11_AT class.

class admit.at.Flow11_AT.Flow11_AT(**keyval)[source]

Flow11_AT will change one File_BDP into another File_BDP, purely to test or emulate a flow. It will also implement an example how parameters are added back from the AT to ADMIT using the summary feature.

See also Flow_AT for the design document that describes the Flow family.

Together with Flow1N_AT and FlowN1_AT these are AT’s that take File_BDP’s as input (1 or N), and produce File_BDP’s as output (1 or N).

Input files pointed to in the BDP’s do not have to exist, but the AT can be forced to check for those (exist=True).

Output files listed in the BDP’s can be ignored, but can also be created as 0-length files (touch=True).

The use of “exist” and “touch” thus symmetrizes the way how the Flow*_AT’s can be used to emulate the dependancy of a flow on file existence and/or creation.

Flow11_AT adds the following to ADMIT summary:

datamin: real
   The datamin parameter of foobar.

datamax: real
   The datamin parameter of foobar.

rmsmethd: dictionary
   A list describing the rms method.

Keywords

file: string
Output filename created, from which the BDP is named as well as “<file>.bdp”. The BDP is always created. The file itself will depend on the touch= keyword. If the filename is blank, it will generate an output filename by appending _11 to the input filename.
touch: bool
Create a 0-length file that the output BDP will point to [True].
exist: bool
Input file that belongs to a BDP must exist to pass [True].

Input BDPs

File_BDP: count: 1
Test input.

Output BDPs

File_BDP: count: 1
Test output.

Methods

addinput(item[, slot]) Add a BDP input to an AT.
addinputbdp(item[, slot, insert]) Add a BDP to the _bdp_in list.
addoutput(item[, slot]) Add a BDP output product to an AT.
addoutputbdp(item[, slot, insert]) Add a BDP to the _bdp_out list.
baseDir([path]) Get/set project base directory.
bestMatch(at1, at2) Determines the better match of two tasks to the current one.
checkfiles() Check if the files from all the BDP_out’s in an AT exist.
checktype(item) Check the type of an object to see if it is a BDP.
clearinput() Clear the input BDP list.
clearoutput([delete]) Clear the output BDP list.
copy() Creates an independent duplicate of the task.
delete() Method to delete the AT and underlying BDPs.
delinput(slot) Delete a specific BDP in the _bdp_in list.
deloutput(slot) Delete a specific BDP in the _bdp_out list.
dir([filename]) Absolute directory reference of the ADMIT project.
dryrun() Method to do a dry run of the AT, generally just checks input values for errors.
enabled([state]) Returns current task enabled setting, with optional reset.
execute([args]) Executes the task.
freeAlias(aliases[, alias]) Deletes alias reservation, if present.
get(attrib) Method to get the given attributes value
getProject() Retrieves project ID associated with the task.
getVersion() Return the version string.
getdtd(fl) Method to write out the dtd data.
geteffectivelevel() Method to get the effective logging level of the logging subsystem
getkey(key) Retrieval value for a key.
getloggername() Method to get the name of the logger for this AT instance
getlogginglevel() Method to get the current logging level of the AT
haskey(key) Query if a key exists for an AT.
html(inheader) Method to represent the current AT in HTML format.
id([strip]) Returns task ID number.
isAutoAlias([withEmpty, compat]) Whether the task alias appears to be auto-generated.
isequal(at) Method to determine if two ATs are the same.
isstale() Returns whether the AT is out of date.
len2() Returns the length of _bdp_in and _bdp_out in a tuple.
link() Increments the task link count.
markChanged() Mark an AT that it’s state was changed, so it would need to be rerun.
markUpToDate() Resets _stale to indicate that the AT does not need to be run.
merge(at[, aliases]) Merges attributes from another task.
mkdir(dirname) Make a directory in the ADMIT hierarchy.
mkext(filename, ext[, alias]) Return a new filename with a new extension with optional ADMIT alias.
newId(tid) Assigns the task a new ID number.
reset(a) Performs an in-place shallow copy.
run() run Flow11_AT
running([state]) Returns current task execution flag, with optional reset.
save() Save (write) any BDPs connected to this AT.
set(item, val) Method to set protected attributes, rather than direct access
setAlias(aliases[, alias, auto]) Sets and registers the task alias, guaranteed unique among registered aliases.
setProject(pid) Adds a project ID to task ID.
set_bdp_in([bdpin]) Validate the _valid_bdp_in list and digest it into the appropriate attributes.
set_bdp_out([bout]) Validate the _valid_bdp_out list and digest it into the appropriate attributes.
seteffectivelevel(level) Method to set the effective logging level of the logging subsystem
setkey([name, value, isinit]) Set keyword value.
setloggername(name) Method to set the name of the logger for this AT instance
setlogginglevel(level) Method to set the logging level
show() Return the AT type.
statusicons() return some html icons representing the enabled/stale status of this task
summarize() Convenience function to populate dictionary for items to add to the ADMIT Summary.
summary() Returns the summary dictionary from the AT, for merging into the ADMIT Summary object.
touch2(fname) a native python “touch” barely adds overhead
unlink() Decrements the task link count.
userdata() Returns the user data dictionary from the AT, for merging into the ADMIT user data object.
validateinput([describe]) Method to validate the _bdp_in’s against a dictionary of expected types.
validatekeys() Method to error check all input keys.
write(node) Method to write the AT to disk.
run()[source]

run Flow11_AT

summarize()[source]

Convenience function to populate dictionary for items to add to the ADMIT Summary.

summary()[source]

Returns the summary dictionary from the AT, for merging into the ADMIT Summary object.

touch2(fname)[source]

a native python “touch” barely adds overhead (maybe 0.2” on 10000 operations) This is a helper member function of the class, compare this with touch1, which is a local helper function to run().

userdata()[source]

Returns the user data dictionary from the AT, for merging into the ADMIT user data object.