def from_json(cls, id_, info):
"""Convert JSON curve info into ``CurveInfo``.
This involves parsing the dictionary and converting some stringified
values (rationals and IEEE-754) to Python ``float``-s.
Args:
id_ (str): The ID of the curve.
info (dict): The JSON data of the curve.
Returns:
CurveInfo: The curve info parsed from the JSON.
"""
control_points = info.pop('control_points')
control_points = np.asfortranarray(_convert_float(control_points))
implicitized = info.pop('implicitized', None)
# Optional fields.
note = info.pop('note', None)
_ensure_empty(info)
return cls(id_, control_points, implicitized=implicitized, note=note)
评论列表
文章目录