-
Notifications
You must be signed in to change notification settings - Fork 220
Improve user experience around previews #1251
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
base: next
Are you sure you want to change the base?
Conversation
ecce483
to
d94a5de
Compare
for some reason smoke test pi4 is queued perennially, even before I force pushed anything |
Yes, that unit seemed to have become completely unresponsive and I actually had to go and physically power-cycle it. No idea why. Anyway, seems to have come back to life now! |
Hi, thanks for this PR. I like the idea of Can you just comment on the use of |
Since we're in beta I didn't add a deprecation warning. Do we have a formal deprecation policy? If you think this is a good idea, I can add it. |
762a773
to
89e51fd
Compare
So Picamera2 has been stuck "in beta" forever now (like some other projects!), I think what matters is that it has probably 100s of very active users, and maybe 1000s overall. I can't say there's a "formal" policy about changing APIs, except that, given the above, it's not a thing to do lightly. Having said that, I'm still keen to move forward and adopt improvements, so long as we can do things like:
Sorry if that sounds a bit fussy, but hopefully we can manage something like that? Also just a heads-up that we're rebasing our libcamera back onto the upstream version which has had some binary/API incompatible changes. I've updated the Picamera2 next branch to cope with them, but just be warned that over the next couple of days there may be issues like Picamera2 next not working on our current libcamera release, or the libcamera main branch. But hopefully we'll resolve all this and get everything updated before the end of the week. |
I already added backwards compatibility to the deprecation of But I don't see a meaningful way to "deprecate" the change in behaviour of
Which will be how many release cycles or weeks/months? |
Hi, yes this is all a bit tricky. That preview argument has way too many permutations. I wonder if the answer is to deprecate and replace the old parameters. So for example, There's still an issue with using As regards the timescales, I think we need a minimum of one release where the old behaviour works but is clearly deprecated, so I think that might mean "a couple of months", or something like that. I think folks will come with us if the new scheme is clearly more logical and better, and clearly signalled. I don't think I could handle the backlash caused by breaking stuff suddenly and without warning!! Does that make some sense? Sorry that this is all quite so tricky. |
51041f2
to
d75228d
Compare
Initially I wanted to rename So I instead focused on the values of
Yes, you make sense to me. Rather I would want you to say what you want so that we can expedite things. Thanks for being nice till now. (Check the PR description for the new changes) |
…id values: - `None` (default* - starts a `NullPreview`) - `Preview` enum member - a preview object specifically, `bool` type has been deprecated in favor of `Preview.auto()` & `Preview.NO` *currently `show_preview` takes precedence when `preview=None` Signed-off-by: Asadullah Shaikh <[email protected]>
Hi again, I think I'm confusing myself too. Let me try and step back and double check what we want to do here. So firstly, we're OK with passing an enum (e.g. Preview.NULL) to We're also OK with passing an actual preview instance, which should also let us have We want to deprecate the use of (There's also a slight weirdness about Anyway, does that all sound correct so far? |
Yes Let me reiterate lest we miss something.. Old behaviour ( New behaviour ( As for Unless users opt to migrate by explicitly using the Once the deprecation period ends, the following changes will take place through a separate PR:
|
Thanks for the confirmation there. And just to understand completely, what would the difference be if we just kept The |
Ok. Then why not
Then we won't be able to deprecate (i.e. phase out) the old behaviour. We'll have to remove it altogether in a given release. |
based on #1248(comment), #1251(comment)
Overview:
show_preview
in favour ofpreview
across all methods.bool
type as a value to thepreview
parameter.NO
to thePreview
enum. It skips starting an event loop (replaces behaviour ofshow_preview=None
).auto()
to thePreview
enum. It returns the [auto-]detected preview fromPreview.{NULL,DRM,QT,QTGL}
(replaces deprecated[show_]preview=True
).preview=None
the 'future' default across all methods, in order to unify the default behaviour. It starts aNullPreview
(replaces deprecated[show_]preview=False
).start_and_capture_file()
&start_and_capture_files()
(currently they default to auto-detection i.e.[show_]preview=True
).apart from the usual 'more pythonic, readable, idiomatic' and the obvious gains in separation of concerns (SoC), the most significant improvement is that users can now know, ahead of time, which preview will be detected by calling
Preview.auto()
and storing the result