Code works but some maths functions are marked red with warnings "Unresolved reference" #2976
Answered
by
dham
yusenguo
asked this question in
Firedrake support
-
Hi, Please see the atteched screenshot. This happened after I updated firedrake and python (to 3.10.11). My system is macOS Ventura13.1. The only import I use is 'from firedrake import * ' . Would you please help me fix this? |
Beta Was this translation helpful? Give feedback.
Answered by
dham
Jun 15, 2023
Replies: 2 comments 5 replies
-
Is your editor set up to use the firedrake virtual environment? |
Beta Was this translation helpful? Give feedback.
5 replies
-
I think you are right that the 'star import' might be the problem because when I try importing firedrake as fd and using fd.dot() etc. doesn't give a warning. However, the screenshot is Pycharm and I also tried in VScode where the problem still exists.
Any idea on why this is the case?
…________________________________
From: Lawrence Mitchell ***@***.***>
Sent: Friday, June 9, 2023 2:34:33 PM
To: firedrakeproject/firedrake ***@***.***>
Cc: Guo, Yusen ***@***.***>; Author ***@***.***>
Subject: Re: [firedrakeproject/firedrake] Code works but some maths functions are marked red with warnings "Unresolved reference" (Discussion #2976)
This email from ***@***.*** originates from outside Imperial. Do not click on links and attachments unless you recognise the sender. If you trust the sender, add them to your safe senders list<https://spam.ic.ac.uk/SpamConsole/Senders.aspx> to disable email stamping for this address.
It's possible that pyright (it looks like you are using vscode?) can't find the UFL functions through firedrake's "star" import.
—
Reply to this email directly, view it on GitHub<#2976 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AOHZETVV6K37WVNA4G57XILXKMQ6TANCNFSM6AAAAAAZAQWMHE>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The errors are from a static analysis tool that the IDE (Pycharm or VSCode) is running. It's not uncommon for star imports to cause this issue. It's essentially a Python limitation.