-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3D plot atoms are black without shading or lighting #53
Comments
Analysis 2Comparing Python envs dependency versions between used ase-notebook commit's L=requirements-lock-dev.txt and used Python env R=requirements.txt from this issue, post 1.
Creating a second venv, called A diff on !pip list | grep -e "ipy" -e "jupyter" -e "notebook" -e "threejs" -e "svg" -e "ase"
ase 3.22.1
ase-notebook 0.3.2 /Users/wasmer/src/github.com/philipprue/ase-notebook
ipydatawidgets 4.3.3
ipykernel 6.23.1
ipython 8.13.2
ipython-genutils 0.2.0
ipywidgets 7.7.5
jupyter_client 8.2.0
jupyter_core 5.3.0
jupyter-events 0.6.3
jupyter_server 2.6.0
jupyter_server_terminals 0.4.4
jupyterlab-pygments 0.2.2
jupyterlab-widgets 1.1.4
notebook 6.5.4
notebook_shim 0.2.3
pythreejs 2.4.2
scipy 1.10.1
svglib 0.9.4
svgwrite 1.4.3 Repeating the MWE in a Jupyter notebook with this env, instead, failed in showing the 3D plot altogether, instead this warning was printed.
In the shell running the notebook server, this exception ocurred.
|
Analysis 3
TODO investigate. |
Solution attempt 1Status: FAILED. Tried to create yet a third Python environment, this one called python -m venv venv3
source venv3/bin/activate
pip install --upgrade pip
pip install -r requirements-lock-dev.txt Errour output.
|
Solution attempt 2Status: TODO. Downgrade all visualization-relevant packages until issue disappears. Packages included: all from |
Analysis 4Document side issues of generating Noticed that in both environments Sometimes, plot does not appeear, rerun cell, plot appears. Sometimes need to restart kernel instead, and skip previous viz cells. Problems.
|
Analysis 5Debug ase-notebook w.r.t. threejs ambient light setting. This was done in environment The "black atoms" plots looks like the ambient light is missing. In ase-notebook 3D plots, this is set in So, debug Strange: Just plotted the final visualization objects created in Selectively removing components from the |
Solution attempt 3Status: FAILED. Recreate environment from Since recreating original ase-notebook dev environment directly with I did that this way. 1) Duplicate This process gave me this # # install_require and extras_require matched to requirements-lock-dev.txt versions
# # of threejs 3D plot dependencies (-e "ipy" -e "jupyter" -e "threejs" -e "ase")
install_requires=[
# core
"ase==3.18.1",
"attrs==19.3.0",
# "numpy==1.16.5",
# used for color-map
# TODO use color-map package, with no matplotlib dependency?
"matplotlib==3.1.1",
# svg
"svgwrite==1.3.1",
# #
# # additional dependencies relevant for threejs 3D plots, with
# # pinned versions from requirements-lock-dev. defined as:
# # pip list | grep -e "ipy" -e "jupyter" -e "threejs" -e "ase"
# #
"ipydatawidgets==4.0.1", # via pythreejs
"ipykernel==5.1.3", # via ipywidgets, notebook
"ipython==7.9.0", # via ipykernel, ipywidgets
"ipython-genutils==0.2.0", # via nbformat, notebook, traitlets
"ipywidgets==7.5.1", #
"jupyter-client==5.3.4", # via ipykernel, notebook
"jupyter-core==4.6.1", # via jupyter-client, nbconvert, nbformat, notebook
"jupyterlab", #
"pythreejs==2.1.1", #
# try resolving jupyter notebook not working
"jinja2==2.10.3",
"markupsafe==1.1.1",
],
extras_require={
"threejs": ["pythreejs==2.1.1", "ipywidgets==7.5.1"],
"svgconcat": ["svgutils==0.3.1"],
# "svg2pdf": ["svglib==0.9.3", "reportlab==3.5.32"],
"svg2pdf": ["svglib==0.9.3"],
"testing": [
"coverage==4.5.4",
"pytest==3.10.1",
"pytest-cov==2.8.1",
# "pytest-regressions",
],
"code_style": [
"black==19.3b0",
"pre-commit==1.17.0",
"flake8==3.7.9",
"doc8==0.8.0",
"pygments==2.0.2",
],
"flake8_plugins": [
"flake8-comprehensions==3.0.1",
"flake8-docstrings==1.5.0",
"flake8_builtins==1.4.1",
"import-order==0.0.11",
],
"docs": [
"sphinx==2.2.1",
"sphinx_rtd_theme==0.4.3",
"ipypublish==0.10.10",
"ipython==7.9.0",
],
}, I expected that these would recreate as exactly as possible the orginal dev environment, so the ase-notebook 3D plots are most likely to work there. However,
I declare this attempt at more accurate reproduction of original ase-notebook dev env on my computer with To resolve the original issue, continue to use env called |
Solution attempt 4Status: FAILED. Copied env
Then downgraded other dependencies one by one, down to those of ase-notebook dev env's version: Giving up for now. Maybe try again in env Problem is that I have no environment right now where ase-notebook 3D plots are actually working, so that I could compare the "sould" with the "is" case. Giving up for now, return to this later. |
Solution attempt 5STATUS: SUCCESS. But only as a temporary fix. Looked into Here, user "moorepants" reports the same JS error that I have described with interface Here, user "moorepants" reports that they could resolve the issue with a temporary fix of pinning certain
Further below in that issue's comment thread, there are some more package version pinning suggestions. It tried out the suggested version pinning above in a new branch However, in the shell running the Jupyter server, the
Nevertheless, it seems that using this branch This |
Description
In a Jupyter notebook,
ase_view.make_render(atoms)
, which usespythreejs
(versionpythreejs==2.4.2
) underneath, paints atoms as black spheres, with no lighting or shading. Plotting the same node with ASE standard viewer instead, in the same Python environment, paints atoms with lighting and shading (ase.visualize.view(atoms, viewer='x3d')
). So, this concerns the pythreejs 3D plots, not the SVG 2D plots. Those work without issues. At first glance, it looked as if the ambient light might be missing. See attached screenshot. But that was not it, see below.Minimal working example (MWE)
Install Python environment as described below.
Then run ase-notebook by. example. In the pythreejs plots, the atoms should appear black, in the SVG plots they appear in the right color.
System & version info
ase-notebook v0.3.1, fork PhilippRue/ase-notebook, latest commit.
Created virtualenv environment for
ase-notebook
from itssetup.py
with Python version 3.10.9. Note: Did not install all extras at once (pip install -e ".[threejs,svgconcat,svg2pdf,testing,code_style,flake8_plugins,docs]"
) casue that led to unresolved environment.Resulted in environment
pip freeze >
requirements.txt.Analysis 1
All tests passed.
The colors are there.
This also means that the underlying
data.load_data_file
function works irrespective of the removal of dependencyimportlib_resources
in that commit. Tested it with version before and after that change, same behavior.Currently suspect that it the cause is a newer version with some of the dependencies involved in the 3D plotting, maybe
pythreejs
,ipywidgets
, etc. Will try to downgrade some of them and see if the issue disappears.The text was updated successfully, but these errors were encountered: