I am trying to work with yt Project's unyt
, a Python package "for working with data that has physical units" (source).
When I try to import units using syntax like from unyt import degC
, PyCharm tells me Cannot find reference 'degC'
.
What am I doing wrong?
I have verified that unyt==2.7.1
is in my PyCharm interpreter.
What I See
Sample Code (to prove the code works at runtime)
from unyt import degC # Source: https://github.com/yt-project/unyt/issues/99#issue-477869520
t1 = 0 * degC
t1.convert_to_base()
print(t1)
Output: 273.15 K
Related Questions
Since the degC
class is added to the unyt
namespace at runtime, the deeper question is this: PyCharm: how to infer types of objects created at runtime
Versions
- Python:
3.7
- unyt:
2.7.1
- PyCharm:
2019.2.5 CE