-
Notifications
You must be signed in to change notification settings - Fork 0
Add Number<->RealType conversion #273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
7b603c7 to
3fc4631
Compare
3fc4631 to
9453816
Compare
|
This PR has been rebased over main, and all tests pass on my machine. The main TODO is to figure out why all of the |
209a5d1 to
6977314
Compare
The broader goal here is to understand "bounded" Anys, which are very necessary for Computer -> Function adaptation. Suppose we ask for a Function<IntType, Any> , hoping to match some Computers.Arity1<I extends RealType<I>, O extends RealType<O>> via adaptation. Adapation requires (1) the underlying Computers.Arity1<I, O> Op, but also (2) some way to generate the output (in practice, either a Function<IntType, Any> or a Producer<Any>). If there are no bounds on the Any, then we can get incorrect matches, such as a Producer<Double>, which would produce an object unsuitable for the Computers.Arity1 op being adapted. Therefore it is necessary to attach bounds on the Any (as an example, an Any bounded by RealType) to ensure correct matching.
|
Okay, now I understand! |
|
So the last thing that I want to do before merging this is to make sure that the converters actually work in practice. I tried doing that but encountered errors, so I pushed the changeset as a WIP commit. Will have to figure out when I next have time. |
|
This pull request has been mentioned on Image.sc Forum. There might be relevant details there: https://forum.image.sc/t/fiji-friends-weekly-dev-update-thread/103718/52 |
952d149 to
c52471f
Compare
c52471f to
5aea9a5
Compare
It's tough to find a good comment for this, because the comment belongs in SciJava Common3 but a persuasive argument requires discussion beyond the scope of that project. For now, a disclaimer will do.
|
This pull request has been mentioned on Image.sc Forum. There might be relevant details there: https://forum.image.sc/t/fiji-friends-weekly-dev-update-thread/103718/60 |
Also made some fixes to Any support to enable better conversion.
TODO: Parse these two out into separate commits