Closed kalebphipps closed 3 months ago
This was due to installing ARTIST
in a non-editable manner and not explicitly defining all subpackages in the project. tool
. When installed with -e
, this isn't a problem, but without this option Jupyter struggles to import things.
The fix is
[tool.setuptools]
packages = ["artist","artist.field","artist.raytracing","artist.scene","artist.util"]
Describe the bug The
ARTIST
package structure is leading to circular imports or module not-found errors on certain systems. Locally, everything works as desired. However, there are two cases where this error occurs.To reproduce Case One - Sphinx:
docs
folder in a local clone of the repository.sphinx-build -b html . _build
in the terminal.The docs compile. However, sphinx throws a warning:
“WARNING: Cannot resolve cyclic import: artist, artist.scenario, artist.field.heliostat_field, artist.field, artist.field.heliostat_field”
Case Two - Google Colab:
First - Open the notebook in Google Colab:
ARTIST
repository.maintenance/tutorials_and_docs
branch.tutorials/01_heliostat_raytracing_notebook.ipynb
. Note, you cannot save changes of this notebook to GitHub, if you want to make changes either save a copy of the notebook or make these changes locally and push them to GitHub later.Second - Generate a GitHub Access Token (only necessary whilst the
ARTIST
repo remains private:Third - Adjust the install command of
ARTIST
in the notebook to include your token:!pip
to have the following form:Finally - generate the error:
1 frames /usr/local/lib/python3.10/dist-packages/artist/scenario.py in
5 from typing_extensions import Self
6
----> 7 from artist.field.heliostat_field import HeliostatField
8 from artist.field.receiver_field import ReceiverField
9 from artist.scene.light_source_array import LightSourceArray
ModuleNotFoundError: No module named 'artist.field'