pterasoftware.save()

pterasoftware.save(
path: str | Path,
obj: object,
) None

Saves a Ptera Software object to a JSON file.

If the path ends with “.json.gz”, the output is gzip compressed automatically. Using “.json.gz” is highly recommended for all but the smallest unmeshed geometry objects. Gzip compression typically reduces file sizes by 10x or more, and plain “.json” files use indented formatting that further increases their size.

The file records an internal serialization format version. load() accepts a file only when that format version matches the running code’s exactly, and there is no migration of files written under a different format version. The format version is independent of the package version and bumps whenever the serialized structure changes. To read a saved file later, run a build of Ptera Software whose format version matches the file’s.

Parameters:
  • path – The file path to save to. Should end with “.json” or “.json.gz”.

  • obj – The Ptera Software object to save. Must be a public Ptera Software class (e.g., Airplane, SteadyProblem, or a solver). Internal classes such as Panel cannot be saved directly.

Returns:

None