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

Function create_consts_str

graph.py:3036–3045  ·  view source on GitHub ↗
(g: Graph, s: str)

Source from the content-addressed store, hash-verified

3034
3035
3036def create_consts_str(g: Graph, s: str) -> Union[Ratio, Angle]:
3037 if 'pi/' in s:
3038 n, d = s.split('pi/')
3039 n, d = int(n), int(d)
3040 p0, _ = g.get_or_create_const_ang(n, d)
3041 else:
3042 n, d = s.split('/')
3043 n, d = int(n), int(d)
3044 p0, _ = g.get_or_create_const_rat(n, d)
3045 return p0
3046
3047
3048def create_consts(g: Graph, p: gm.Node) -> Union[Ratio, Angle]:

Callers

nothing calls this directly

Calls 2

Tested by

no test coverage detected