-
Notifications
You must be signed in to change notification settings - Fork 1
Adding a method to get options #72
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
Open
timmarkhuff
wants to merge
17
commits into
main
Choose a base branch
from
rtsp-fix
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
ba39321
adding a method to get options
timmarkhuff 9005317
Automatically reformatting code with black and isort
e07b460
bumping version and removing comments
timmarkhuff 716e685
bumping version and removing comments
timmarkhuff 9d11453
Automatically reformatting code with black and isort
916bcf6
adding a test
timmarkhuff ff85bff
adding a test
timmarkhuff c44a666
adding a test
timmarkhuff cde27c9
adding a test
timmarkhuff 9b7eea9
updating how options are accessed
timmarkhuff df72b31
Automatically reformatting code with black and isort
9f01be3
updating test
timmarkhuff 1421df0
updating test
timmarkhuff e9fa12a
Automatically reformatting code with black and isort
229e10b
Updating docstring
timmarkhuff b301dd7
Merge branch 'rtsp-fix' of github.com:groundlight/framegrab into rtsp…
timmarkhuff 9454f72
debugging issue with test
timmarkhuff File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "framegrab" | ||
version = "0.11.0" | ||
version = "0.11.1" | ||
description = "Easily grab frames from cameras or streams" | ||
authors = ["Groundlight <[email protected]>"] | ||
license = "MIT" | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -337,3 +337,21 @@ def test_determine_input_type_in_create(self): | |
# this won't work because there are multiple input types that could be mapped to the serial_number field | ||
with self.assertRaises(ValueError): | ||
FrameGrabberConfig.create(serial_number="1234567890", resolution_width=640, resolution_height=480, digital_zoom=2) | ||
|
||
# def test_get_and_apply_options(self): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we uncomment this test? I dont think we should leave it in if we're just going to keep it commented. |
||
# """ | ||
# Test that we can get the grabber's options and make an update to the options | ||
# """ | ||
# original_zoom = 2.0 | ||
# new_zoom = 2.1 | ||
|
||
# config = MockFrameGrabberConfig(digital_zoom=original_zoom) | ||
# grabber = FrameGrabber.create_grabber(config) | ||
|
||
# assert grabber.config.get_options() == {'zoom': {'digital': original_zoom}} | ||
|
||
# new_options = grabber.config.get_options() | ||
# new_options["zoom"] = {'digital': new_zoom} | ||
# grabber.apply_options(new_options) | ||
# options = grabber.config.get_options() | ||
# assert options == {'zoom': {'digital': new_zoom}} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want this to actually be
grabber.config.options
, then you could use the @Property decorator and call thisdef options(self):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I considered this, however sometimes the rpc server tries to do things like this:
grabber.config.options["some_option"] = "new value"
This works if grabber.config.options is actually a property, but raises an exception if it is a method decorated with property.
In general, I try to stay away from the property decorator for this reason. I would rather know if something is a method or a property.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That said, maybe the RPC server shouldn't be updating options like that. We need to figure out the right way to update options, especially in light of the recent pydantic refactor.