saveMRDI xThis function serializes a Macaulay2 object into a JSON string following the MRDI file format specification. The output includes a namespace (_ns) identifying the software system and its version, a type descriptor (_type), and the data.
For parametric types such as PolynomialRing, RingElement, Ideal, and Matrix, the type descriptor includes a params field referencing the parent ring. Rings and other objects marked with UseID are assigned UUIDs so that multiple objects sharing the same ring refer to it by UUID rather than repeating its full description.
We may serialize a simple integer.
|
We can also serialize a polynomial ring element.
|
|
|
Ideals are serialized similarly.
|
|
The output can be written directly to a file using the FileName option.
|
|
|
The Namespace option selects a different namespace for serialization, such as OSCAR.
|
Setting ToString => false returns the hash table representation instead of a JSON string. This
|
To see which types have built-in save methods for a given namespace, call methods as follows.
|
|
Additional types can be supported by calling addSaveMethod.
Not all Macaulay2 types have save methods defined. Attempting to serialize an unsupported type will produce an error. Quotient rings other than finite prime fields are not yet supported.
The object saveMRDI is a method function with a single argument.
The source of this document is in /build/reproducible-path/macaulay2-1.26.05+ds/M2/Macaulay2/packages/MRDI.m2:577:0.