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

Can we supress unwanted warning? #226

Open
1 of 2 tasks
chaithyagr opened this issue Apr 14, 2022 · 1 comment
Open
1 of 2 tasks

Can we supress unwanted warning? #226

chaithyagr opened this issue Apr 14, 2022 · 1 comment

Comments

@chaithyagr
Copy link
Contributor

In modopt, we present a warning if the gradient and proximity operators dont come from the base classes. However, we do not have very simple basic classes yet given #113 . These warnings below come up in almost every iteration, which makes it very frustating.

Can we suppress it by default (personally I don't feel they add much value). Or can we maybe have user control over it through rc files (long shot though)?

if not any(parent in tree for parent in self._op_parents):
message = '{0} does not inherit an operator parent.'
warn(message.format(str(operator.__class__)))

Are you planning to submit a Pull Request?

  • Yes
  • No
@paquiteau
Copy link
Contributor

paquiteau commented Nov 14, 2022

Actually, you can do it on your end, using warnings.filterwarnings('ignore', module='modopt') will remove all warnings of the Modopt module. More possibility are available here: https://docs.python.org/3/library/warnings.html#warnings.filterwarnings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants