Skip to content

Fix #453: log files when scene is not specified #521

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

Merged
merged 2 commits into from
Oct 7, 2020

Conversation

charlie4fun
Copy link
Contributor

@charlie4fun charlie4fun commented Oct 6, 2020

List of Changes

  • triggering manim without scene name fixed
  • tests/test_logging/basic_scenes.py split into two files, to enable triggering of SquareToCircle without scene name in manim command
  • test case for triggering manim without scene name added

I guess as --log_to_file does not exist in original library and was not released yet, fix related to it should not be reflected in docs/source/changelog.rst

Motivation

It is aimed to fix issue #453

Explanation for Changes

Now log file name would consist of two parts <name_of_animation_file>_<name_of_scene>.log
<name_of_scene> - would be optional, only if scene name was provided on manim call

Testing Status

all tests passed, Ubuntu 18.04

Further Comments

seems like WriteStuffscene from tests/test_logging/basic_scenes_wirte_stuff.py was never triggered, nevertheless I did not remove it

Acknowledgement

@charlie4fun charlie4fun force-pushed the fix_453 branch 4 times, most recently from 977dfad to 09864e6 Compare October 6, 2020 20:37
@charlie4fun
Copy link
Contributor Author

I don't know how to rerun particular tests in CI (https://github.com/ManimCommunity/manim/actions/runs/292167071). As they show GitHub Actions has encountered an internal error when running your job. When i was rerunning them altogether they show same error as mentioned above for a different set of tests

Comment on lines -6 to -10
class SquareToCircle(Scene):
def construct(self):
self.play(Transform(Square(), Circle()))


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@huguesdevimeux could you make sure this change makes sense? I've sort of lost track of tests

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes sense. Renaming the file will provide more clarity.

Comment on lines 161 to 163
scene_file_name = os.path.basename(args.file).split(".")[
0
] # takes filename and removes extension
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: I think this comment is unnecessary. Also, removing it will make black format this line a lot more prettily.

@@ -157,9 +157,18 @@ def _parse_config(config_parser, args):
set_rich_logger(config_parser["logger"], file_writer_config["verbosity"])
if file_writer_config["log_to_file"]:
# IMPORTANT note about file name : The log file name will be the scene_name get from the args (contained in file_writer_config). So it can differ from the real name of the scene.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It sounds like your PR should change what this comment says.

Copy link
Member

@huguesdevimeux huguesdevimeux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM.

Speaking of logging tests, will still need more of them.

0
] # takes filename and removes extension
log_file_name = (
f"{scene_file_name}_{scene_name_suffix}.log"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Praise : Naming the log depending on the suffix is a very good idea!

@charlie4fun
Copy link
Contributor Author

@leotrs I made some changes addressing your comments on PR, should something more be done in order to merge it?

@leotrs leotrs merged commit 043cc53 into ManimCommunity:master Oct 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants