linopy.io.read_netcdf#
- linopy.io.read_netcdf(path, **kwargs)#
Read in a model from a netcdf file.
- Parameters:
path (
path_like) – Path of the stored model.**kwargs – Keyword arguments passed to
xarray.load_dataset.
- Returns:
m (
linopy.Model)
Notes
Variables, expressions and constraints are restored in the insertion order stored by
to_netcdf(). Files written by earlier versions carry no order and are loaded in sorted name order.The SOS reformulation lifecycle token is not persisted by
to_netcdf(). If the saved model was in reformulated form, the deserialized Model is too, butModel.undo_sos_reformulation()is a no-op on it.