Basic Data Product

Defines the Basic Data Product (BDP) base class.

class admit.bdp.BDP.BDP(xmlFile=None, **keyval)

Basic Data Product base.

Basic Data Products (BDPs) are data containers used to transport information within ADMIT, as well as deliver it to users in a persistent, well-defined format.

Parameters:

xmlFile: str

XML file associated with BDP (for persistence); defaults to None.

Attributes

project: TBD TBD
sous: TBD TBD (the official name is sous)
mous: TBD TBD
gous: TBD TBD
_date: TBD Date of last edit.
_type: admit.util.bdp_types Concrete BDP type.
xmlFile: str XML file associated with BDP (for persistence).
_updated: bool Whether BDP has been modified since latest XML output.
_taskid: int Originating ADMIT task ID number.
_usedby: list of TBD TBD

Methods

delete([basedir, delfiles]) Method to delete the BDP.
depends_on_(other) deprecated
get(key) access an attribute
getfiles() return the filename(s) associated with the basic data in a BDP.
haskey(key) Query if a key exists for an AT.
isequal(bdp)
report() report some properties, human readable.
setkey([name, key, init]) set keys, two styles are possible:
show() for now, show the xmlFile name
update(new_state)
write([xmlFile]) Method to write the BDP to an xml file
delete(basedir='', delfiles=True)
Method to delete the BDP. This method will search through all class variables

and delete any images since they contain external files, and then deletes the BDP’s xml file.

input: delfiles Whether or not to delete the actual files on disk (default is True)

It is recommended that any BDP that stores images inside of lists, dictionaries, tuples, etc. override this method with a customized version.

depends_on_(other)

deprecated

get(key)

access an attribute

getfiles()

return the filename(s) associated with the basic data in a BDP. @todo really should look for attribute .filename, but normally derived classes should implement these. see e.g. File_AT

haskey(key)

Query if a key exists for an AT. Returns True/False

isequal(bdp)
report()

report some properties, human readable.

setkey(name='', key={}, init=False)

set keys, two styles are possible:

  1. name = {key:val} e.g. setkey({“a”:1})
  2. name = “key”, key = val e.g. setkey(“a”,1)
show()

for now, show the xmlFile name

update(new_state)
write(xmlFile=None)

Method to write the BDP to an xml file Do not edit unless you know what you are doing as all BDP’s rely on this method to work properly Normally the xmlFile here should be the full path

Previous topic

BDP Package

This Page