-
Notifications
You must be signed in to change notification settings - Fork 18
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
BAR libs: Use new SciJava Common discovery mechanism #17
Comments
I just tested it and it this feature is really nice actually. The only thing is that once distributed placed in jar, the updater is no longer aware of individual script files. I will probably adopt the new discovery mechanism because of uploading single files is much more cumbersome, but I always thought it was an advantage for users to sub-select what they want to receive from individual update-sites, but perhaps such granularity is out of the scope of the updater? |
The fundamental unit of currency in the Updater is the file. If you want to have a per-script granularity, then you should upload your scripts bare. However, then you do lose the advantage of versioned JAR files. I guess you could wrap each script in its own JAR file, although that seems like overkill to me. Note that I recently did some work (when prompted by @imagejan) to make shift+click on a JARified script still open it properly in the Script Editor. I did cut new releases of the relevant components, but they have not yet been uploaded to users. |
Yes, that was the only thing stopping me from adopting jar files. Opened this issue asa I noticed your post in the forum. Done for Data_Analysis scripts. Will JARify other directories ASA I find more time (there are several URLs that need to be updated, both in the markdown and mediawiki page). |
I think distributing JAR files with the update is superior to distributing single files. When the complexity of a single script grows, splitting it into several files is the best approach to keep it neat. Additionally parts of a multi file script can be easily reused. |
@m-entrup Nice idea; how about filing an issue in scijava-common for that? If you could give some specific example of your desired syntax, and what you would want to be automatically produced, that would also be helpful. |
I found epydoc that creates a nice API documentation just by parsing the doc strings. It can create HTML and PDF output. From inside ImageJ it could be best to use the from EFTEMj_pyLib import Tools as tools
print tools.batch_open_images.__doc__ The result is:
Thanks to StackOverflow I even found a way to list the doc strings of all functions contained in a module: from EFTEMj_pyLib import Tools as tools
def get_funcs(module):
import types
return [module.__dict__.get(a) for a in dir(module)
if isinstance(module.__dict__.get(a), types.FunctionType)
]
for func in get_funcs(tools):
print func.__name__
print func.__doc__ (The source code of the module: Tools.py) I will soon fill an issue for that. But first I have to play around with it a bit further. |
Thanks to @ctrueden, the
script_templates
strategy (that we're already using) can now be generalized to any path. @m-entrup tested the new discovery mechanism and everything seems to work well, so we should ditch the legacy way of directory mirroring, in favor of the new mechanism, as noted by @imagejan.I really want to implement this, but unfortunately, I may not have time to work on this immediately, so any PRs are welcomed!
The text was updated successfully, but these errors were encountered: