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

change_epsg(epsg, coordinates_unit)[source]
copy()[source]
describe()[source]
memory_usage(head=10)[source]
merge(*args, **kwargs)[source]
merge_attribute(attr, keys=None)[source]
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_hdf(filepath, omitted_attributes=(), only_attributes=None)[source]
read_json(folder, encoding='utf-8')[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

read_zip(filepath, omitted_attributes=(), only_attributes=None)[source]
read_zippedpickles(folder, omitted_attributes=(), only_attributes=None)[source]
split_attribute(attr, by=None, nchunks=None, drop=True)[source]
to_excel(filepath, prefix='stack')[source]
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)

to_zip(filepath, complevel=None, *args, **kwargs)[source]
to_zipped_hdf(filepath, *args, **kwargs)[source]
to_zippedpickles(folder, omitted_attributes=(), only_attributes=None, max_workers=1, complevel=- 1, remove_first=True)[source]
quetzal.model.model.authorized_column(df, column, authorized_types=(<class 'str'>, <class 'int'>, <class 'float'>))[source]
quetzal.model.model.log(text, debug=False)[source]
quetzal.model.model.merge(left, right, suffixes=['_left', '_right'], how='inner', reindex=True, clear=True)[source]
quetzal.model.model.obj_size_fmt(num)[source]
quetzal.model.model.read_hdf(filepath)[source]
quetzal.model.model.track_args(method)[source]