MCPcopy Create free account
hub / github.com/google-deepmind/alphageometry / create_consts

Function create_consts

graph.py:3048–3057  ·  view source on GitHub ↗
(g: Graph, p: gm.Node)

Source from the content-addressed store, hash-verified

3046
3047
3048def create_consts(g: Graph, p: gm.Node) -> Union[Ratio, Angle]:
3049 if isinstance(p, Angle):
3050 n, d = p.name.split('pi/')
3051 n, d = int(n), int(d)
3052 p0, _ = g.get_or_create_const_ang(n, d)
3053 if isinstance(p, Ratio):
3054 n, d = p.name.split('/')
3055 n, d = int(n), int(d)
3056 p0, _ = g.get_or_create_const_rat(n, d)
3057 return p0 # pylint: disable=undefined-variable

Callers

nothing calls this directly

Calls 2

Tested by

no test coverage detected