einsteinpy
diagrams
einsteinpy | diagrams | |
---|---|---|
1 | 2 | |
585 | 0 | |
1.2% | - | |
4.6 | 7.5 | |
19 days ago | 4 months ago | |
Python | Python | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
einsteinpy
diagrams
-
Penrose – Penrose
Yeah :( To be honest, I think we got a bit overeager about this one, since none of us on the project are chemistry experts. At least for the front page, we should probably replace that with a different diagram from our registry.
I think this is actually a fairly deep issue with our approach where we try to express everything in terms of numerical optimization, pairwise energies on shapes, etc. Especially since Style is not a Turing-complete programming language and also doesn't support calling out to existing libraries written in, e.g., JavaScript, there isn't a way to do actually-correct layout of the caffeine molecule, so instead we do the "lazy" thing and just try to make the atoms not overlap. To anyone who actually knows what a caffeine molecule looks like, obviously this looks ridiculous.
In the same vein as the other HN comment about separation of substance and style, I think we could do a much better job on chemistry diagrams by actually placing the atoms where they should be in 3D space, then projecting onto a 2D SVG diagram. To illustrate what I mean, consider this other diagram in our registry, showing a methane combustion reaction: https://penrose.cs.cmu.edu/try/?examples=structural-formula/...
As you can see on that example, the methane molecule looks weird because all the bonds are drawn "below" the carbon atom, and the carbon dioxide molecule is all bent out of shape. In contrast, you can make the diagram both easier to specify https://github.com/samestep/diagrams/blob/3d7fe855b3a9634d17... (compared to the 70-line Penrose Substance file) and also more correct: https://raw.githubusercontent.com/samestep/diagrams/2c8fb334...
In general I think that a general-purpose text-based diagramming tool needs to support a variety of different layout engines.
What are some alternatives?
xhorizon - xhorizon: A python package for the explicit computation and drawing of Penrose diagrams in general relativity.
processing - Source code for the Processing Core and Development Environment (PDE)
spyce - Python library for space enthusiasts
pikchr - Mirror for Pikchr
d2 - D2 is a modern diagram scripting language that turns text to diagrams.
poliastro - poliastro - :rocket: Astrodynamics in Python
penrose - Create beautiful diagrams just by typing notation in plain text.