Skip to content
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

Replace deprecated ansi param usage with colors param in logging #383

Closed
yousefmoazzam opened this issue Jul 8, 2024 · 0 comments · Fixed by #396
Closed

Replace deprecated ansi param usage with colors param in logging #383

yousefmoazzam opened this issue Jul 8, 2024 · 0 comments · Fixed by #396
Labels
logging minor Nice to do but not vital

Comments

@yousefmoazzam
Copy link
Collaborator

yousefmoazzam commented Jul 8, 2024

As-per the advice given when running tests:

============================================ warnings summary============================================
tests/method_wrappers/test_rotation.py: 16 warnings
  /httomo/httomo/utils.py:60: DeprecationWarning: The 'ansi' parameter is deprecated, please use 'colors' instead
    logger.opt(ansi=True).info("<yellow>{}</yellow>".format(output))

tests/method_wrappers/test_rotation.py::test_rotation_180
tests/method_wrappers/test_rotation.py::test_rotation_360
  /httomo/httomo/method_wrappers/rotation.py:191: RuntimeWarning: Mean of empty slice.
    flats1d = 1.0 if flats is None else flats.mean(0, dtype=np.float32)

tests/method_wrappers/test_rotation.py::test_rotation_180
tests/method_wrappers/test_rotation.py::test_rotation_360
  /opt/conda/lib/python3.10/site-packages/numpy/core/_methods.py:182: RuntimeWarning: invalid value encountered in divide
    ret = um.true_divide(

tests/method_wrappers/test_rotation.py::test_rotation_180
tests/method_wrappers/test_rotation.py::test_rotation_360
  /httomo/httomo/method_wrappers/rotation.py:192: RuntimeWarning: Mean of empty slice.
    darks1d = 0.0 if darks is None else darks.mean(0, dtype=np.float32)

tests/runner/test_task_runner.py: 16 warnings
  /httomo/httomo/utils.py:58: DeprecationWarning: The 'ansi' parameter is deprecated, please use 'colors' instead
    logger.opt(ansi=True).info("<green>{}</green>".format(output))

tests/runner/test_task_runner.py: 16 warnings
  /httomo/httomo/utils.py:62: DeprecationWarning: The 'ansi' parameter is deprecated, please use 'colors' instead
    logger.opt(ansi=True).info("<magenta>{}</magenta>".format(output))

tests/runner/test_task_runner.py::test_does_reslice_when_needed_and_reports_time
  /httomo/httomo/utils.py:56: DeprecationWarning: The 'ansi' parameter is deprecated, please use 'colors' instead
    logger.opt(ansi=True).info("<cyan>{}</cyan>".format(output))

tests/runner/test_task_runner.py::test_does_reslice_when_needed_and_reports_time
  /httomo/httomo/utils.py:64: DeprecationWarning: The 'ansi' parameter is deprecated, please use 'colors' instead
    logger.opt(ansi=True).info("<red>{}</red>".format(output))

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
@yousefmoazzam yousefmoazzam added logging minor Nice to do but not vital labels Jul 8, 2024
@yousefmoazzam yousefmoazzam linked a pull request Jul 18, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
logging minor Nice to do but not vital
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant