Core Modules¶
core
¶
Functions:
-
get_config–Import the default configuration file and update custom settings.
-
get_obj_if_Acc–
Attributes:
fileHandler
module-attribute
¶
fileHandler = FileHandler(join(str(package_config['data_dir']), 'PPM.log'))
logFormatter
module-attribute
¶
logFormatter = Formatter('%(asctime)s [%(threadName)-12.12s] [%(levelname)-5.5s] %(message)s')
package_config
module-attribute
¶
package_config = {'custom_config': join(expanduser('~'), '.powerplantmatching_config.yaml'), 'data_dir': _data_dir, 'repo_data_dir': join(dirname(__file__), 'package_data'), 'downloaders': {}}
get_config
¶
get_config(filename=None, **overrides)
Import the default configuration file and update custom settings.
Parameters:
-
filename(str, default:None) –DESCRIPTION. The default is None.
-
**overrides(dict, default:{}) –DESCRIPTION.
Returns:
-
config(dict) –The configuration dictionary
duke
¶
Functions:
-
add_geoposition_for_duke–Returns the same pandas.Dataframe with an additional column "Geoposition"
-
duke–Run duke in different modes (Deduplication or Record Linkage Mode) to
add_geoposition_for_duke
¶
add_geoposition_for_duke(df)
Returns the same pandas.Dataframe with an additional column "Geoposition" which concats the latitude and longitude of the powerplant in a string
duke
¶
duke(datasets, labels=['one', 'two'], singlematch=False, showmatches=False, keepfiles=False, showoutput=False, threads=1)
Run duke in different modes (Deduplication or Record Linkage Mode) to either locate duplicates in one database or find the similar entries in two different datasets. In RecordLinkagesMode (match two databases) please set singlematch=True and use best_matches() afterwards
Parameters:
-
datasets(DataFrame or [DataFrame]) –A single dataframe is run in deduplication mode, while multiple ones are linked
-
labels([str], default:['one', 'two']) –Labels for the linked dataframe
-
singlematch–Only in Record Linkage Mode. Only report the best match for each entry of the first named dataset. This does not guarantee a unique match in the second named dataset.
-
keepfiles(boolean, default:False) –If true, do not delete temporary files
accessor
¶
Classes:
-
PowerPlantAccessor–Accessor object for DataFrames created with powerplantmatching.
PowerPlantAccessor
¶
PowerPlantAccessor(pandas_obj)
Accessor object for DataFrames created with powerplantmatching. This simplifies the access to common functions applicable to dataframes with powerplant data. Note even though this is a general DataFrame accessor, the functions will only work for powerplantmatching related DataFrames.
Examples:
import powerplantmatching as pm entsoe = pm.data.ENTSOE() entsoe.powerplant.plot_aggregated()
Methods:
-
get_name– -
match_with– -
plot_aggregated–Plotting function for fast inspection of the capacity distribution.
-
set_name–
plot_aggregated
¶
plot_aggregated(by=['Country', 'Fueltype'], figsize=(12, 20), **kwargs)
Plotting function for fast inspection of the capacity distribution. Returns figure and axes of a matplotlib barplot.
Parameters:
-
by(list, default:['Country', 'Fueltype']) –Define the columns of the dataframe to be grouped on.
-
figsize(tuple, default:(12,20)) –width and height of the figure
-
**kwargs–keywordargument for matplotlib plotting