Commit 565f62d8 authored by Stephen Thompson's avatar Stephen Thompson

Issue #3 passed command line args

parent f4692e7d
Pipeline #2408 failed with stages
in 18 minutes and 41 seconds
......@@ -27,6 +27,15 @@ def main(args=None):
help="Write the fitted sphere to file"
)
# ADD OPTINAL ARGUMENTS
parser.add_argument("-c", "--config",
required=False,
type=str,
default="",
help="An optional configuration file."
)
version_string = __version__
friendly_version_string = version_string if version_string else 'unknown'
parser.add_argument(
......@@ -38,4 +47,4 @@ def main(args=None):
args = parser.parse_args(args)
run_demo(args.model, args.output)
run_demo(args.model, args.output, args.config)
......@@ -29,8 +29,8 @@ def run_demo(model_file_name, output="", configfile=False):
bounds = configuration.get("bounds")
if "fixed radius" in configuration:
radius = configuration.get("fixed radius")
bounds = ((-inf, -inf, -inf, radius),
(inf, inf, inf, radius))
bounds = ((-inf, -inf, -inf, radius - 1e-6),
(inf, inf, inf, radius + 1e-6))
result = sphere_fitting.fit_sphere_least_squares(x_values,
y_values,
......@@ -39,6 +39,7 @@ def run_demo(model_file_name, output="", configfile=False):
bounds=bounds)
print("Result is {}".format(result))
print("Result is", result.x)
if output != "":
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment