Skip to content
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

Add object introspection functions #78

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open

Conversation

ctrueden
Copy link
Member

@ctrueden ctrueden commented Apr 2, 2025

This PR is a continuation of #77, targeting the mainline branch, and cleaning up the commit history.

@ctrueden ctrueden self-assigned this Apr 2, 2025
ctrueden added 5 commits April 2, 2025 14:11
To me, the name `find_java` suggests we will be locating a JVM
installation, rather than "finding" information about Java objects.
The information doesn't need to be "found" or "located", but rather
only introspected or interrogated. Technically, I suppose
"introspection" implies read/access while "reflection" implies
write/mutation, but `jintrospect` is rather clunky, whereas the
term "reflection" is widely known in both Java and Python circles.
@ctrueden
Copy link
Member Author

ctrueden commented Apr 2, 2025

I've done all the technical cleanup work I wanted to do. Tomorrow I'll review the actual code changes in more detail. Based on my initial read-through, it looks pretty fabulous.

@ian-coccimiglio
Copy link
Contributor

ian-coccimiglio commented Apr 3, 2025

Super glad this is coming together.

I'm noticing that it'd be good to find the right way to pass a Scijava Logger onto the sf.sourceLocation() function called by the src() function. I was helping someone on image.sc with OrientationJ on pyImageJ and I was trying to find the source code.

I managed to hack this to work (actually by using the reflection functionality on ij!). And what I found was:

# (With OrientationJ.jar in the classpath)
sf.sourceLocation(jimport("OrientationJ_Analysis"), None).toString() # fails & what we have currently
sf.sourceLocation(jimport("OrientationJ_Analysis"), ij.log()).toString() # works

@imagesc-bot
Copy link

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/84

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants