config module
The apsg.config module provides a hierarchical configuration system based on dataclasses with a Mapping mixin. The global instance apsg_conf is used throughout APSG to control defaults for notation, rounding, figure properties, and plotting defaults.
Usage
Access configuration values using dot notation:
>>> from apsg.config import apsg_conf
>>> apsg_conf.ndigits
3
>>> apsg_conf.stereonet.kind
'equal-area'
>>> apsg_conf.stereonet_point.mfc
>>> apsg_conf.roseplot.bins
36
Modify values in-place:
>>> apsg_conf.ndigits = 5
>>> apsg_conf.stereonet.kind = 'equal-angle'
>>> apsg_conf.roseplot_bars.ec = 'gray'
The Mapping interface enables dict-like access:
>>> apsg_conf['figsize']
(8, 6)
>>> dict(apsg_conf.stereonet)
{...}
Use update() for bulk updates from a dictionary. Nested configs are updated recursively:
>>> apsg_conf.update({'ndigits': 4, 'stereonet': {'kind': 'equal-area'}})
To obtain a plain dictionary (e.g. to pass as **kwargs), call copy():
>>> kwargs = apsg_conf.stereonet_point.copy()
>>> kwargs['mfc'] = 'red'
Classes
Classes:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- class apsg.config.BaseConfig
Bases:
Mapping
- class apsg.config.StereonetMarkerConfig(alpha: Any = None, color: Any = None, mec: Any = None, mfc: Any = None, ls: str = 'none', marker: str = 'o', mew: int = 1, ms: int = 6)
Bases:
BaseConfig
- class apsg.config.StereonetConfig(kind: str = 'equal-area', overlay_position: tuple[float, float, float, float]=(0, 0, 0, 0), rotate_data: bool = False, minor_ticks: Any = None, major_ticks: Any = None, overlay: bool = True, overlay_step: int = 15, overlay_resolution: int = 181, clip_pole: int = 15, hemisphere: str = 'lower', grid_type: str = 'gss', grid_n: int = 3000, tight_layout: bool = False, title_kws: dict = <factory>)
Bases:
BaseConfig
- class apsg.config.StereonetPointConfig(alpha: Any = None, color: Any = None, mec: Any = None, mfc: Any = None, ls: str = 'none', marker: str = 'o', mew: int = 1, ms: int = 6)
Bases:
StereonetMarkerConfig
- class apsg.config.StereonetVectorConfig(alpha: Any = None, color: Any = None, mec: Any = None, mfc: Any = None, ls: str = 'none', marker: str = 'o', mew: int = 2, ms: int = 6)
Bases:
StereonetMarkerConfig
- class apsg.config.StereonetGreatCircleConfig(alpha: Any = None, color: Any = None, ls: str = '-', lw: float = 1.5)
Bases:
BaseConfig
- class apsg.config.StereonetArcConfig(alpha: Any = None, color: Any = None, ls: str = '-', lw: float = 1.5)
Bases:
BaseConfig
- class apsg.config.StereonetScatterConfig(alpha: Any = None, s: Any = None, c: Any = None, linewidths: float = 1.5, marker: str = 'o', cmap: Any = None, legend: bool = False, num: str = 'auto')
Bases:
BaseConfig
- class apsg.config.StereonetConeConfig(alpha: Any = None, color: Any = None, ls: str = '-', lw: float = 1.5)
Bases:
BaseConfig
- class apsg.config.StereonetPairConfig(alpha: Any = None, color: Any = None, ls: str = '-', lw: float = 1.5, line_marker: str = 'o')
Bases:
BaseConfig
- class apsg.config.StereonetFaultConfig(alpha: Any = None, color: Any = None, ls: str = '-', lw: float = 1.5)
Bases:
BaseConfig
- class apsg.config.StereonetHoeppnerConfig(alpha: Any = None, color: Any = None, mec: Any = None, mfc: Any = None, ls: str = 'none', marker: str = 'o', mew: int = 1, ms: int = 5)
Bases:
StereonetMarkerConfig
- class apsg.config.StereonetArrowConfig(color: Any = None, width: int = 2, headwidth: int = 5, pivot: str = 'mid', units: str = 'dots')
Bases:
BaseConfig
- class apsg.config.StereonetTensorConfig(planes: bool = True, alpha: Any = None, color: Any = None, ls: str = '-', lw: float = 1.5, marker: str = 'o', mew: int = 1, ms: int = 9)
Bases:
BaseConfig
- class apsg.config.StereonetStressConfig(alpha: Any = None, color: Any = None, ls: str = 'none', marker: str = '*', mew: int = 1, ms: int = 12)
Bases:
BaseConfig
- class apsg.config.StereonetContourConfig(alpha: Any = None, antialiased: bool = True, method: str = 'sph', n_max: int = 6, cmap: str = 'Greys', levels: int = 6, clines: bool = True, linewidths: float = 1, linestyles: Any = None, colorbar: bool = False, trimzero: bool = True, sigma: Any = None, sigmanorm: bool = True, show_data: bool = False, data_kws: dict = <factory>)
Bases:
BaseConfig
- class apsg.config.RoseplotConfig(bins: int = 36, density: bool = True, arrowness: float = 0.95, rwidth: float = 1, scaled: bool = False, kappa: int = 250, pdf_res: int = 901, title: Any = None, grid: bool = True, grid_kws: dict = <factory>, tight_layout: bool = False, title_kws: dict = <factory>)
Bases:
BaseConfig
- class apsg.config.RoseplotBarConfig(alpha: Any = None, color: Any = None, ec: Any = None, fc: Any = None, ls: str = '-', lw: float = 1.5, legend: bool = False)
Bases:
BaseConfig
- class apsg.config.RoseplotPdfConfig(alpha: Any = None, color: Any = None, ec: Any = None, fc: Any = None, ls: str = '-', lw: float = 1.5, legend: bool = False)
Bases:
BaseConfig
- class apsg.config.RoseplotMuciConfig(confidence_level: int = 95, alpha: Any = None, color: str = 'r', ls: str = '-', lw: float = 1.5, n_resamples: int = 9999)
Bases:
BaseConfig
- class apsg.config.FabricplotConfig(ticks: bool = True, n_ticks: int = 10, tick_size: float = 0.2, margin: float = 0.05, grid: bool = True, grid_color: str = 'k', grid_style: str = ':', title: Any = None, tight_layout: bool = False, title_kws: dict = <factory>)
Bases:
BaseConfig
- class apsg.config.FabricplotPointConfig(alpha: Any = None, color: Any = None, mec: Any = None, mfc: Any = None, ls: str = 'none', marker: str = 'o', mew: int = 1, ms: int = 8)
Bases:
BaseConfig
- class apsg.config.FabricplotPathConfig(alpha: Any = None, color: Any = None, ls: str = '-', lw: float = 1.5, marker: Any = None, mec: Any = None, mew: int = 1, mfc: Any = None, ms: int = 6)
Bases:
BaseConfig
- class apsg.config.AppConfig(notation: str = 'dd', vec2geo: bool = False, ndigits: int = 3, figsize: tuple = (8, 6), dpi: int = 100, facecolor: str = 'white', stereonet: apsg.config.StereonetConfig = <factory>, stereonet_point: apsg.config.StereonetPointConfig = <factory>, stereonet_vector: apsg.config.StereonetVectorConfig = <factory>, stereonet_great_circle: apsg.config.StereonetGreatCircleConfig = <factory>, stereonet_arc: apsg.config.StereonetArcConfig = <factory>, stereonet_scatter: apsg.config.StereonetScatterConfig = <factory>, stereonet_cone: apsg.config.StereonetConeConfig = <factory>, stereonet_pair: apsg.config.StereonetPairConfig = <factory>, stereonet_fault: apsg.config.StereonetFaultConfig = <factory>, stereonet_hoeppner: apsg.config.StereonetHoeppnerConfig = <factory>, stereonet_arrow: apsg.config.StereonetArrowConfig = <factory>, stereonet_tensor: apsg.config.StereonetTensorConfig = <factory>, stereonet_stress: apsg.config.StereonetStressConfig = <factory>, stereonet_contour: apsg.config.StereonetContourConfig = <factory>, roseplot: apsg.config.RoseplotConfig = <factory>, roseplot_bar: apsg.config.RoseplotBarConfig = <factory>, roseplot_pdf: apsg.config.RoseplotPdfConfig = <factory>, roseplot_muci: apsg.config.RoseplotMuciConfig = <factory>, fabricplot: apsg.config.FabricplotConfig = <factory>, fabricplot_point: apsg.config.FabricplotPointConfig = <factory>, fabricplot_path: apsg.config.FabricplotPathConfig = <factory>)
Bases:
BaseConfig
Default values
AppConfig
Field |
Default |
Description |
|---|---|---|
|
|
Notation for geological measurements ( |
|
|
Represent |
|
|
Rounding precision in |
|
|
Default figure size (width, height) |
|
|
Default figure DPI |
|
|
Default figure facecolor |
|
|
Stereonet projection parameters |
|
|
Default kwargs for point markers |
|
|
Default kwargs for pole markers |
|
|
Default kwargs for vector markers |
|
|
Default kwargs for great circles |
|
|
Default kwargs for arcs |
|
|
Default kwargs for scatter plots |
|
|
Default kwargs for cones |
|
|
Default kwargs for pairs |
|
|
Default kwargs for faults |
|
|
Default kwargs for Hoeppner plots |
|
|
Default kwargs for arrows |
|
|
Default kwargs for tensor plots |
|
|
Default kwargs for stress plots |
|
|
Default kwargs for contour plots |
|
|
Roseplot global parameters |
|
|
Default kwargs for roseplot bars |
|
|
Default kwargs for roseplot PDF |
|
|
Default kwargs for roseplot confidence interval |
|
|
Fabricplot global parameters |
|
|
Default kwargs for fabric plot points |
|
|
Default kwargs for fabric plot paths |
StereonetConfig
Field |
Default |
Description |
|---|---|---|
|
|
Projection type ( |
|
|
Overlay position as |
|
|
Rotate data together with overlay |
|
|
Minor tick spacing ( |
|
|
Major tick spacing ( |
|
|
Show grid overlay |
|
|
Grid step in degrees |
|
|
Grid resolution |
|
|
Clipped cone around poles (degrees) |
|
|
Hemisphere ( |
|
|
Contouring grid type ( |
|
|
Number of counting points in grid |
|
|
Matplotlib tight layout |
|
|
Keyword arguments for suptitle |
Marker sub-configs
These classes control the appearance of point-like markers on stereonet plots.
They all inherit from StereonetMarkerConfig.
Field |
|
|
|
|
|
|
|---|---|---|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Line sub-configs
These classes control the appearance of lines on stereonet plots.
Field |
|
|
|
|
|
|---|---|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StereonetScatterConfig
Field |
Default |
Description |
|---|---|---|
|
|
Transparency |
|
|
Marker size |
|
|
Marker color |
|
|
Edge line width |
|
|
Marker style |
|
|
Colormap |
|
|
Show legend |
|
|
Number of features shown |
StereonetArrowConfig
Field |
Default |
Description |
|---|---|---|
|
|
Arrow color |
|
|
Arrow width (dots) |
|
|
Arrow head width |
|
|
Pivot point ( |
|
|
Arrow units |
StereonetTensorConfig
Field |
Default |
Description |
|---|---|---|
|
|
Plot planes |
|
|
Transparency |
|
|
Color |
|
|
Line style |
|
|
Line width |
|
|
Marker style |
|
|
Marker edge width |
|
|
Marker size |
StereonetStressConfig
Field |
Default |
Description |
|---|---|---|
|
|
Transparency |
|
|
Color |
|
|
Line style |
|
|
Marker style (star) |
|
|
Marker edge width |
|
|
Marker size |
StereonetContourConfig
Field |
Default |
Description |
|---|---|---|
|
|
Transparency |
|
|
Antialiasing |
|
|
Contouring method ( |
|
|
Max contour level |
|
|
Colormap |
|
|
Number of contour levels |
|
|
Show contour lines |
|
|
Contour line width |
|
|
Contour line styles |
|
|
Show colorbar |
|
|
Trim zero contours |
|
|
Sigma value for Kamb method |
|
|
Sigma normalization |
|
|
Show data points |
|
|
Keyword arguments for data points |
RoseplotConfig
Field |
Default |
Description |
|---|---|---|
|
|
Number of bins |
|
|
Use density instead of counts |
|
|
Arrow shape factor |
|
|
Bar relative width |
|
|
Bins scaled by area |
|
|
Von Mises shape parameter |
|
|
PDF resolution |
|
|
Plot title |
|
|
Show grid lines |
|
|
Keyword arguments for |
|
|
Matplotlib tight layout |
|
|
Keyword arguments for suptitle |
RoseplotBarConfig / RoseplotPdfConfig
Field |
Default |
Description |
|---|---|---|
|
|
Transparency |
|
|
Color |
|
|
Edge color |
|
|
Face color |
|
|
Line style |
|
|
Line width |
|
|
Show legend |
RoseplotMuciConfig
Field |
Default |
Description |
|---|---|---|
|
|
Confidence level (percent) |
|
|
Transparency |
|
|
Color (red) |
|
|
Line style |
|
|
Line width |
|
|
Number of resamples |
FabricplotConfig
Field |
Default |
Description |
|---|---|---|
|
|
Show ticks |
|
|
Number of ticks per axis |
|
|
Tick size |
|
|
Plot margin |
|
|
Show grid |
|
|
Grid line color |
|
|
Grid line style (dotted) |
|
|
Plot title |
|
|
Matplotlib tight layout |
|
|
Keyword arguments for suptitle |