-
Notifications
You must be signed in to change notification settings - Fork 15
Add object introspection functions #78
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
The introspection functions are new API.
For conversion functions, we use the name `convert`. So let's be consistent with introspection functions. It's also more concise.
The submodule is called versions; let's name the test file consistently.
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.
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. |
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 I managed to hack this to work (actually by using the reflection functionality on
|
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 |
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/87 |
For consistency with scripting integration tests.
f3172dd
to
c8867a3
Compare
More consistent with the rest of the library.
5857752
to
d23669d
Compare
* scyjava.fields -> scyjava.inspect.fields * scyjava.methods -> scyjava.inspect.methods * scyjava.src -> scyjava.inspect.src And add new `constructors` and `members` convenience functions.
This code worked: import scyjava print(scyjava.config) But this code didn't: import scyjava print(scyjava.inspect) Because scyjava.config was being imported in another file further down the chain. Better to be explicit about wanting both of these submodules available at the top level.
d23669d
to
7485091
Compare
And do not try so hard with exception handling; it should be up to higher level functions like scyjava.inspect.src to catch such failures.
When invoking scyjava.inspect functions, they can optionally report the source URL at the top, before printing the members. But this only works if scijava-search is on the classpath. Let's let the source flag default to None, in which case it swallows source code URL detection failures gracefully, to make the common case of scijava-search not being available work without hassle. And let's have the various inspect functions accept static and source boolean flags, which get passed along to the internal _print_data routine, as was previously the case when they were partial functions.
7485091
to
5c06747
Compare
Thanks again @ian-coccimiglio for spearheading this work! |
Glad to be involved! |
This PR is a continuation of #77, targeting the mainline branch, and cleaning up the commit history.