Attempt to convert sage.all.RR to floats and sage.all.ZZ to ints
(obj)
| 255 | |
| 256 | @staticmethod |
| 257 | def encode_as_sage(obj): |
| 258 | """Attempt to convert sage.all.RR to floats and sage.all.ZZ to ints""" |
| 259 | sage_all = get_module("sage.all") |
| 260 | if not sage_all: |
| 261 | raise NotEncodable |
| 262 | |
| 263 | if obj in sage_all.RR: |
| 264 | return float(obj) |
| 265 | elif obj in sage_all.ZZ: |
| 266 | return int(obj) |
| 267 | else: |
| 268 | raise NotEncodable |
| 269 | |
| 270 | @staticmethod |
| 271 | def encode_as_pandas(obj): |
nothing calls this directly
no test coverage detected