Refactor descriptions#113
Conversation
402bd33 to
3f2fa69
Compare
gselzer
left a comment
There was a problem hiding this comment.
I like the changes, but as expected with a draft PR it's sloppy
| public final class OpWrappers { | ||
|
|
||
| private OpWrappers() { | ||
| // Prevent instantiation of static utility class | ||
| } |
There was a problem hiding this comment.
Was this not a part of the OpWrappers.vm file?
| var infos = SimplificationMatchingRoutine.getInfos(env, req.getName()); | ||
| var filtered = filterInfos(infos, req); | ||
| String opString = filtered.stream() // | ||
| .map(Infos::describe) // |
There was a problem hiding this comment.
We should consider deleting unused methods - there are now 4 different Infos.describe... methods - decide whether we need/want all of them
| return describe(info, null, null); | ||
| } | ||
|
|
||
| /** | ||
| * Generates a {@link String} describing the given {@link OpInfo} | ||
| * | ||
| * @param info the {@link OpInfo} of interest | ||
| * @param name the name that the Op was searched by | ||
| * @return a descriptor for {@code info} |
There was a problem hiding this comment.
Again, figure out how much of this is needed
|
|
||
| String expected = "test.classDescription(\n\t " // | ||
| + "Inputs:\n\t\tjava.lang.Double input1\n\t\tjava.lang.Double input2\n\t " // | ||
| + "Outputs:\n\t\tjava.lang.Double output1\n)\n"; | ||
| + "Output:\n\t\tjava.lang.Double output1\n)\n"; | ||
| String actual = info.toString(); | ||
| Assertions.assertEquals(expected, actual); | ||
| } |
There was a problem hiding this comment.
We may want to switch info.toString() to the current Infos.describeMultiline if we like that better
| org.scijava.ops.engine.stats.Mean, | ||
| org.scijava.ops.engine.stats.Size; |
| @@ -99,7 +99,7 @@ public class DefaultTubeness<T extends RealType<T>> implements | |||
| private Function<Dimensions, ImgFactory<DoubleType>> createFactoryOp; | |||
|
|
|||
| //TODO: make sure this works | |||
| */ | ||
|
|
||
| package org.scijava.ops.image.slice; | ||
| package org.scijava.ops.image.transform.slice.slice; |
There was a problem hiding this comment.
Why is this package slice.slice?
| .producer(); | ||
|
|
||
| Function<Class<T>, T> typeFunc = ops.unary("create") // | ||
| Function<Class<T>, T> typeFunc = ops.unary("create.object") // |
There was a problem hiding this comment.
Consider coming up with a better name...
| */ | ||
|
|
||
| package org.scijava.ops.image.project; | ||
| package org.scijava.ops.image.transform.project.project; |
There was a problem hiding this comment.
This package should not have two project
| Assertions.assertEquals(expected2, typeAssigns2); | ||
| } | ||
|
|
||
|
|
0e8c715 to
88d5626
Compare
We're not doing any kind of fuzzy matching at this point.
equals is too strict.. we just want a startsWith
Since aliases are no longer returned in help text, many of these tests require two separate classes to be registered in a bare op environment.
43256f7 to
baee2b5
Compare
This PR is (currently) a messy attempt at making the return from
DefaultOpEnvironment.help()a lot cleaner to read. We make the following broad changes:engine.adaptOps now use theengine.createandengine.copynames where necessary for adaptation purposes. Other Ops were altered as needed to enforce this requirement.*and^, respectively. @ctrueden liked this the best.Note that this PR is designed to close scijava/scijava#167, and is meant to give @hinerm a starting point since he assigned himself that issue.
Points for further discussion:
OpInfos harder, because right now we only collapse based on equalStrings. But, if the names are scraped from javadoc, we can't stop someone from e.g. making a typo and adding a new entry to the help.I never changed the verbose description - how should that change, if at all?With @elevans' help, I edited the verbose descriptions to look similar to the simple descriptions, but they also include type/implementation/description details.TODO: