<div dir="ltr">Great - I volunteer to make a tentative list of KSP tutorials to move to tests (and hopefully others could follow with SNES, TS, etc.). I'll post the list as an issue to get any feedback about examples to save, before doing the twiddling to make a PR.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Am Mo., 22. Apr. 2019 um 08:55 Uhr schrieb Smith, Barry F. <<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><br>
I'd be happy to see pull requests that transfer the worst examples over to the test directory (and their output files!)<br>
<br>
I suspect different people may think different examples are worst but this could be sorted in a first pull request that move the worst of the worst<br>
<br>
<br>
Barry<br>
<br>
> On Apr 21, 2019, at 12:11 PM, Hapla Vaclav <<a href="mailto:vaclav.hapla@erdw.ethz.ch" target="_blank">vaclav.hapla@erdw.ethz.ch</a>> wrote:<br>
> <br>
> <br>
> <br>
>> On 21 Apr 2019, at 11:29, Patrick Sanan <<a href="mailto:patrick.sanan@gmail.com" target="_blank">patrick.sanan@gmail.com</a>> wrote:<br>
>> <br>
>> The quickest fix would of course be to remove that limit. Some pages would probably end up with dozens of example links, but that might not be so bad, as below are only "implementations" (which are probably used mainly by (potential) developers), and links back to the indices. With some scripting one could make an html table (or whatever) to have more than one link per line to save space.<br>
> <br>
> I agree with all, except I think a list is more clear than a table even though it is long. I think the space is not an issue as everything relevant for basic users is above.<br>
> <br>
> I would even suggest to include a separate subsection with tests. Some advanced routines might appear only there and it's still better to have a list of tests than nothing.<br>
> <br>
>> <br>
>> It would also be helpful to move some of the "bad" examples (which look more like tests in many cases) to the tests/ directories. <br>
>> There are papers out there which reference these examples, but those would of course be expected to be the "good" ones.<br>
> <br>
> I feel that it's a chronic problem. Some tutorials should already be tests because they already cover so many cases that they are becoming really cluttered. In this case we could copy the tutorial to tests and keep only a stripped-down, more didactic version in tutorials. Is this considered a right way?<br>
> <br>
>> <br>
>> Out of curiosity, is there any non-historical argument to have this sort of logic in bash, as opposed to python?<br>
>> <br>
>> <br>
>> Am Sa., 20. Apr. 2019 um 23:37 Uhr schrieb Smith, Barry F. via petsc-dev <<a href="mailto:petsc-dev@mcs.anl.gov" target="_blank">petsc-dev@mcs.anl.gov</a>>:<br>
>> <br>
>> Yeah this is done in lib/petsc/conf/rules<br>
>> <br>
>> #<br>
>> # Example usage for manual pages; adds each example that uses a function to that functions<br>
>> # manual page up to a limit of 10 examples.<br>
>> #<br>
>> manexamples:<br>
>> -@base=`basename ${LOCDIR}`; \<br>
>> if [ "$${base}" = "tutorials" ] ; then \<br>
>> echo "Generating manual example links" ; \<br>
>> for i in ${EXAMPLESC} ${EXAMPLESF} foo ; do \<br>
>> if [ "$$i" != "foo" ] ; then \<br>
>> a=`cat $$i | ${MAPNAMES} -map ${LOC}/docs/manualpages/manualpages.cit \<br>
>> -printmatch-link -o /dev/null| cut -f 2 | cut -d '#' -f 1 |sed -e s~^../~~ | grep \\.html$$ | sort | uniq` ; \<br>
>> for j in $$a ; do \<br>
>> b=`ls ${LOC}/docs/manualpages/$${j} | grep -v /all/ | cut -f9` ; \<br>
>> l=`grep "^<A HREF=\"\.\./\.\./\.\..*/tutorials/" $${b} | wc -l`; \<br>
>> if [ $$l -le 10 ] ; then \<br>
>> if [ $$l -eq 0 ] ; then \<br>
>> echo "<P><H3><FONT COLOR=\"#CC3333\">Examples</FONT></H3>" >> $$b; \<br>
>> fi; \<br>
>> echo "<A HREF=\"../../../BB\">BB</A><BR>" | sed s?BB?${LOCDIR}$$i.html?g >> $$b; \<br>
>> grep -v /BODY $$b > ltmp; \<br>
>> echo "</BODY></HTML>" >> ltmp; \<br>
>> mv -f ltmp $$b; \<br>
>> fi; \<br>
>> done; \<br>
>> fi; \<br>
>> done; \<br>
>> fi<br>
>> <br>
>> It has a hardwired limit of 10 (though it seems to produce 11 :-).<br>
>> <br>
>> Given how many bad examples we have in the tutorial directories it is not a good model to just grab 10 of them.<br>
>> <br>
>> <br>
>> <br>
>> > On Apr 20, 2019, at 3:49 AM, Hapla Vaclav via petsc-dev <<a href="mailto:petsc-dev@mcs.anl.gov" target="_blank">petsc-dev@mcs.anl.gov</a>> wrote:<br>
>> > <br>
>> > Hello<br>
>> > <br>
>> > Why<br>
>> > <a href="https://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/SNES/SNESSolve.html#SNESSolve" rel="noreferrer" target="_blank">https://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/SNES/SNESSolve.html#SNESSolve</a><br>
>> > <a href="https://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/SNES/SNESSetDM.html#SNESSetDM" rel="noreferrer" target="_blank">https://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/SNES/SNESSetDM.html#SNESSetDM</a><br>
>> > do not list ex62 and ex77<br>
>> > <a href="https://www.mcs.anl.gov/petsc/petsc-dev/src/snes/examples/tutorials/ex62.c.html" rel="noreferrer" target="_blank">https://www.mcs.anl.gov/petsc/petsc-dev/src/snes/examples/tutorials/ex62.c.html</a><br>
>> > <a href="https://www.mcs.anl.gov/petsc/petsc-current/src/snes/examples/tutorials/ex77.c.html" rel="noreferrer" target="_blank">https://www.mcs.anl.gov/petsc/petsc-current/src/snes/examples/tutorials/ex77.c.html</a><br>
>> > while these examples use these routines?<br>
>> > <br>
>> > It affects both dev and current manpages. Is there a deliberate limit on number of examples listed?<br>
>> > <br>
>> > I think it's confusing. Particularly these examples are often used in tutorials, right?<br>
>> > <br>
>> > Thanks,<br>
>> > Vaclav<br>
>> <br>
> <br>
<br>
</blockquote></div>