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

Numeric arguments in __main__.py stored as list #111

Open
agitter opened this issue Mar 25, 2021 · 0 comments
Open

Numeric arguments in __main__.py stored as list #111

agitter opened this issue Mar 25, 2021 · 0 comments

Comments

@agitter
Copy link

agitter commented Mar 25, 2021

Numeric arguments, such as g, have nargs='*', which stores them as a list:

pcsf_params.add_argument("-g", dest="g", nargs="*", type=float, required=False, default=20,
help="Gamma: multiplicative edge penalty from degree of endpoints [default: 20]")

That causes the parameter checks in graph.py to fail because they are not numeric:

if not (isinstance(self.params.g, numbers.Number) and (self.params.g >= 0)): raise ValueError("parameter g must be a positive number. Was "+str(self.params.g))

Was the goal to support parameter sweeps from the command line? It looks like there either needs to be a loop over the calls to oi.Graph(args.edge_file, params) or these arguments should be stored as floats.

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

No branches or pull requests

1 participant