Reputation: 45
I was building a simulator for planets' orbits, and pyright is really helpful for highlighting mistakes automatically, but for some reason it doesn't understand perfectly working operations with astropy's units and keeps highlighting it as if they were incorrect.
How can I make pyright ignore these operations? It probably involves editing pyrightconfig.json according to the link in the image below, but I'm a noob in both json and pyright/pylance, so I didn't understand what I need to put in that file specifically.
Also, I don't know if that is a bug and I should report it, and if so, how do I do that?
Minimal code needed to reproduce:
from astropy import units
var = 3 * units.m
Upvotes: 0
Views: 345
Reputation: 9229
If you want to ignore this warning, you can do the following steps:
Use "Ctrl+Shift+P" and search "Preferences: Open User Settings(JSON)"
Then add the following codes to settings.json
:
"python.analysis.diagnosticSeverityOverrides": {
"reportGeneralTypeIssues": "none"
},
Upvotes: 1