<div dir="ltr">Hi Brian,<div><br></div><div><div>> Is there documentation anywhere on how to update the built-ins after</div><div>> updating the signature of an op??  </div></div><div><br></div><div>Not yet. We can make a wiki page. The other thing missing is a top-level "built-ins completeness test" to make sure that all built-ins are actually present and being tested for. (Right now, each unit tests covers a specific op name, but there is no test that verifies all op names are being tested.)</div><div><br></div><div>Due to limitations in generic type matching (as described at <a href="https://github.com/imagej/imagej-ops/issues/19">https://github.com/imagej/imagej-ops/issues/19</a>), we were not able to fully automate generation of the built-in methods. So unfortunately they must be added manually. But there is a significant unit testing infrastructure that tries hard to verify everything matches.</div><div><br></div><div>Here's a quick rundown:</div><div><br></div><div>1A) If you add a new concrete op implementation for an existing op name, then the existing built-in test method will pick it up.</div><div><br></div><div>1B) Or if the implementation corresponds to a new name foo, you can add the completeness test by adding a new testFoo() method to the appropriate namespace test class (e.g., MathNamespaceTest for math, LogicNamespaceTest for logic, or GlobalNamespaceTest for methods in the OpService itself).</div><div><br></div><div>2) The unit test will notice that your new op does not have corresponding built-in method signature(s), and spit out a detailed error message suggesting the method bodies to be added. The method bodies are pretty close to correct except for they are missing generic parameters. So you must tweak the argument types by hand to make the generics match the fields of the concrete op implementation.</div><div><br></div><div>3) Then just paste the method body into the appropriate namespace class (e.g., MathNamespace for math, LogicNamespace for logic, or OpService and DefaultOpService for global. Then the relevant completeness test should pass again.</div><div><br></div><div>4) If multiple ops have clashing signatures, you can make a single built-in method with an @OpMethod annotation the specifies multiple concrete op classes in its "ops" attribute. Method parameters and return type must then use the most common compatible superclass of all involved ops.</div><div><br></div><div>Let me know if any of that needs clarification; happy to elaborate further, and point out specific examples as needed.</div><div><br></div><div>Regards,</div><div>Curtis</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 29, 2015 at 9:21 AM, Brian Northan <span dir="ltr"><<a href="mailto:bnorthan@gmail.com" target="_blank">bnorthan@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Hi everyone<br><br></div><div>Just noticed that built-ins were added recently.<br><br><a href="https://github.com/imagej/imagej-ops/pull/145" target="_blank">https://github.com/imagej/imagej-ops/pull/145</a><br></div><div><br></div>Is there documentation anywhere on how to update the built-ins after updating the signature of an op??  <br><br></div><div>Mainly I'm wondering if there is any scripts or automated code generation steps to perform??<br></div><div><div><div><div><div><br></div><div>If it is just a matter of updating the signatures manually I can figure out how to do that.  Just want to make I don't miss an automated step I should be running. <br><br></div><div>Thanks<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Brian<br></div></font></span></div></div></div></div></div>
<br>_______________________________________________<br>
ImageJ-devel mailing list<br>
<a href="mailto:ImageJ-devel@imagej.net">ImageJ-devel@imagej.net</a><br>
<a href="http://imagej.net/mailman/listinfo/imagej-devel" rel="noreferrer" target="_blank">http://imagej.net/mailman/listinfo/imagej-devel</a><br>
<br></blockquote></div><br></div>