pipeline.infrastructure.renderer package¶
Subpackages¶
Submodules¶
pipeline.infrastructure.renderer.basetemplates module¶
Created on 8 Sep 2014
@author: sjw
-
class
pipeline.infrastructure.renderer.basetemplates.
CommonRenderer
(uri, context, result)[source]¶ Bases:
object
-
class
pipeline.infrastructure.renderer.basetemplates.
JsonPlotRenderer
(uri, context, result, plots, title, outfile)[source]¶ Bases:
pipeline.infrastructure.renderer.basetemplates.CommonRenderer
-
class
pipeline.infrastructure.renderer.basetemplates.
T2_4MDetailsDefaultRenderer
(uri='t2-4m_details-generic.mako', description='No description set for this task', always_rerender=False)[source]¶ Bases:
object
-
class
pipeline.infrastructure.renderer.basetemplates.
T2_4MDetailsFailedTaskRenderer
(uri='t2-4m_details-failed.mako', description='Failed task', always_rerender=False)[source]¶ Bases:
pipeline.infrastructure.renderer.basetemplates.T2_4MDetailsDefaultRenderer
Renders detailed HTML output for a failed task.
pipeline.infrastructure.renderer.htmlrenderer module¶
-
class
pipeline.infrastructure.renderer.htmlrenderer.
LogCopier
[source]¶ Bases:
object
LogCopier copies and handles the CASA logs so that they may be referenced by the pipeline web logs.
Capturing the CASA log gives us a few problems: The previous log is renamed upon starting a new session. To be reliably referenced from the web log, we must give it an immutable name and copy it to a safe location within the web log directory.
The user may want to view the web log at any time during a pipeline session. To avoid broken links to the CASA log, the log should be copied across to the web log location at the end of each task.
Pipeline sessions may be interrupted and restored, resulting in multiple CASA logs for such sessions. These logs must be consolidated into one file alongside any previous log information.
Adding HTML tags such as ‘<pre>’ and HTML anchors causes the CASA log reader to render such entries as empty entries at the bottom of the log. The result is that you must scroll up to find the last log entry. To prevent this, we need to output anchors as CASA log comments, possibly timestamps, and then use javascript to navigate to the log location.
-
class
pipeline.infrastructure.renderer.htmlrenderer.
MetadataRendererBase
[source]¶ Bases:
pipeline.infrastructure.renderer.htmlrenderer.RendererBase
-
class
pipeline.infrastructure.renderer.htmlrenderer.
MsgTableRow
(stage, task, type, message, target)¶ Bases:
tuple
-
property
message
¶ Alias for field number 3
-
property
stage
¶ Alias for field number 0
-
property
target
¶ Alias for field number 4
-
property
task
¶ Alias for field number 1
-
property
type
¶ Alias for field number 2
-
property
-
class
pipeline.infrastructure.renderer.htmlrenderer.
RendererBase
[source]¶ Bases:
object
Base renderer class.
-
class
pipeline.infrastructure.renderer.htmlrenderer.
Session
(mses=None, name='Unnamed Session')[source]¶ Bases:
object
-
class
pipeline.infrastructure.renderer.htmlrenderer.
T1_1Renderer
[source]¶ Bases:
pipeline.infrastructure.renderer.htmlrenderer.RendererBase
T1-1 OUS Splash Page renderer
-
class
EnvironmentTableRow
(hostname, num_mpi_servers, num_cores, cpu, ram, os, ulimit)¶ Bases:
tuple
-
property
cpu
¶ Alias for field number 3
-
property
hostname
¶ Alias for field number 0
-
property
num_cores
¶ Alias for field number 2
-
property
num_mpi_servers
¶ Alias for field number 1
-
property
os
¶ Alias for field number 5
-
property
ram
¶ Alias for field number 4
-
property
ulimit
¶ Alias for field number 6
-
property
-
TableRow
¶ alias of
Tablerow
-
TableRowNRO
¶ alias of
TablerowNRO
-
output_file
= 't1-1.html'¶
-
template
= 't1-1.mako'¶
-
class
-
class
pipeline.infrastructure.renderer.htmlrenderer.
T1_2Renderer
[source]¶ Bases:
pipeline.infrastructure.renderer.htmlrenderer.RendererBase
T1-2 Observation Summary renderer
-
TableRow
¶ alias of
Tablerow
-
output_file
= 't1-2.html'¶
-
template
= 't1-2.mako'¶
-
-
class
pipeline.infrastructure.renderer.htmlrenderer.
T1_3MRenderer
[source]¶ Bases:
pipeline.infrastructure.renderer.htmlrenderer.RendererBase
T1-3M renderer
-
class
MsgTableRow
(stage, task, type, message, target)¶ Bases:
tuple
-
property
message
¶ Alias for field number 3
-
property
stage
¶ Alias for field number 0
-
property
target
¶ Alias for field number 4
-
property
task
¶ Alias for field number 1
-
property
type
¶ Alias for field number 2
-
property
-
output_file
= 't1-3.html'¶
-
template
= 't1-3m.mako'¶
-
class
-
class
pipeline.infrastructure.renderer.htmlrenderer.
T1_4MRenderer
[source]¶ Bases:
pipeline.infrastructure.renderer.htmlrenderer.RendererBase
T1-4M renderer
-
output_file
= 't1-4.html'¶
-
template
= 't1-4m.mako'¶
-
-
class
pipeline.infrastructure.renderer.htmlrenderer.
T2_1DetailsRenderer
[source]¶ Bases:
object
-
output_file
= 't2-1_details.html'¶
-
template
= 't2-1_details.mako'¶
-
-
class
pipeline.infrastructure.renderer.htmlrenderer.
T2_1Renderer
[source]¶ Bases:
pipeline.infrastructure.renderer.htmlrenderer.RendererBase
T2-4M renderer
-
output_file
= 't2-1.html'¶
-
template
= 't2-1.mako'¶
-
-
class
pipeline.infrastructure.renderer.htmlrenderer.
T2_2_1Renderer
[source]¶ Bases:
pipeline.infrastructure.renderer.htmlrenderer.T2_2_XRendererBase
T2-2-1 renderer - spatial setup
-
output_file
= 't2-2-1.html'¶
-
template
= 't2-2-1.mako'¶
-
-
class
pipeline.infrastructure.renderer.htmlrenderer.
T2_2_2Renderer
[source]¶ Bases:
pipeline.infrastructure.renderer.htmlrenderer.T2_2_XRendererBase
T2-2-2 renderer
-
output_file
= 't2-2-2.html'¶
-
template
= 't2-2-2.mako'¶
-
-
class
pipeline.infrastructure.renderer.htmlrenderer.
T2_2_3Renderer
[source]¶ Bases:
pipeline.infrastructure.renderer.htmlrenderer.T2_2_XRendererBase
T2-2-3 renderer
-
output_file
= 't2-2-3.html'¶
-
template
= 't2-2-3.mako'¶
-
-
class
pipeline.infrastructure.renderer.htmlrenderer.
T2_2_4Renderer
[source]¶ Bases:
pipeline.infrastructure.renderer.htmlrenderer.T2_2_XRendererBase
T2-2-4 renderer
-
output_file
= 't2-2-4.html'¶
-
template
= 't2-2-4.mako'¶
-
-
class
pipeline.infrastructure.renderer.htmlrenderer.
T2_2_5Renderer
[source]¶ Bases:
pipeline.infrastructure.renderer.htmlrenderer.T2_2_XRendererBase
T2-2-5 renderer - weather page
-
output_file
= 't2-2-5.html'¶
-
template
= 't2-2-5.mako'¶
-
-
class
pipeline.infrastructure.renderer.htmlrenderer.
T2_2_6Renderer
[source]¶ Bases:
pipeline.infrastructure.renderer.htmlrenderer.T2_2_XRendererBase
T2-2-6 renderer - scans page
-
class
TableRow
(id, time_start, time_end, duration, intents, fields, spws)¶ Bases:
tuple
-
property
duration
¶ Alias for field number 3
-
property
fields
¶ Alias for field number 5
-
property
id
¶ Alias for field number 0
-
property
intents
¶ Alias for field number 4
-
property
spws
¶ Alias for field number 6
-
property
time_end
¶ Alias for field number 2
-
property
time_start
¶ Alias for field number 1
-
property
-
output_file
= 't2-2-6.html'¶
-
template
= 't2-2-6.mako'¶
-
class
-
class
pipeline.infrastructure.renderer.htmlrenderer.
T2_2_7Renderer
[source]¶ Bases:
pipeline.infrastructure.renderer.htmlrenderer.T2_2_XRendererBase
T2-2-7 renderer (single dish specific)
-
output_file
= 't2-2-7.html'¶
-
template
= 't2-2-7.mako'¶
-
-
class
pipeline.infrastructure.renderer.htmlrenderer.
T2_2_XRendererBase
[source]¶ Bases:
object
Base renderer for T2-2-X series of pages.
-
class
pipeline.infrastructure.renderer.htmlrenderer.
T2_3_1MRenderer
[source]¶ Bases:
pipeline.infrastructure.renderer.htmlrenderer.T2_3_XMBaseRenderer
Renderer for T2-3-1M, the data set topic.
-
output_file
= 't2-3-1m.html'¶
-
template
= 't2-3-1m.mako'¶
-
-
class
pipeline.infrastructure.renderer.htmlrenderer.
T2_3_2MRenderer
[source]¶ Bases:
pipeline.infrastructure.renderer.htmlrenderer.T2_3_XMBaseRenderer
Renderer for T2-3-2M: the QA calibration section.
-
output_file
= 't2-3-2m.html'¶
-
template
= 't2-3-2m.mako'¶
-
-
class
pipeline.infrastructure.renderer.htmlrenderer.
T2_3_3MRenderer
[source]¶ Bases:
pipeline.infrastructure.renderer.htmlrenderer.T2_3_XMBaseRenderer
Renderer for T2-3-3M: the QA flagging section.
-
output_file
= 't2-3-3m.html'¶
-
template
= 't2-3-3m.mako'¶
-
-
class
pipeline.infrastructure.renderer.htmlrenderer.
T2_3_4MRenderer
[source]¶ Bases:
pipeline.infrastructure.renderer.htmlrenderer.T2_3_XMBaseRenderer
Renderer for T2-3-4M: the QA line finding section.
-
output_file
= 't2-3-4m.html'¶
-
template
= 't2-3-4m.mako'¶
-
-
class
pipeline.infrastructure.renderer.htmlrenderer.
T2_3_5MRenderer
[source]¶ Bases:
pipeline.infrastructure.renderer.htmlrenderer.T2_3_XMBaseRenderer
Renderer for T2-3-5M: the imaging topic
-
output_file
= 't2-3-5m.html'¶
-
template
= 't2-3-5m.mako'¶
-
-
class
pipeline.infrastructure.renderer.htmlrenderer.
T2_3_6MRenderer
[source]¶ Bases:
pipeline.infrastructure.renderer.htmlrenderer.T2_3_XMBaseRenderer
Renderer for T2-3-6M: the miscellaneous topic
-
output_file
= 't2-3-6m.html'¶
-
template
= 't2-3-6m.mako'¶
-
-
class
pipeline.infrastructure.renderer.htmlrenderer.
T2_3_XMBaseRenderer
[source]¶ Bases:
pipeline.infrastructure.renderer.htmlrenderer.RendererBase
-
output_file
= 'overrideme'¶
-
template
= 'overrideme'¶
-
-
class
pipeline.infrastructure.renderer.htmlrenderer.
T2_4MDetailsContainerRenderer
[source]¶ Bases:
pipeline.infrastructure.renderer.htmlrenderer.RendererBase
-
output_file
= 't2-4m_details-container.html'¶
-
template
= 't2-4m_details-container.mako'¶
-
-
class
pipeline.infrastructure.renderer.htmlrenderer.
T2_4MDetailsDefaultRenderer
(template='t2-4m_details-generic.mako', always_rerender=False)[source]¶ Bases:
object
-
class
pipeline.infrastructure.renderer.htmlrenderer.
T2_4MDetailsRenderer
[source]¶ Bases:
object
-
output_file
= 't2-4m_details.html'¶
-
-
class
pipeline.infrastructure.renderer.htmlrenderer.
T2_4MRenderer
[source]¶ Bases:
pipeline.infrastructure.renderer.htmlrenderer.RendererBase
T2-4M renderer
-
output_file
= 't2-4m.html'¶
-
template
= 't2-4m.mako'¶
-
-
class
pipeline.infrastructure.renderer.htmlrenderer.
WebLogGenerator
[source]¶ Bases:
object
-
renderers
= [<class 'pipeline.infrastructure.renderer.htmlrenderer.T1_1Renderer'>, <class 'pipeline.infrastructure.renderer.htmlrenderer.T1_2Renderer'>, <class 'pipeline.infrastructure.renderer.htmlrenderer.T1_3MRenderer'>, <class 'pipeline.infrastructure.renderer.htmlrenderer.T2_1Renderer'>, <class 'pipeline.infrastructure.renderer.htmlrenderer.T2_1DetailsRenderer'>, <class 'pipeline.infrastructure.renderer.htmlrenderer.T2_2_1Renderer'>, <class 'pipeline.infrastructure.renderer.htmlrenderer.T2_2_2Renderer'>, <class 'pipeline.infrastructure.renderer.htmlrenderer.T2_2_3Renderer'>, <class 'pipeline.infrastructure.renderer.htmlrenderer.T2_2_4Renderer'>, <class 'pipeline.infrastructure.renderer.htmlrenderer.T2_2_6Renderer'>, <class 'pipeline.infrastructure.renderer.htmlrenderer.T2_2_7Renderer'>, <class 'pipeline.infrastructure.renderer.htmlrenderer.T2_3_1MRenderer'>, <class 'pipeline.infrastructure.renderer.htmlrenderer.T2_3_2MRenderer'>, <class 'pipeline.infrastructure.renderer.htmlrenderer.T2_3_3MRenderer'>, <class 'pipeline.infrastructure.renderer.htmlrenderer.T2_3_5MRenderer'>, <class 'pipeline.infrastructure.renderer.htmlrenderer.T2_3_6MRenderer'>, <class 'pipeline.infrastructure.renderer.htmlrenderer.T2_4MRenderer'>, <class 'pipeline.infrastructure.renderer.htmlrenderer.T2_4MDetailsRenderer'>, <class 'pipeline.infrastructure.renderer.htmlrenderer.T1_4MRenderer'>]¶
-
-
pipeline.infrastructure.renderer.htmlrenderer.
compute_az_el_to_field
(field, epoch, observatory)[source]¶
-
pipeline.infrastructure.renderer.htmlrenderer.
create_tablerow
(results, message: str, msgtype: str, target='') → pipeline.infrastructure.renderer.htmlrenderer.MsgTableRow[source]¶ Create a table entry struct from a web log message.
-
pipeline.infrastructure.renderer.htmlrenderer.
filter_qascores
(results_list, lo: float, hi: float) → List[pipeline.infrastructure.pipelineqa.QAScore][source]¶
-
pipeline.infrastructure.renderer.htmlrenderer.
get_ms_attr_for_result
(context, vis, accessor)[source]¶
-
pipeline.infrastructure.renderer.htmlrenderer.
get_ms_start_time_for_result
(context, result)[source]¶
-
pipeline.infrastructure.renderer.htmlrenderer.
get_task_description
(result_obj, context, include_stage=True)[source]¶
-
pipeline.infrastructure.renderer.htmlrenderer.
get_task_name
(result_obj, include_stage=True)[source]¶
-
pipeline.infrastructure.renderer.htmlrenderer.
group_into_measurement_sets
(context, task_results)[source]¶
-
pipeline.infrastructure.renderer.htmlrenderer.
group_into_sessions
(context, task_results)[source]¶ Return results grouped into lists by session.
-
pipeline.infrastructure.renderer.htmlrenderer.
logrecords_to_tablerows
(records, results, msgtype='ERROR') → List[pipeline.infrastructure.renderer.htmlrenderer.MsgTableRow][source]¶ Convert a list of LogRecords to a list of table entries, ready for insertion into a Mako template.
-
pipeline.infrastructure.renderer.htmlrenderer.
qascores_to_tablerows
(qascores: List[pipeline.infrastructure.pipelineqa.QAScore], results, msgtype: str = 'ERROR') → List[pipeline.infrastructure.renderer.htmlrenderer.MsgTableRow][source]¶ Convert a list of QAScores to a list of table entries, ready for insertion into a Mako template.
-
pipeline.infrastructure.renderer.htmlrenderer.
scan_has_intent
(scans, intent)[source]¶ Returns True if the list of scans includes a specified intent
pipeline.infrastructure.renderer.logger module¶
-
class
pipeline.infrastructure.renderer.logger.
Parameters
[source]¶ Bases:
object
Provides a set of utility functions that describe how the plot parameters given as keys of the optional parameters dictionary given to Plot() should be interpreted.
-
css_ids
= {'ant': 'ant', 'chnl': 'chnl', 'field': 'field', 'file': 'file', 'intent': 'intent', 'map': 'map', 'pol': 'pol', 'solint': 'solint', 'spw': 'spw', 'type': 'type', 'vis': 'vis'}¶
-
descriptions
= {'ant': 'Antenna', 'chnl': 'Channels', 'field': 'Field', 'file': 'File', 'intent': 'Intent', 'map': 'Map', 'pol': 'Polarisation', 'solint': 'Solution Interval', 'spw': 'Spectral Window', 'type': 'Type', 'vis': 'Measurement Set'}¶
-
-
class
pipeline.infrastructure.renderer.logger.
Plot
(filename, x_axis='Unknown', y_axis='Unknown', field=None, parameters=None, qa_score=None, command=None)[source]¶ Bases:
object
-
property
css_class
¶ The CSS class to be used for this plot.
-
property
thumbnail
¶
-
property
title
¶ title -> string
Construct and return a meaningful plot title using the internal state (axis names, parameter names etc.) of this plot.
-
property
-
class
pipeline.infrastructure.renderer.logger.
PlotGroup
(plots=[])[source]¶ Bases:
object
-
static
create_plot_groups
(plots=[])[source]¶ Returns a list of PlotGroups, each containing a series of plots with the same axes.
-
full_template
= <string.Template object>¶
-
static
numericalSort
(selector)[source]¶ Sorts strings numerically, eg. [b13, a2, a10] -> [a2, a10, b13]
Based on Recipe 5.5 from Python Cookbook 2nd Edition.
-
selector_template
= <string.Template object>¶
-
property
selectors
¶
-
property
thumbnails
¶
-
property
title
¶
-
property
x_axis
¶
-
property
y_axis
¶
-
static
-
pipeline.infrastructure.renderer.logger.
THUMBNAIL_CMD
(full, thumb)¶
pipeline.infrastructure.renderer.qaadapter module¶
The qaadapter module holds classes that regroup the results list, ordered by stage number, into a structure ordered by task type. This regrouping is used by the QA sections of the weblog.
-
class
pipeline.infrastructure.renderer.qaadapter.
CalibrationTopic
[source]¶ Bases:
pipeline.infrastructure.renderer.qaadapter.Topic
CalibrationTopic collects together those results generated by calibration tasks.
-
class
pipeline.infrastructure.renderer.qaadapter.
DataSetTopic
[source]¶ Bases:
pipeline.infrastructure.renderer.qaadapter.Topic
DataSetTopic collects together those results generated by data set handling tasks.
-
class
pipeline.infrastructure.renderer.qaadapter.
FlaggingTopic
[source]¶ Bases:
pipeline.infrastructure.renderer.qaadapter.Topic
FlaggingTopic collects together those results generated by flagging tasks.
-
class
pipeline.infrastructure.renderer.qaadapter.
ImagingTopic
[source]¶ Bases:
pipeline.infrastructure.renderer.qaadapter.Topic
ImagingTopic collects together those results generated by imaging tasks.
-
class
pipeline.infrastructure.renderer.qaadapter.
LineFindingTopic
[source]¶ Bases:
pipeline.infrastructure.renderer.qaadapter.Topic
LineFindingTopic collects together those results generated by line-finding tasks.
-
class
pipeline.infrastructure.renderer.qaadapter.
MiscellaneousTopic
[source]¶ Bases:
pipeline.infrastructure.renderer.qaadapter.Topic
MiscellaneousTopic collects together those results generated by miscellaneous tasks that don’t belong in any other category.
-
class
pipeline.infrastructure.renderer.qaadapter.
QABaseAdapter
(context, result)[source]¶ Bases:
object
-
class
pipeline.infrastructure.renderer.qaadapter.
Topic
(url, description)[source]¶ Bases:
object
Topic is the base class for a Topic web log section. It should not be instantiated directly.
-
assign_to_topics
(results)[source]¶ Allocating Results to the appropriate task type based on the Results classes registered to this Topic.
- Parameters
results (a list of
Result
) – the results
-
-
class
pipeline.infrastructure.renderer.qaadapter.
TopicRegistry
[source]¶ Bases:
object
-
get_url
(result)[source]¶ Get the URL of the QA section appropriate to the given result.
- Parameters
result (
Result
) – the task result- Return type
the filename of the appropriate QA section
-
topic_classes
= [<class 'pipeline.infrastructure.renderer.qaadapter.DataSetTopic'>, <class 'pipeline.infrastructure.renderer.qaadapter.CalibrationTopic'>, <class 'pipeline.infrastructure.renderer.qaadapter.FlaggingTopic'>, <class 'pipeline.infrastructure.renderer.qaadapter.LineFindingTopic'>, <class 'pipeline.infrastructure.renderer.qaadapter.ImagingTopic'>, <class 'pipeline.infrastructure.renderer.qaadapter.MiscellaneousTopic'>]¶
-
pipeline.infrastructure.renderer.registry module¶
Created on 2 Nov 2018
@author: sjw
-
class
pipeline.infrastructure.renderer.registry.
RendererRegistry
[source]¶ Bases:
object
-
add_renderer
(task_cls, renderer, key_fn=None, key=None)[source]¶ Register a renderer to be used to generate HTML for results from a given task.
There are two modes of registration:
registration of a context-specific renderer
registration of a universal renderer, which wil be used if no context-specific renderer is found
Context-specific renderers are registered by supplying key and key_fn arguments. key_fn should be a function that accepts a context and returns a key from it. This key is used to look up the renderer. Specifying a key value of ‘X’ says ‘this renderer should be used for this task if this key_fn returns ‘X’ for this context’.
- Parameters
task_cls – the target pipeline Task class
renderer – the renderer to use for the task
key – optional key to retrieve this renderer by
key_fn – optional function that accepts a pipeline context and returns the renderer key
- Returns
-
get_renderer
(cls, context, result)[source]¶ Get the registered renderer for a class.
The pipeline context argument may be passed to a registered function that returns the key for the given context.
- Parameters
cls – the class to look up
context – pipeline context
result – pipeline task result
- Returns
registered renderer class, or KeyError if no renderer was registered
-
pipeline.infrastructure.renderer.regression module¶
The regression module contains base classes and plugin registry for the pipeline’s regression test value extractor framework.
This module contains two classes:
RegressionExtractor: the base class for extractor plug-ins
RegressionExtractorRegistry: the registry and manager for plug-ins
Tasks provide and register their own extractors that each extends RegressionExtractor. These extractor plug-ins analyse the results of a task, extracting pertinent values and writing them to a dict. The keys of the output dict identify the value; the values of the dict are the extracted values themselves.
The pipeline QA framework is activated whenever a Results instance is accepted into the pipeline context. The pipeline QA framework operates by calling is_handler_for(result) on each registered QAPlugin, passing it the the accepted Results instance for inspection. QAPlugins that claim to handle the Result are given the Result for processing. In this step, the QA framework calls QAPlugin.handle(context, result), the method overridden by the task-specific QAPlugin.
-
class
pipeline.infrastructure.renderer.regression.
ApplycalRegressionExtractor
[source]¶ Bases:
pipeline.infrastructure.renderer.regression.RegressionExtractor
Regression test result extractor for applycal tasks.
-
child_cls
= None¶
-
generating_task
¶
-
handle
(result)[source]¶ This method should return a dict of
- {‘applycal.new_flags.science’: 0.34,
‘applycal.new_flags.bandpass’: 0.53}
- Parameters
result –
- Returns
-
result_cls
¶
-
-
class
pipeline.infrastructure.renderer.regression.
FluxcalflagRegressionExtractor
[source]¶ Bases:
pipeline.infrastructure.renderer.regression.RegressionExtractor
Regression test result extractor for hifa_gfluxscaleflag.
- The extracted values are:
the number of flagged rows before this task
the number of flagged rows after this task
-
child_cls
= None¶
-
handle
(result)[source]¶ This method should return a dict of
- {‘applycal.new_flags.science’: 0.34,
‘applycal.new_flags.bandpass’: 0.53}
- Parameters
result –
- Returns
-
result_cls
¶ alias of
pipeline.hifa.tasks.gfluxscaleflag.resultobjects.GfluxscaleflagResults
-
class
pipeline.infrastructure.renderer.regression.
GcorFluxscaleRegressionExtractor
[source]¶ Bases:
pipeline.infrastructure.renderer.regression.RegressionExtractor
Regression test result extractor for hifa_gcorfluxscale
- The extracted values are:
Stokes I for each field and spw, in Jy
-
child_cls
= None¶
-
generating_task
¶ alias of
pipeline.hifa.tasks.fluxscale.gcorfluxscale.GcorFluxscale
-
handle
(result)[source]¶ This method should return a dict of
- {‘applycal.new_flags.science’: 0.34,
‘applycal.new_flags.bandpass’: 0.53}
- Parameters
result –
- Returns
-
result_cls
¶ alias of
pipeline.h.tasks.common.commonfluxresults.FluxCalibrationResults
-
class
pipeline.infrastructure.renderer.regression.
RegressionExtractor
[source]¶ Bases:
object
RegressionExtractor is the mandatory base class for all regression test result extractors.
-
child_cls
= None¶
-
generating_task
= None¶
-
abstract
handle
(result) → Dict[str, float][source]¶ This method should return a dict of
- {‘applycal.new_flags.science’: 0.34,
‘applycal.new_flags.bandpass’: 0.53}
- Parameters
result –
- Returns
-
is_handler_for
(result)[source]¶ Return True if this RegressionExtractor can process the Result.
- Parameters
result – the task Result to inspect
- Returns
True if the Result can be processed
-
result_cls
= None¶
-
-
class
pipeline.infrastructure.renderer.regression.
RegressionExtractorRegistry
[source]¶ Bases:
object
The registry and manager of the regression result extractor framework.
The responsibility of the RegressionResultRegistry is to pass Results to RegressionExtractors that can handle them.
pipeline.infrastructure.renderer.rendererutils module¶
-
pipeline.infrastructure.renderer.rendererutils.
format_notification
(tr_class, alert, msg, icon_class=None)[source]¶
-
pipeline.infrastructure.renderer.rendererutils.
get_notification_trs
(result, alerts_info, alerts_success)[source]¶
-
pipeline.infrastructure.renderer.rendererutils.
num_lines
(abspath)[source]¶ Report number of non-empty non-comment lines in a file specified by abspath. If the file does not exist, report N/A.
-
pipeline.infrastructure.renderer.rendererutils.
printTsysFlags
(tsystable, htmlreport)[source]¶ Method that implements a version of printTsysFlags by Todd Hunter.
-
pipeline.infrastructure.renderer.rendererutils.
renderflagcmds
(flagcmds, htmlflagcmds)[source]¶ Method to render a list of flagcmds into html format.
-
pipeline.infrastructure.renderer.rendererutils.
scores_in_range
(pool: List[pipeline.infrastructure.pipelineqa.QAScore], lo: float, hi: float) → List[pipeline.infrastructure.pipelineqa.QAScore][source]¶ Filter QA scores by range.
-
pipeline.infrastructure.renderer.rendererutils.
scores_with_location
(pool: List[pipeline.infrastructure.pipelineqa.QAScore], locations: Optional[List[pipeline.infrastructure.pipelineqa.WebLogLocation]] = None) → List[pipeline.infrastructure.pipelineqa.QAScore][source]¶ Filter QA scores by web log location.
pipeline.infrastructure.renderer.weblog module¶
Created on 8 Sep 2014
@author: sjw
-
class
pipeline.infrastructure.renderer.weblog.
WebLogRendererRegistry
[source]¶ Bases:
pipeline.infrastructure.renderer.registry.RendererRegistry
-
add_renderer
(task_cls, renderer, group_by=None, key_fn=None, key=None)[source]¶ Register a renderer to be used to generate HTML for results from a given task.
There are two modes of registration:
registration of a context-specific renderer
registration of a universal renderer, which wil be used if no context-specific renderer is found
Context-specific renderers are registered by supplying key and key_fn arguments. key_fn should be a function that accepts a context and returns a key from it. This key is used to look up the renderer. Specifying a key value of ‘X’ says ‘this renderer should be used for this task if this key_fn returns ‘X’ for this context’.
- Parameters
task_cls – the target pipeline Task class
renderer – the renderer to use for the task
group_by – grouping directive - either “session” or “ungrouped”
key – optional key to retrieve this renderer by
key_fn – optional function that accepts a pipeline context and returns the renderer key
- Returns
-
-
pipeline.infrastructure.renderer.weblog.
register_mako_templates
(directory, prefix='')[source]¶ Find Mako templates in the given directory, registering them to the module template lookup. Templates will be registered to a URI composed of the URI prefix argument (optional) plus the template filename, minus filename extension.
For example, a call with prefix=’hif’ finding a file called ‘importdata.mako’ would register the template to the Mako URI ‘hif/importdata’.