Closed janosh closed 9 months ago
Thanks for this summary. I think next step here is to make sure these are working, and add to automated testing (e.g., making sure they run without console errors).
Quick impressions:
apps/examples/phase_diagram.py
probably affected by #264, because a lot of PD improvements were implemented initially in web
and have not been upstreamed. It could benefit a lot from the kind of work that was done for the Pourbaix app, which is a lot cleaner comparatively speaking (which is why I expect the Pourbaix demo still works too)apps/examples/structure_magnetic.py
looks like a trivial MPRester / document model changeapps/examples/write_structure_screenshot_to_file.py
this isn't really a real "app" but is a workaround for not being able to generate crystal images via script, since the rendering is done in-browser and requires a WebGL context, nevertheless not sure what the error is here -- the MP team will eventually have to tackle this issue to generate images as new materials are added to the MP websiteRe: the screenshot generation script: There previously was an imageRequest
property within the CrystalToolkitScene
component in mp-react-components
. At some point in the last two years that property and the associated hooks were removed from mp-react-components
, I haven't found the exact commit this occurred at yet so I'm not sure what the reason was for removing it.
I had to re-introduce the imageRequest
prop for a recent ad hoc image generation script for new structures. So it could be worth a deeper look.
Sorry @tsmathis, sounds frustrating!
I can offer some background on those props for context. Basically, there are two ways of handling a screenshot or 3D model export. Both of these ways can, in principle, be used together:
I don't remember exactly, but I think potentially 1. was removed in favor of 2.? I think the capability was always there somehow, it was just a question of whether it was done client-side or server-side.
Regardless of outcome, the ultimate aim was to add both some legend tiles + a credit string to the image via Pillow
, as a polite nudge to people to remember to credit the source of the image when it's re-used. This was on the backlog.
Total example apps:
Found 6 broken out of 8 tested
apps/examples/pourbaix.py
apps/examples/structure.py
apps/examples/phase_diagram.py
apps/examples/relaxation_trajectory.py
apps/examples/structure_magnetic.py
apps/examples/transformations_minimal.py
apps/examples/transformations.py
apps/examples/write_structure_screenshot_to_file.py
Below are app screenshots.
✅
apps/examples/pourbaix.py
✅
apps/examples/structure.py
💀
apps/examples/phase_diagram.py
💀
apps/examples/relaxation_trajectory.py
💀
apps/examples/structure_magnetic.py
💀
apps/examples/transformations_minimal.py
💀
apps/examples/transformations.py
💀
apps/examples/write_structure_screenshot_to_file.py