pygeochemtools.utils

Utilities submodule

pygeochemtools.utils.app_logger

Logging utility

pygeochemtools.utils.app_logger.get_file_handler()[source]

Log file handler.

Returns

Log FileHandler object.

Return type

FileHandler

pygeochemtools.utils.app_logger.get_logger(name: str)[source]

Get logger call.

Parameters

name (str) – Module name

Returns

Return Logger object

Return type

Logger

pygeochemtools.utils.app_logger.get_stream_handler()[source]

Log stream handler.

Returns

Log StreamHandler object

Return type

TextIO

pygeochemtools.utils.config

User config helpers

class pygeochemtools.utils.config.Config[source]

Bases: object

Load user configuration object

__init__() None[source]

Store and load user config

property column_names

Return configured column names

property crustal_abund

Return configured crustal abundance values

property extent

Return configured map extent

get_config()[source]

Read config.

Loads user config from the user_config.yml located in the pygeochemtools.data module

property path_to_config

Return path to configuration file

property places

Return configured place names and coordinates

property projection

Return configured map projection

pygeochemtools.utils.export

Export helper functions

pygeochemtools.utils.export.export_dataset(df: pandas.DataFrame, label: str, path: Optional[str] = None, out_path: Optional[str] = None) None[source]

Export DataFrame to csv dataset.

Parameters
  • df (pd.DataFrame) – Dataframe to export.

  • label (str) – Output file name label.

  • path (str) – Input file location.

  • out_path (str) – File location to export to, if different from import path. Defaults to None