42-AI / Elegant-Elegans

MIT License
3 stars 0 forks source link

[Bug]: undefined variable in exception message in converter.parser.py #51

Closed cnstll closed 1 year ago

cnstll commented 2 years ago

Description

While running converter to convert tif images into video, an exception has been encountered but the exception message contains an undefined variable (see log)

What happened?

see log

Expected behaviour

Exception is raised with relevant message

Environment

env independant

Steps to reproduce

When using a number of frames different from the number of frames expected (collected in metadata.txt)

Relevant log output

Traceback (most recent call last):
  File "/Users/constantalle/anaconda3/envs/wf_ntp/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/Users/constantalle/anaconda3/envs/wf_ntp/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/Users/constantalle/Documents/42project/pythonProjects/elegans/Elegant-Elegans/converter/__main__.py", line 41, in <module>
    main()
  File "/Users/constantalle/Documents/42project/pythonProjects/elegans/Elegant-Elegans/converter/__main__.py", line 28, in main
    stat_frames = check_images(metadata, dir_path)
  File "/Users/constantalle/Documents/42project/pythonProjects/elegans/Elegant-Elegans/converter/parser.py", line 121, in check_images
    f"Mismatched between the number of expected frames ({expected_frames}) and the actual number ({frames})"
NameError: name 'frames' is not defined

Proposed solution

change frames variable for expect_frame_no (l121 in converter.parser.py)

madvid commented 2 years ago

@cnstll do you remember with which you get the error ?

madvid commented 2 years ago

@cnstll a branch has been created, go on this branch and retry to build the video with the list of images which led to the error. If problem is solved, I let you do the PR and ask the review of Jee or Shellen