Skip to content

How to disable WARNING! There are options you set that were not used! #3770

Discussion options

You must be logged in to vote

Just tried it, doesn't work. However, your solution inspired me to come up with a solution of my own using sys.argv instead of argparse. Here are the contents of a test script which I've named script.py:

import sys

sys.argv.insert(-1, '-options_left')
sys.argv.insert(-1, '0')

print(sys.argv)

from firedrake import *

Next, I ran the command python script.py -opt arg HELLOWORLD as a test. The output of this command is:

['script.py', '-opt', 'arg', '-options_left', '0', 'HELLOWORLD']

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.

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
3 replies
@andrewlhicks
Comment options

@pbrubeck
Comment options

@andrewlhicks
Comment options

Comment options

You must be logged in to vote
3 replies
@andrewlhicks
Comment options

@connorjward
Comment options

@andrewlhicks
Comment options

Answer selected by andrewlhicks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants