dbprocessing.dbprocessing.ProcessQueue¶
- class dbprocessing.dbprocessing.ProcessQueue(mission, dryrun=False, echo=False)[source]¶
Main code used to process the Queue.
Looks in incoming and builds all possible files
Warning
As this object holds a reference to
DButils
, that database should be closed before the program terminates. Deleting this object will ordinarily suffice.Methods
buildChildren
(file_id[, debug, skip_run, ...])go through and all the runMe's and add to the runme_list variable
checkIncoming
([glb])Goes out to incoming and grabs all files there adding them to self.queue
diskfileToDB
(df)given a diskfile go through and do all the steps to add it into the db
figureProduct
([filename])Imports inspectors and figures out which inspectors claim the file
Import a file from incoming into the database
mk_tempdir
([suffix])create a secure temp directory
moveToError
(fname)Moves a file from incoming to error
Processes can be defined as output timebase "STARTUP" which means to run them each time to processing chain is run
reprocessByCode
(id_in[, startDate, endDate, ...])Add files made by a code to the queue for reprocessing.
reprocessByDate
([startDate, endDate, ...])Add files to the queue for reprocessing, by file date.
reprocessByInstrument
(id_in[, level, ...])Add files for an instrument to the queue for reprocessing
reprocessByProduct
(id_in[, startDate, ...])Add files of a particular product to the queue for reprocessing.
remove the temp directory
set_filename
(filename)Setter for filename, this is cleaner than just random sets
Attributes
- buildChildren(file_id, debug=False, skip_run=False, run_procs=None)[source]¶
go through and all the runMe’s and add to the runme_list variable
- checkIncoming(glb='*')[source]¶
Goes out to incoming and grabs all files there adding them to self.queue
- Parameters
- glb
str
, optional Glob pattern that files must match.
- glb
- diskfileToDB(df)[source]¶
given a diskfile go through and do all the steps to add it into the db
- Parameters
- df
Diskfile
File to add to database.
- df
- figureProduct(filename=None)[source]¶
Imports inspectors and figures out which inspectors claim the file
- moveToError(fname)[source]¶
Moves a file from incoming to error
- Parameters
- fname
str
Full path to file to move to error.
- fname
- onStartup()[source]¶
Processes can be defined as output timebase “STARTUP” which means to run them each time to processing chain is run
- reprocessByCode(id_in, startDate=None, endDate=None, incVersion=None)[source]¶
Add files made by a code to the queue for reprocessing.
- Parameters
- id_in
str
orint
ID or filename of code to reprocess
- startDate
datetime
, optional First date to reprocess (default all)
- endDate
datetime
, optional Last date to reprocess (default all)
- incVersion
int
{0, 1, 2}, optional Which version number to increment: major (0), minor (1), subminor (2). Forces reprocessing. (default do not force).
- id_in
- reprocessByDate(startDate=None, endDate=None, incVersion=None, level=None)[source]¶
Add files to the queue for reprocessing, by file date.
- Parameters
- startDate
datetime
, optional First date to reprocess (default all)
- endDate
datetime
, optional Last date to reprocess (default all)
- incVersion
int
{0, 1, 2}, optional Which version number to increment: major (0), minor (1), subminor (2). Forces reprocessing (default do not force).
- level
float
, optional Only reprocess files of this level (default all)
- startDate
- reprocessByInstrument(id_in, level=None, startDate=None, endDate=None, incVersion=None)[source]¶
Add files for an instrument to the queue for reprocessing
- Parameters
- id_in
str
orint
ID or name of instrument to reprocess
- level
int
, optional Only reprocess files of this level (default all)
- startDate
datetime
, optional First date to reprocess (default all)
- endDate
datetime
, optional Last date to reprocess (default all)
- incVersion
int
{0, 1, 2}, optional Which version number to increment: major (0), minor (1), subminor (2). Forces reprocessing (default do not force).
- id_in
- reprocessByProduct(id_in, startDate=None, endDate=None, incVersion=None)[source]¶
Add files of a particular product to the queue for reprocessing.
- Parameters
- id_in
str
orint
ID or name of code to reprocess
- startDate
datetime
, optional First date to reprocess (default all)
- endDate
datetime
, optional Last date to reprocess (default all)
- incVersion
int
{0, 1, 2}, optional Which version number to increment: major (0), minor (1), subminor (2). Forces reprocessing (default do not force).
- id_in
Release: 0.1.0 Doc generation date: Feb 10, 2022