How to disable WARNING! There are options you set that were not used! #3770
-
I use Firedrake by running a script that takes its own command line arguments. I think PETSc doesn't like this very much. Every time I run my code, I get the following warnings:
As mentioned here, these warnings can be suppressed by passing But quite frankly, I don't want to do that every single time I run my code. Is there possibly a line of code I can simply add into my script which has the same effect? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Why are you getting this warning? You are probably getting it from the combination of
Note that you need to pass your options with single hyphen when you run your script:
|
Beta Was this translation helpful? Give feedback.
-
The direct answer to your question is to pass
|
Beta Was this translation helpful? Give feedback.
Just tried it, doesn't work. However, your solution inspired me to come up with a solution of my own using
sys.argv
instead ofargparse
. Here are the contents of a test script which I've namedscript.py
:Next, I ran the command
python script.py -opt arg HELLOWORLD
as a test. The output of this command is:The warning I was receiving before is now gone. Not only that, but this solution doesn't mess up any listargs (such as
HELLOWORLD
) that may come after the normal options/args.