TypeError: missing a required argument: 'position_measure'
See original GitHub issueI 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:
- Created 2 years ago
- Comments:8 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, same issue here.
metric for metric in metrics
is looping through the keys of themetrics
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"]
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 callmetric.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}")