338 lines
18 KiB
HTML
338 lines
18 KiB
HTML
|
<!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">
|
||
|
<html>
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type"
|
||
|
content="text/html; charset=iso-8859-1">
|
||
|
<meta name="GENERATOR"
|
||
|
content="Mozilla/4.8 [en] (X11; U; Linux 2.4.18-27.7.xsmp i686) [Netscape]">
|
||
|
<title>Text Products Reference</title>
|
||
|
<!--link REL="STYLESHEET" HREF="TextFormatter.html"-->
|
||
|
</head>
|
||
|
<body bgcolor="#ffffff">
|
||
|
<center><h1><a name="TroubleShooting"></a>TroubleShooting</h1></center>
|
||
|
|
||
|
<a href="#TroubleshootingStrategies">Trouble-shooting
|
||
|
Strategies</a> <br>
|
||
|
<a href="#ErrorMessages">Error Messages and
|
||
|
Solutions</a> <br>
|
||
|
<a href="#ProblemsSolutions">Problems and Solutions</a>
|
||
|
<hr>
|
||
|
<h2> <a name="TroubleshootingStrategies"></a>Trouble-shooting
|
||
|
Strategies</h2>
|
||
|
<b><font color="#000000">Strategy 1 -- "No Output": Nothing
|
||
|
happens when you run your product.</font></b>
|
||
|
<br>
|
||
|
<ol>
|
||
|
<li> <font color="#000000">Make sure you are running your product
|
||
|
locally.</font></li>
|
||
|
<li><font color="#000000">Check the Process Monitor for error
|
||
|
messages.</font></li>
|
||
|
<li> <font color="#000000">Check the <a href="#ErrorMessages">Error
|
||
|
Messages</a> section
|
||
|
below for your error.</font></li>
|
||
|
</ol>
|
||
|
<p><br>
|
||
|
<b>Strategy 2 -- "Baseline Problem": You are getting undesirable
|
||
|
results with the baseline formatter (no threshold or variable overrides
|
||
|
in the Overrides file).</b> </p>
|
||
|
<ol>
|
||
|
<li> If the problem is with a narrative phrase, check the Text
|
||
|
Rules Reference documentation to see if there are thresholds and
|
||
|
variables that you might set to produce desired results.</li>
|
||
|
<li>If not, send a message to the listserver including a
|
||
|
description of the problem and the desired results.</li>
|
||
|
</ol>
|
||
|
<b>Strategy 3 -- "Isolate Override": You are getting undesirable
|
||
|
results and you have overridden some thresholds or variables in your
|
||
|
Overrides file.</b>
|
||
|
<ol>
|
||
|
<li>Run the baseline version of the product to see if you get the
|
||
|
same results.</li>
|
||
|
<li>If so, see Strategy 2 above.</li>
|
||
|
<li>If not, comment out the overrides in your Overrides file and run
|
||
|
it
|
||
|
as the baseline.</li>
|
||
|
<li>Now begin adding in the overrides one-by-one until the problem
|
||
|
re-occurs.</li>
|
||
|
<li>That will give you a hint as to where the offending code might be.</li>
|
||
|
<li>If it's not clear at that point, include all this information in
|
||
|
a message to the Listserver.</li>
|
||
|
</ol>
|
||
|
<span style="font-weight: bold;">Strategy 4 -- "Infinite Loop or No
|
||
|
Words": For a particular edit area, you get the message: </span>
|
||
|
<br>
|
||
|
<span style="font-weight: bold;">
|
||
|
WARNING: TOO MANY PASSES ON TREE.</span> <br>
|
||
|
<span style="font-weight: bold;"> or</span>
|
||
|
<br>
|
||
|
<span style="font-weight: bold;">
|
||
|
WARNING: EMPTY WORDS FROM TREE.
|
||
|
<p></p>
|
||
|
</span>These problems are often data-dependent making it difficult to
|
||
|
reproduce especially at another site. Thus, you will have to
|
||
|
perform some detective work "on the spot" in order to isolate the
|
||
|
problem before seeking assistance from the support teams. In
|
||
|
these
|
||
|
situations, the narrative product is not completing as intended.
|
||
|
The multiple-pass processing has the potential of an infinite loop if
|
||
|
the logic is such that some method either does not return a "done"
|
||
|
status (e.g. return self.setWords() or self.DONE()) or does not set the
|
||
|
words for a phrase correctly. In either case, the strategy for
|
||
|
locating the problem is the same. We want to locate the offending
|
||
|
method, and turning on the "trace" flag will help us to see which
|
||
|
method
|
||
|
is being called repeatedly. However, before we turn on the
|
||
|
volumnious trace messages, we want to isolate the problem as much as
|
||
|
possible. We do this by isolating the edit area, time period, and
|
||
|
phrase method that are causing the trouble.
|
||
|
<ol>
|
||
|
<li> <span style="font-weight: bold;">Isolate the edit area for
|
||
|
which
|
||
|
there is a problem.</span> Run the product for that area ONLY by
|
||
|
altering
|
||
|
your Combinations file or the "defaultEditAreas" list.</li>
|
||
|
<li> <span style="font-weight: bold;">Isolate the time period for
|
||
|
which there is a problem. </span>Override the issuance_list for
|
||
|
the
|
||
|
product and comment out all periods except the first for the issuance
|
||
|
causing the problem. For example, if we are running the 10-503 ZFP and
|
||
|
getting a problem with the Morning issuance, we would comment out all
|
||
|
but Period_1 in the _10_503_issuance_list. (Be sure and copy the
|
||
|
entire issuance_list method into your Overrides file).</li>
|
||
|
<div style="margin-left: 40px;"> <br>
|
||
|
<span style="color: rgb(0, 102, 0);">def _10_503_issuance_list(self,
|
||
|
argDict):</span> <br>
|
||
|
<span style="color: rgb(0, 102, 0);">
|
||
|
narrativeDefAM = [</span> <br>
|
||
|
<span style="color: rgb(0, 102, 0);">
|
||
|
("Period_1", "period1"), </span> <br>
|
||
|
<span style="color: rgb(0, 102, 0);">
|
||
|
#("Period_2_3", 12), ("Period_2_3", 12), </span> <br>
|
||
|
<span style="color: rgb(0, 102, 0);">
|
||
|
#("Period_4_5", 12), ("Period_4_5", 12), </span> <br>
|
||
|
<span style="color: rgb(0, 102, 0);">
|
||
|
#("Period_6_14", 12), ("Period_6_14", 12), ("Period_6_14", 12),
|
||
|
("Period_6_14", 12), </span> <br>
|
||
|
<span style="color: rgb(0, 102, 0);">
|
||
|
#("Period_6_14", 12), ("Period_6_14", 12), ("Period_6_14", 12),
|
||
|
("Period_6_14", 12), </span> <br>
|
||
|
<span style="color: rgb(0, 102, 0);">
|
||
|
]</span> <br>
|
||
|
<span style="color: rgb(0, 102, 0);">
|
||
|
narrativeDefPM = [</span> <br>
|
||
|
<span style="color: rgb(0, 102, 0);">
|
||
|
("Period_1", "period1"),</span> <br>
|
||
|
<span style="color: rgb(0, 102, 0);">
|
||
|
("Period_2_3", 12), ("Period_2_3", 12), </span> <br>
|
||
|
<span style="color: rgb(0, 102, 0);">
|
||
|
("Period_4_5", 12), ("Period_4_5", 12), </span> <br>
|
||
|
<span style="color: rgb(0, 102, 0);">
|
||
|
("Period_6_14", 12), ("Period_6_14", 12), ("Period_6_14", 12),
|
||
|
("Period_6_14", 12), </span> <br>
|
||
|
<span style="color: rgb(0, 102, 0);">
|
||
|
("Period_6_14", 12), ("Period_6_14", 12), ("Period_6_14", 12),
|
||
|
("Period_6_14", 12), </span> <br>
|
||
|
<span style="color: rgb(0, 102, 0);">
|
||
|
("Period_6_14", 12),</span> <br>
|
||
|
<span style="color: rgb(0, 102, 0);">
|
||
|
]</span> <br>
|
||
|
<span style="color: rgb(0, 102, 0);"></span><br>
|
||
|
<span style="color: rgb(0, 102, 0);">
|
||
|
.....etc...</span><span style="color: rgb(0, 102, 0);"></span></div>
|
||
|
<span style="color: rgb(0, 0, 0);">Run the product for this time
|
||
|
period and see if you get the same error. If not, begin
|
||
|
uncommenting the periods one at a time until you get the error.
|
||
|
Of
|
||
|
course, the earlier the time period, the easier it will be to read the
|
||
|
trace. So for any components prior to the the one causing the
|
||
|
trouble, override the Product Component definition and remove all the
|
||
|
entries in the "analysisList" and "phraseList". For example, if
|
||
|
the problem does not occur until the third period of the Morning
|
||
|
issuance, remove the "analysisList" and "phraseList" entries for
|
||
|
the "Period_1" component:
|
||
|
<p><span style="color: rgb(0, 102, 0);">def Period_1(self):</span> <br>
|
||
|
<span style="color: rgb(0, 102, 0);">
|
||
|
component = { </span> <br>
|
||
|
<span style="color: rgb(0, 102, 0);">
|
||
|
"type": "component",</span> <br>
|
||
|
<span style="color: rgb(0, 102, 0);">
|
||
|
"methodList": [</span> <br>
|
||
|
<span style="color: rgb(0, 102, 0);">
|
||
|
self.assemblePhrases, </span> <br>
|
||
|
<span style="color: rgb(0, 102, 0);">
|
||
|
self.wordWrap, </span> <br>
|
||
|
<span style="color: rgb(0, 102, 0);">
|
||
|
],</span> <br>
|
||
|
<span style="color: rgb(0, 102, 0);">
|
||
|
"analysisList": [ </span> <br>
|
||
|
<span style="color: rgb(0, 102, 0);">
|
||
|
],</span> <br>
|
||
|
<span style="color: rgb(0, 102, 0);">
|
||
|
"phraseList":[ </span> <br>
|
||
|
<span style="color: rgb(0, 102, 0);">
|
||
|
],</span> <br>
|
||
|
<span style="color: rgb(0, 102, 0);"> }</span>
|
||
|
</p>
|
||
|
<p></p>
|
||
|
</span><li> <span style="font-weight: bold;">Isolate the phrase
|
||
|
method.</span> Determine which phrase is causing the problem by
|
||
|
overriding the product component for the time period causing the
|
||
|
trouble. Comment out all but the first phrase method and run the
|
||
|
product. If the problem does not occur, begin uncommenting each
|
||
|
phrase one-by-one running the product until you find which phrase is
|
||
|
causing the problem. Then comment out all but that phrase method
|
||
|
and run the product again to see that the problem occurs. In some
|
||
|
rare cases, you may have to uncomment more that one phrase to get the
|
||
|
problem to occur.)</li>
|
||
|
<li> <span style="font-weight: bold;">Check the offending phrase
|
||
|
method code. </span>Find the phrase "word" method in the Text
|
||
|
Rules
|
||
|
library (or your Overrides file if you have overridden or added
|
||
|
methods) and
|
||
|
ensure that all of it's return statements return either a <span
|
||
|
style="color: rgb(0, 102, 0);">self.DONE()</span> call or a <span
|
||
|
style="color: rgb(0, 102, 0);">self.setWords()</span>
|
||
|
call.
|
||
|
If not, correct the code and run your product again. If that was
|
||
|
not the problem, proceed to the next step.</li>
|
||
|
<li> <span style="font-weight: bold;">Turn on the trace messages.</span>
|
||
|
Now you can turn on the trace messages in your Overrides file by
|
||
|
setting
|
||
|
the 'Definition["trace"]' flag to 1. Re-run the product and
|
||
|
examine the end of the trace messages. You are looking for a
|
||
|
method that is repeating without returning a status of DONE as reported
|
||
|
in the message OR is continually returning 'None' for the value of
|
||
|
'Words' in the trace message. If you find the offending
|
||
|
method, you can begin to investigate why it is not completing. At
|
||
|
this point, you can submit this information to the listserver post for
|
||
|
more help.</li>
|
||
|
<li> <span style="font-weight: bold;">Check your overrides</span>.
|
||
|
You may want to try <span style="font-weight: bold;">Strategy 3</span>
|
||
|
(above) to see if the problem occurs with the baseline formatter.
|
||
|
If not, you will want to isolate which of your overrides introduces the
|
||
|
problem.</li>
|
||
|
</ol>
|
||
|
<h2> <a name="ErrorMessages"></a>Error Messages</h2>
|
||
|
Below are some common error messages and solutions.
|
||
|
<p>****************************** <br>
|
||
|
<b>Error message</b>: </p>
|
||
|
<p>Traceback (most recent call last): <br>
|
||
|
File "<string>", line 1, in ? <br>
|
||
|
File "/scratch/hansen/HEAD/GFESuite/headline/TextFormatter.py",
|
||
|
line 949, in profMain <br>
|
||
|
main2(arg) <br>
|
||
|
File "/scratch/hansen/HEAD/GFESuite/headline/TextFormatter.py",
|
||
|
line 890, in main2 <br>
|
||
|
forecast = formatter.getForecast(forecastType,
|
||
|
argDict) <br>
|
||
|
File "/scratch/hansen/HEAD/GFESuite/headline/TextFormatter.py",
|
||
|
line 154, in getForecast <br>
|
||
|
raise Exception, LogStream.exc() <br>
|
||
|
Exception: Traceback (most recent call last): <br>
|
||
|
File
|
||
|
"/scratch/hansen/HEAD/GFESuite/headline/TextFormatter.py", line 151, in
|
||
|
getForecast <br>
|
||
|
text = product.generateForecast(argDict) <br>
|
||
|
File "FWF", line 593, in generateForecast <br>
|
||
|
File "FWF", line 676, in _sampleData <br>
|
||
|
File
|
||
|
"/scratch/hansen/HEAD/GFESuite/headline/ForecastNarrative.py", line
|
||
|
467,
|
||
|
in getNarrativeData <br>
|
||
|
error = self.__breakOutDefinition(argDict,
|
||
|
narrativeDefinition, timeRange, areaList) <br>
|
||
|
File
|
||
|
"/scratch/hansen/HEAD/GFESuite/headline/ForecastNarrative.py", line
|
||
|
628,
|
||
|
in __breakOutDefinition <br>
|
||
|
editAreas = self.__intersectEditAreas(leAreaLabel,
|
||
|
argDict) <br>
|
||
|
File
|
||
|
"/scratch/hansen/HEAD/GFESuite/headline/ForecastNarrative.py", line
|
||
|
733,
|
||
|
in __intersectEditAreas <br>
|
||
|
leArea = self.findEditArea(None, leAreaLabel) <br>
|
||
|
File
|
||
|
"/scratch/hansen/HEAD/GFESuite/headline/ForecastNarrative.py", line
|
||
|
767,
|
||
|
in findEditArea <br>
|
||
|
editArea = self.getEditAreas(self.__argDict,
|
||
|
[areaLabel])[0] <br>
|
||
|
File "EditAreaUtils", line 82, in getEditAreas <br>
|
||
|
File
|
||
|
"/scratch/hansen/HEAD/GFESuite/libs/pyInter/AFPSSup.py", line 2283, in
|
||
|
getReferenceData <br>
|
||
|
def getReferenceData(*args): return
|
||
|
apply(_AFPSSup.IFPClient_getReferenceData,args) <br>
|
||
|
<font color="#000099">TypeError:
|
||
|
IFPClient::getReferenceData()failed : Unable to find reference data
|
||
|
[(BelowElev,P=0,A=0)]</font> </p>
|
||
|
<p><b>Solution:</b> </p>
|
||
|
<ul>
|
||
|
<li>The last line of the message tells us that we are missing an Edit
|
||
|
Area, "BelowElev".</li>
|
||
|
<li>Read the documentation in the standard product file to see if
|
||
|
there are any required edit areas that you are missing. This
|
||
|
information will be inthe "EditAreas Needed" section.</li>
|
||
|
</ul>
|
||
|
****************************** <br>
|
||
|
<b>Error message</b>:
|
||
|
<p>Problem importing module: CWFPeriod-- <br>
|
||
|
Traceback (innermost last): <br>
|
||
|
File "imputil.py", line 106, in _import_hook <br>
|
||
|
<font color="#000099">ImportError: No module named CWFPeriod</font> </p>
|
||
|
<p><b>Solution:</b> </p>
|
||
|
<blockquote><li> Find the offending Product Component (in this case
|
||
|
CWFPeriod in the Overrides file)</li>
|
||
|
<li>Try commenting out sections within the product component (e.g.
|
||
|
CWFPeriod) until you do not get the error.</li>
|
||
|
<li>Incrementally comment lines back in to find which line is the
|
||
|
offender.</li>
|
||
|
</blockquote>
|
||
|
******************************<br>
|
||
|
<br>
|
||
|
<b>Error message</b>:
|
||
|
<pre wrap="">Traceback (most recent call last):<br> File "<string>", line 1, in ?<br> File "TextFormatter.py", line 949, in profMain<br> File "TextFormatter.py", line 890, in main2<br> File "TextFormatter.py", line 154, in getForecast<br>Exception: Traceback (most recent call last):<br> File "TextFormatter.py", line 151, in getForecast<br> File "AreaFcst", line 759, in generateForecast<br> File "AreaFcst", line 881, in _makeProduct<br> File "ForecastNarrative.py", line 523, in generateForecast<br> File "ForecastNarrative.py", line 563, in traverseTree<br> File "ForecastNarrative.py", line 563, in traverseTree<br> File "ForecastNarrative.py", line 544, in traverseTree<br> File "PhraseBuilder", line 830, in consolidatePhrase<br> File "PhraseBuilder", line 691, in checkForDifferences<br> File "PhraseBuilder", line 739, in checkScalarDifference<br> File "ConfigVariables", line 517, in <span
|
||
|
style="color: rgb(0, 0, 153); font-weight: bold;">scalar_difference_nlValue</span><br> File "TextUtils", line 177, in access_dictionary<br> <span
|
||
|
style="color: rgb(0, 0, 153); font-weight: bold;">AttributeError: 'NoneType' object has no attribute 'has_key'</span></pre>
|
||
|
<p style="font-weight: bold;"><font color="#000099"></font></p>
|
||
|
<p><b>Solution:</b> </p>
|
||
|
<ul>
|
||
|
<li>Notice the "scalar_difference_nlValue" reference in the
|
||
|
Traceback. Look for a similar variable in your traceback.</li>
|
||
|
<li>Check your Overrides file for this dictionary e.g.
|
||
|
"scalar_difference_nlValue_dict" and make sure it is returning the
|
||
|
dictionary properly. For example:</li>
|
||
|
</ul>
|
||
|
def scalar_difference_nlValue_dict(self, tree,
|
||
|
node): <br>
|
||
|
# Scalar difference.
|
||
|
If the difference between scalar values <br>
|
||
|
# for 2 sub-periods is
|
||
|
greater than or equal to this value, <br>
|
||
|
# the different values will
|
||
|
be noted in the phrase. <br>
|
||
|
dict =
|
||
|
TextRules.TextRules.scalar_difference_nlValue_dict(self, tree, node) <br>
|
||
|
dict["WindGust"] = 10 #
|
||
|
knots or mph depending on product <br>
|
||
|
dict["Period"] = 5 # seconds
|
||
|
<br>
|
||
|
dict["PoP"] = 10 #
|
||
|
percentage <br>
|
||
|
--> return dict <br>
|
||
|
<br>
|
||
|
<br>
|
||
|
<br>
|
||
|
******************************<br>
|
||
|
<h2><a name="ProblemsSolutions"></a>Problems/Solutions</h2>
|
||
|
<span style="font-weight: bold;">Problem:</span> <br>
|
||
|
"minimum_range" or "maximum_range" is not taking effect.
|
||
|
<p><span style="font-weight: bold;">Solution:</span> <br>
|
||
|
Check to to see if a "range_nlValue" is being set for this weather
|
||
|
element either in the Overrides file, Standard file, or in
|
||
|
ConfigVariables. The range_nlValue supercedes the other ranges
|
||
|
and
|
||
|
should be set to zero in order to apply minimum or maximum ranges. <br>
|
||
|
</p>
|