quetzal.model.model module
- class quetzal.model.model.Model(json_database=None, json_folder=None, hdf_database=None, zip_database=None, zippedpickles_folder=None, omitted_attributes=(), only_attributes=None, *args, **kwargs)[source]
Bases:
quetzal.model.integritymodel.IntegrityModel
- plot(attribute, ticks=False, basemap_url=None, zoom=12, title=None, fontsize=24, fname=None, basemap_raster=None, keep_ax_limits=True, north_arrow=None, scalebar=None, *args, **kwargs)[source]
- read_json_database(json_database)[source]
Load model from its json_database representation. :param stepmodel: :param json_database: the json_database model representation :type json_database: json
- Returns
None
- to_frames(omitted_attributes=(), only_attributes=None)[source]
export the full model to a dataframe dict
- to_hdf(filepath, omitted_attributes=(), only_attributes=None)[source]
export the full model to a hdf database
- to_json(folder, omitted_attributes=(), only_attributes=None, verbose=False, encoding='utf-8', use_fiona=True)[source]
export the full model to a hdf database
- to_json_database()[source]
Dumps the model into a single json organized as follow: json_database = {
- ‘geojson’: { # Contains all GeoDataFrame objects
key: value
}, ‘pd_json’: { # Contains all DataFrame objects but GeoDataFrame
key: value
}, ‘json’: { # Contains all other objects (model parameters)
key: value
}
} :param stepmodel:
- Returns
the single json representation of the model
- Return type
json_database (json)
- quetzal.model.model.authorized_column(df, column, authorized_types=(<class 'str'>, <class 'int'>, <class 'float'>))[source]
- quetzal.model.model.merge(left, right, suffixes=['_left', '_right'], how='inner', reindex=True, clear=True)[source]