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

Cleanup a warning issued by the SmacOptimizer cleanup code #767

Merged
merged 3 commits into from
Jun 28, 2024

Conversation

bpkroth
Copy link
Contributor

@bpkroth bpkroth commented Jun 28, 2024

Minor tweak to address this warning in pytest output:

mlos_core/mlos_core/tests/optimizers/optimizer_multiobj_test.py::test_multi_target_opt_wrong_weights[SmacOptimizer-kwargs2]
  C:\Users\bpkroth\.conda\envs\mlos\Lib\site-packages\_pytest\unraisableexception.py:80: PytestUnraisableExceptionWarning: Exception ignored in: <function SmacOptimizer.__del__ at 0x0000021F5FDC42C0>

  Traceback (most recent call last):
    File "C:\Users\bpkroth\src\MLOS\mlos_core\mlos_core\optimizers\bayesian_optimizers\smac_optimizer.py", line 208, in __del__
      self.cleanup()
    File "C:\Users\bpkroth\src\MLOS\mlos_core\mlos_core\optimizers\bayesian_optimizers\smac_optimizer.py", line 339, in cleanup
      if self._temp_output_directory is not None:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  AttributeError: 'SmacOptimizer' object has no attribute '_temp_output_directory'

    warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))

mlos_core/mlos_core/tests/optimizers/optimizer_test.py: 135 warnings

@bpkroth bpkroth requested a review from a team as a code owner June 28, 2024 20:51
Copy link
Member

@motus motus left a comment

Choose a reason for hiding this comment

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

Approved with a minor suggestion

@motus motus merged commit 6ca1dba into microsoft:main Jun 28, 2024
11 of 12 checks passed
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.

2 participants