question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: missing a required argument: 'position_measure'

See original GitHub issue

I am trying to use the Metrics Example: https://stonesoup.readthedocs.io/en/latest/auto_examples/Metrics.html But I am getting this error:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
[<ipython-input-11-e0641a4bc732>](https://localhost:8080/#) in <module>()
      1 from stonesoup.metricgenerator.tracktotruthmetrics import SIAPMetrics
      2 
----> 3 siap_generator = SIAPMetrics(position_mapping=[0, 2], velocity_mapping=[1, 3]) # trocaram mapping por measure
      4 #siap_generator = SIAPMetrics(position_measure=[0, 2], velocity_measure=[1, 3])

4 frames
[/usr/lib/python3.7/inspect.py](https://localhost:8080/#) in _bind(self, args, kwargs, partial)
   2928                             msg = 'missing a required argument: {arg!r}'
   2929                             msg = msg.format(arg=param.name)
-> 2930                             raise TypeError(msg) from None
   2931             else:
   2932                 # We have a positional argument to process

TypeError: missing a required argument: 'position_measure'

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
oharrald-Dstlcommented, Feb 10, 2022

Yes, same issue here. metric for metric in metrics is looping through the keys of the metrics dictionary. None of the keys have .title so checking if .title == "OSPA distances" won’t find anything. Change the line to: ospa_metric = metrics["OSPA distances"]

1reaction
oharrald-Dstlcommented, Feb 10, 2022

If this is on the latest version of Stone Soup main, metrics are returned as a dictionary. Therefore when iterating through metrics, you will be looping through the dictionary’s keys. Attempting to call metric.title leads to your error it seems. Could you try replacing that loop with the following:

for metric_name, value in metrics.items(): \tif not any(s in metric_name for s in ('SIAP', 'OSPA', 'plot')): \t\tprint(f"{metric_name}: {value}")

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: missing 1 required positional argument: 'self'
The Python "TypeError: missing 1 required positional argument: 'self'" occurs when we call a method on the class instead of on an instance...
Read more >
TypeError: missing 1 required position argument in Python ...
The problem here is that you call that method as a static one. you need to use self instead of Foo. in run_calculation()...
Read more >
Python missing 1 required positional argument: 'self' Solution
The “missing 1 required positional argument: 'self'” error is raised when you do not instantiate an object of a class before calling a...
Read more >
TypeError: Missing required positional arguments
Python requires that all position arguments (value only, not name=value) must appear in the argument list first, followed by the named arguments ......
Read more >
How to resolve 'missing 1 required positional argument ...
The "TypeError: fit() missing 1 required positional argument: 'y'" error typically occurs when calling the fit method of a machine learning model in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found