<html>#2939: AHFinderDirect: range options for track_origin_source_x/y/z
<table style='border-spacing: 1ex 0pt; '>
<tr><td style='text-align:right'> Reporter:</td><td>Jordan Nicoules</td></tr>
<tr><td style='text-align:right'> Status:</td><td>new</td></tr>
<tr><td style='text-align:right'>Milestone:</td><td></td></tr>
<tr><td style='text-align:right'> Version:</td><td></td></tr>
<tr><td style='text-align:right'> Type:</td><td>bug</td></tr>
<tr><td style='text-align:right'> Priority:</td><td>minor</td></tr>
<tr><td style='text-align:right'>Component:</td><td>EinsteinToolkit thorn</td></tr>
</table>
<p>In <code>AHFinderDirect</code> param.ccl there is (same for y, z):</p>
<div class="codehilite"><pre><span></span><code>string track_origin_source_x[101] "grid scalar containing the x component of the origin estimate" STEERABLE=recover
{
"" :: "don't use this feature"
"[a-zA-Z_][a-zA-Z0-9_]*[:][:][a-zA-Z_][a-zA-Z0-9_]*(\[0-9+\])" :: "name of a grid scalar"
} ""
</code></pre></div>
<p>While mimicking this and testing in a thorn of my own, I realized that <code>""</code> matches everything, so the second range is basically useless.
<strong>Is it what is meant by</strong> <code>"don't use this feature"</code>?
I think I rather understand it as "do not put nothing".</p>
<p>If this is not the intention, first something should be done about the empty string and default value.
What's more, the range is actually incorrect (see explanation from GPT-5.4 in Copilot below; I'll let you judge the validity of the explanation, you know that better than me).</p>
<p>Possible fixes:</p>
<ol>
<li>
<p>For the default: for example use a <code>"None"</code> value, with some catch in <code>AHFinderDirect_setup()</code> that checks the variable name and returns an error.
With a quick test, an unknown/wrong variable name would trigger an error somewhere in the execution of <code>AHFinderDirect_find_horizons()</code> anyway.</p>
</li>
<li>
<p>For the actual range:</p>
</li>
</ol>
<ul>
<li>
<p><code>^.*[:][:].*$</code> is used in <code>NSTracker</code> for example.</p>
</li>
<li>
<p>to keep a strict pattern,</p>
</li>
</ul>
<div class="codehilite"><pre><span></span><code> "[a-zA-Z_][a-zA-Z0-9_]*[:][:][a-zA-Z_][a-zA-Z0-9_]*" :: "name of a grid scalar without index"
"[a-zA-Z_][a-zA-Z0-9_]*[:][:][a-zA-Z_][a-zA-Z0-9_]*\[[0-9][0-9]*\]" :: "name of a grid scalar with index"
</code></pre></div>
<p>(GPT's recommendation to separate the two patterns for clarity and portability, instead of trying to match both at the sam
<p>--<br/>
Ticket URL: <a href='https://bitbucket.org/einsteintoolkit/tickets/issues/2939/ahfinderdirect-range-options-for'>https://bitbucket.org/einsteintoolkit/tickets/issues/2939/ahfinderdirect-range-options-for</a></p>
</html>