-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Implements -q[l|m|h|k]
#514
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
…llows for easier testing mostly.
manim/config/config.py
Outdated
| quality = _determine_quality(args) | ||
| section = config_parser[quality if quality != "production" else "CLI"] | ||
|
|
||
| # Loop over low quality for the keys, could be any quality really | ||
| config = {opt: section.getint(opt) for opt in config_parser['low_quality']} |
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.
Very clean code, I like it.
manim/constants.py
Outdated
| 'high_quality': 'h', | ||
| 'medium_quality': 'm', | ||
| 'low_quality': 'l' | ||
| } |
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.
Did you run black on this? In any case, please leave a blank line at the end of the file.
| # The following are mutually exclusive and each overrides | ||
| # FRAME_RATE, PIXEL_HEIGHT, and PIXEL_WIDTH, | ||
| parser.add_argument( | ||
| "-l", |
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'm not sure we should completely remove these flags just yet. Doing so will most likely break every single user's workflow. Yes, it's an easy change, but it still needs to be done with care.
Is there a way of adding a deprecation warning instead?
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 don't think it is possible to tell -l apart from --low_quality. If we want to warn for deprecation we could maybe create a new argument with just -l and if someone uses it warn them. Not sure if that will produce clean code though.
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.
Hmm that's a good point. I'm still a bit weary of breaking every user's flow though. Let's see what others think.
|
The test you added is looking good. However, this seems to have broken other existing tests. Could you please check those? Finally, please make sure to rebuild the documentation as well. Specifically, this PR should change |
|
Yeah so, when I run just the new test it works. However, when running all tests it fails. I'm not sure what it is caused by, it seems that when running all tests that the parser expects different arguments. I was hoping one of you could enlighten me on the cause of the error it throws. I'll update the docs! |
|
cc @ManimCommunity/tests Also, does anyone in @ManimCommunity/core object to this change? I think we should deprecate the current flags instead of removing them. |
|
I think this PR should only be merged only after the release. Also, there should should be depreciation warning like done in |
|
I have added a deprecation warning to the old flags but they are still supported. As far as I'm aware this PR is now complete and ready for review. |
eulertour
left a comment
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.
Thanks for writing tests!
|
|
||
| for quality in old_qualities.keys(): | ||
| if getattr(args, quality): | ||
| logging.getLogger("manim").warning( |
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 move this line
Line 167 in 41f6f05
| set_rich_logger(config_parser["logger"], file_writer_config["verbosity"]) |
Line 153 in 41f6f05
| args, config_parser, file_writer_config, successfully_read_files = _run_config() |
Line 166 in 41f6f05
| # Set the different loggers |
|
CMIIW, but merging this means something like |
|
They don't have to be separated as long as -qm is the last argument. See Python documentation. |
|
Uhm, not sure why the tests fail but it seems unrelated to my changes? |
|
Probably transient errors. I tried re-running them, but if its still an unrelated failure we can merge anyway. |
|
Well they fail when installing, and since I changed nothing in the install process I'd say it is not possible that my changes broke the tests. |
eulertour
left a comment
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.
Since the old flags are deprecated rather than removed I don't see why this can't be merged now.
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.
Wait, there is not end to end test for these flags (except for -ql).
Do you think it's the right PR for that ? I know, there are already tests for these flags but not invovling the whole video process.
If you decide to do so, everything is explained in the wiki on github, testing section
i mark it as change requested, just to have time to discuss a little bit
|
Even if you do decide that you want to add end-to-end tests you shouldn't block this PR for it; that should be discussed separately. |
That's why I was asking. |
List of Changes
-q/--quality [k,h,m,l]flags-k/-e/-m/-lflagsMotivation
Implements behaviour as described in #146 except for
-qp. This flag would specify default behaviour and seems redundant to me. It could however be easily implemented if that is prefered for this PR.Testing Status
Old tests have been updated to use new flags when needed and a new test has been written to test the flags.
Further Comments
The new test might be a bit too extensive but it covers every way someone could write the flags (par example
-q hor-qhare both tested). The production quality does not have its own section in the config but instead reads from theCLIsection (which was its old behaviour).Acknowledgement