On 28 Mai, 06:51, Yuval Levy <[email protected]> wrote: > On Kay's request, a thread of its own for the Python scripting as we move > toward 2011.2.
Thanks. > Since the threads will need to be persistent for a few months as work is in > progress for the next release, I made most issues tracker tickets. Feel free > to add other tracker tickets too, just tag them with hsi (and hpi where > applicable). > 3. Formalize/Stabilize API > > > > The main trade-off will be between bloat and functionality, and indeed > > > this thread and Thomas' "we don't need" statement is a taste of things > > > to come. > > > Scripts are really lightweight. If you look at woa, which is really a > > large script, it's merely 59K. The real load currently is the hsi > > module, _hsi.so, weighing in at 8.1M. I wouldn't worry about bloat > > from scripts. > > actually I do not worry about bloat in terms of disk space or bandwidth. I > worry about bloat in terms of namespace / quantity of scripts. Example: > there can be a gazillion of scripts to generate an initial pto with the input > images distributed according to a pre-determined shooting pattern (a feature > request that has come up fairly often). One can have a script that does > stacks, another a script that shoots left to right; another is optimized for > fisheyes (the typical 6+Z+N), etc. how many such scripts do we want to > include with the core Hugin? and how many more will there be in the online > script repository? This is a hard one. If we have a script to cut fingernails, we may not need scripts to cut thumbnails - but who would be in a position to judge? Mind you, I don't anticipate us being swamped by scripts and plugins any time soon, and for a script to make it into the distro I suppose it will have to be found to be useful by the peer group. > > And if you worry about bloat, defining a clean API for > > hugin, so that hsi can wrap what's really needed - and wanted - to be > > accessible by everyone instead of near enough everything declared in a > > bunch of headers never meant for the wider public. I'd estimate > > _hsi.so could shrink to a quarter or so. > > > A proper API specification would also be a remedy against scripts > > breaking as soon as the headers in question are modified in an > > incompatible way > > The biggest advantage I see in a carefully crafted clean API is human: the > more understandable and simple the API, the more users it will attract. Quite so. But I have to state that the names of the objects and methods I've wrapped were mostly telling and to-the-point - otherwise I would have had little chance of using hsi. > Stability of the API to prevent script breaking is an extra bonus, but IMHO it > is not extremely critical. Forcing backward compatibility would only hinder > progress and I'd rather deal with breaking scripts than with a rigid > structure. > > I would propose that we adopt a rule: scripts should be written against the > API that is frozen in a release (e.g. 2011.2, 2011.4, 2012.0, ...). > Everything else is at risk of breaking any time and users of the bleeding edge > should expect to experience such errors. sounds like a good idea > There will still be an extra burden: with every release all scripts will need > testing and eventually update. This has positive sides as well: it will > prune the body of scripts from scripts that have been supreseeded. to reduce the body of 'currently available up-to-date scripts' to only 1/4 gazillion ;-) > > - and that's quickly done: change a call signature or > > type name and swig will duly wrap it to keep the module consistent > > with the C++ code, and hsi code using the old names/signatures breaks > > and has to be adapted. Resulting in lots of frustrated users and > > script-writers (and support load: 'xyz.py does not work any more' - > > 'are you using hsi 5886.X already?' ...) > > https://bugs.launchpad.net/hugin/+bug/789442 'very fragile' is exaggerating the matter. A script only breaks if it tries to use code that has been modified. After all Python is an interpreted language. So even if 90% of the headers were changed, you'd have a chance of your script still running if you're only using the unmodified 10%. > 5. Naming Convention for Scripts > > Kay disagree with me on this one. I made two arguments for a naming > convention in the bug report. > > https://bugs.launchpad.net/hugin/+bug/789445 hmmm... slowly coming round to your point of view... > 6. Scripting Guidelines > > > Good examples go a long way. > > Yes on the "write" side, i.e. to empower users to write their own scripts. > But on the "read" side, i.e. when the project team receives contributed > scripts for inclusion in the repository, what are the criteria to determine > the cut, acceptable or not for the repository? I suppose on initial upload you can't reasonably expect anyone to look and check. I suppose it'll go like this: xyz uploads script uv and posts to hugin-ptx 'hey group I just uploaded uv, it does such-and- such, have a spin'. If xyz is known and the script sounds desirable, the group will try it out and if it's found to be good, eventually it will be proposed for general distribution. Otherwise it lives on in the publicly accessible part of the repo for everyone to browse it if they so desire. If someone needs the specific capability, googling for it should throw up the original posting to hugin-ptx, so it can be found. Of course xyz would be free to just upload and not announce, which would lower the chances of uv being noticed. > 7. Formalized Interface > > > What really needs to be formalized is > > interfacing with plugins. To formalize that, a proper interface beyond > > 'run Python script' should exist. I'd like to see a discussion of the > > topic. I started a thread a while ago, but nothing much came of it. > > Yes, this is a heavy subject with far reaching consequences. And right now it > is almost 1AM and my batteries are running low. Mine, not the laptops'. > We'll need to put more work into this. Definitely. Please. Everyone else: help! Do we have anyone here who is competent with plugin interfaces? I mean, every other piece of decent software these days has a plugin interface, so there must be trodden paths. How do they do it? Can we do it the same way? > This will likely generate many tracker tickets, as there will be > incompatibilities, platform related quirks, bugs, etc. I'm not looking forward to that > 8. Quo Vadis? gotta be off to do other stuff. carry on later Kay -- You received this message because you are subscribed to the Google Groups "Hugin and other free panoramic software" group. A list of frequently asked questions is available at: http://wiki.panotools.org/Hugin_FAQ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/hugin-ptx
