Repository navigation
Op Discovery Through YAML declaration - #67
Conversation
b6e5745 to
dd41241
Compare
hinerm
left a comment
There was a problem hiding this comment.
Is it worth keeping the info -> package tag, and the parameters tags?
These feel worthwhile to me. I would keep them.
Should this functionality be moved into a separate module? How much of it should be moved?
How much of it can be moved? Based on my understanding from our previous discussion, I'm in favor of consolidating code in scijava-ops-engine instead of submodules, since those modules aren't true "extensions" and require fundamental changes to the core module.
fbf253d to
aec41f3
Compare
|
@gselzer I added two commits to tweak the inner-class vs. method discovery. I appreciate trying to load the class in the If you agree with those commits: could you just rewrite your WIPs? Then we'll merge! |
Is the code in question the YAML handling code? If so, I propose that it might not be specific to |
dd4f33b to
01c02e1
Compare
01c02e1 to
20226f1
Compare
There is some general YAML logic, but I think right now we should leave it in the engine. It's pretty intertwined with the Ops-specific logic, and I don't yet know that we have a good use case to separate it. I say YAGNI |
20226f1 to
9ac4bc3
Compare
9ac4bc3 to
62b4c02
Compare
It has better logic
We don't use it anymore
This PR introduces a new
YAMLDiscovererthat provides the ability to describe Ops via YAML declaration. Currently,Classes implementing a functional interface,final Fields andstatic Methods can be wrapped into Ops via YAML. This is done by writing a fileops.yamlwithin theresourcespackage of a project. At runtime, theClassLoaderobtains all of these files on the class/module path, adding them to Ops (assuming that the functionality is exposed through JPMS (?)). An example is included below:The
infosection declares metadata pertaining to all Ops in the package:sourcetells us the language the functionality is written in, and allows us to later target e.g. Pythonpackagetells us the package the Ops are described in. I'm not sure we need this, actually.versionis used for provenance, telling us the code version.The
opssection iterates over allops. OneOpis created for eachopin the list.nameis the term(s) that the Op can be searched bypriorityis the Op's prioritysourceis a term that Ops could use to get a handle on the functionality. For Java, this is eitherparameterssection provides information on the parameters. We aren't using this right now, and might want to delete it.Discussion points:
info -> packagetag, and theparameterstags? This PR doesn't use either, but I can see us wanting to use it later (e.g. for Python functionality).