dataclass.geoProfiles

Classes

class dataclass.geoProfiles.Profile1D

Define a 1D profile of geological layer.

Methods:

__init__(top: float | None = None, x_coord: float | None = None, y_coord: float | None = None, layers_depth: list[float] | None = None, materials_id: list[int] | None = None, gwt_depth: float | None = None, pnum: str | int | None = None, samples_depth: list[float] | None = None, samples_id: list[int] | None = None, isamples_top_depth: list[float] | None = None, isamples_length: list[float] | None = None, isamples_id: list[int] | None = None) None

Initialize a Profile1D object.

cut_profile(cut_elev: float, keep_below: bool = True, add_fill: bool = False, fill_id: int | Literal[top_layer] = <ast.UnaryOp object at 0x0000028E223BD600>, inplace: bool = False) Profile1D | None

Cut a 1D profile to 2 profiles and get one of them.

Parameters

cut_elevfloat, default: 0.0

The elevation at where to cut the profile.

keep_belowbool, default: True

If it’s True, the profile below the cut_elev will be returned.

add_fillbool, default: True

If it’s True, when the cut_elev is above the top of profile and keep below is True, fill will be added.

fill_idint | “top_layer”, default: -1

The material id for the fill. When set to "top_layer" with add_fill=True and keep_below=True, extend the top layer to cut_elev without adding a new layer (only valid when cut_elev is above the profile top).

inplacebool, default: False

If it’s true, the instance will be modified inplace, or a new instance will be returned.

slice_profile(slice_top: float, slice_bottom: float, inplace: bool = False) Profile1D | None

Get(slice) a section of a 1d profile between 2 elevations.

Parameters

slice_topfloat

The top elevation of the slice.

slice_bottomfloat

The bottom elevation of the slice.

inplacebool, default: False

If it’s true, the instance will be modified inplace, or a new instance will be returned.

Notes

If slice top is above profile top or slice bottom is below profile bottom, no fill will be added.
cal_samples_thickness() dict[int, list[float]] | None

Calculate the characteristic thickness of each sample.

Returns

dict[int, list[float]]

key is the id of the sample, value1 is the characteristic thickness of the sample, value2 is the top elevation of current represent layer, value3 is the bottom elevation of current represent layer.

Properties:

layers_thickness
layers_elevation
layers_top_elevation
gwt_elevation
samples_elevation
isamples_bottom_depth
isamples_center_depth
isamples_top_elevation
isamples_bottom_elevation
isamples_center_elevation
class dataclass.geoProfiles.MultiProfile1D

Object for a list of Profile1D.

Methods:

__init__(profile_1ds: list[Profile1D] | None = None, profiles_table: pd.DataFrame | None = None, layers_table: pd.DataFrame | None = None, samples_table: pd.DataFrame | None = None, isamples_table: pd.DataFrame | None = None) None

Initialize a MultiProfile1D object.

Parameters

profile_1dslist[Profile1D], default: None

List of Profile1D objects. If it’s not None, the profile1d_table will be ignored.

profiles_tablepd.DataFrame, default: None

Data of profile_1d information with columns ‘[“pnum”, “top”, “x_coord”, “y_coord”, “gwt_depth”]’

layers_tablepd.DataFrame, default: None

Data of layers information with columns ‘[“pnum”, “layers_depth”, “materials_id”]’

samples_tablepd.DataFrame, default: None

Data of samples information with columns ‘[“pnum”, “samples_depth”, “samples_id”]’

isamples_tablepd.DataFrame, default: None

Data of isamples information with columns ‘[“pnum”, “isamples_top_depth”, “isamples_length”, “isamples_id]’

add_profile(profile: Profile1D) None

Add a profile in the data table.

remove_profile(pnum: str) None

Remove a profile from the tables by pnum.

get_profile(pnum: str) Profile1D | None

Get a single Profile by profile number.

class dataclass.geoProfiles.MaterialTable

Using TableData to define a material table containing all kinds of materials information.

Inherits from:

TableData

Methods:

__init__(data: pd.DataFrame | dict | None = None)

Initialize MaterialTable with material_id as index.

Notes

The material_id will be set as the index of the MaterialTable.
get_material(material_id: int) TableSeries | TableData
add_material(material: dict[str, str | float | int | None]) None

Add a row to the material table by a dictionary.

delete_material(material_id: int) None

Delete a row from the material table by specified material ID.

sort_by_layer_number(inplace: bool = True, reset_material_id: bool = True) MaterialTable | None

Sort the material table by layer number in ascending order.

The layer number should follow the format: ‘1’, ‘1-1’, ‘2-1-0’, etc. Three numbers at most, 1 is equal to 1-0-0, 1-1 is equal to 1-1-0.

Parameters

inplacebool, default: True

If True, the material table will be sorted in place. If False, a new sorted material table will be returned.

reset_material_idbool, default: True

If True, the material_id will be reset to the ascending order of layer number which means the material_id will start from 0 at the first row after sorting.

get_material_id(layer_number: str | None = None, material_name: str | None = None) int

Get the material_id by layer_number or material_name.

Parameters

layer_numberstr | None, default: None

The layer number to get the material_id.

material_namestr | None, default: None

The material name to get the material_id.

Notes

If layer_number is provided, the material_name will be ignored.
convert_to_table_data() TableData

Convert the material table to a table data.

The material_id index will be removed and a new column named ‘material_id’ will be added.

copy(deep=True)

Override copy to preserve MaterialTable type instead of returning TableData

reset_index(level=None, drop=False, inplace=False, col_level=0, col_fill='')

Override reset_index to preserve MaterialTable type

class dataclass.geoProfiles.MaterialTableCollection

A collection of material tables.

Methods:

__init__(data: list[MaterialTable] | None = None, name: str | None = None, title: str | None = None, description: str | None = None)
add_table(table: MaterialTable) None

Add a material table to the collection.

get_table(key: str) MaterialTable

Get a material table by name.

class dataclass.geoProfiles.ProjectInfo

项目信息

Inherits from:

BaseModel

Attributes:

company_name: str | None = <ast.Call object at 0x0000028E224E2890>
project_name: str | None = <ast.Call object at 0x0000028E224E2AA0>
project_number: str | None = <ast.Call object at 0x0000028E224E2CB0>
class dataclass.geoProfiles.SectionBore

钻孔

Inherits from:

BaseModel

Attributes:

bore_num: str | None = <ast.Call object at 0x0000028E224E2F80>
bore_type: BoreTypes | None = <ast.Call object at 0x0000028E224E3190>
x_coord: float | None = <ast.Call object at 0x0000028E224E33A0>
x: float | None = <ast.Call object at 0x0000028E224E35B0>
y: float | None = <ast.Call object at 0x0000028E224E37C0>
top: float | None = <ast.Call object at 0x0000028E224E39D0>
bore_diameter: float | None = <ast.Call object at 0x0000028E224E3BE0>
bore_starting_date: str | None = <ast.Call object at 0x0000028E224E3DF0>
bore_completion_date: str | None = <ast.Call object at 0x0000028E224FC040>
steady_water_depth: float | None = <ast.Call object at 0x0000028E224FC250>
water_level_measure_date: str | None = <ast.Call object at 0x0000028E224FC460>
drawing_scale: int | None = <ast.Call object at 0x0000028E224FC670>
elevations: Sequence[float] | None = <ast.Call object at 0x0000028E224FC8E0>
depths: Sequence[float] | None = <ast.Call object at 0x0000028E224FCB50>
materials: Sequence[int] | None = <ast.Call object at 0x0000028E224FCDC0>
layers_num: Sequence[str] | None = <ast.Call object at 0x0000028E224FD030>
distance_to: float | None = <ast.Call object at 0x0000028E224FD240>
sample_num: list[str] | None = <ast.Call object at 0x0000028E224FD4B0>
sample_depths: Sequence[float] | None = <ast.Call object at 0x0000028E224FD720>
sample_lengths: Sequence[float] | None = <ast.Call object at 0x0000028E224FD990>
sample_types: Sequence[int] | None = <ast.Call object at 0x0000028E224FDC00>
spt_depths: Sequence[float] | None = <ast.Call object at 0x0000028E224FDE70>
spt_lengths: Sequence[float] | None = <ast.Call object at 0x0000028E224FE0E0>
spt_numbers: Sequence[int] | None = <ast.Call object at 0x0000028E224FE350>
dpt_top_depths: Sequence[float] | None = <ast.Call object at 0x0000028E224FE5C0>
dpt_bot_depths: Sequence[float] | None = <ast.Call object at 0x0000028E224FE830>
dpt_numbers: Sequence[float] | None = <ast.Call object at 0x0000028E224FEAA0>
cpt_bot_depths: Sequence[float] | None = <ast.Call object at 0x0000028E224FED10>
cpt_tip_forces: Sequence[float] | None = <ast.Call object at 0x0000028E224FEF80>
cpt_side_forces: Sequence[float] | None = <ast.Call object at 0x0000028E224FF1F0>
f_bot_elev_bore: float | None = <ast.Call object at 0x0000028E224FF400>
wave_velocity_depths: Sequence[float] | None = <ast.Call object at 0x0000028E224FF670>
transverse_wave_velocitys: Sequence[float] | None = <ast.Call object at 0x0000028E224FF8E0>
longitudinal_wave_velocitys: Sequence[float] | None = <ast.Call object at 0x0000028E224FFB50>
collapsibility_top_depths: Sequence[float] | None = <ast.Call object at 0x0000028E224FFDC0>
collapsibility_lengths: Sequence[float] | None = <ast.Call object at 0x0000028E2246C070>
collapsibility_coes: Sequence[float] | None = <ast.Call object at 0x0000028E2246C2E0>
gravity_collapsibility_coes: Sequence[float] | None = <ast.Call object at 0x0000028E2246C550>
class dataclass.geoProfiles.SectionInterface

地质剖面图上地层线信息

Inherits from:

BaseModel

Attributes:

coords: list[tuple[(float, float)]] = <ast.Call object at 0x0000028E2246C910>
material: int = <ast.Call object at 0x0000028E2246CA90>
layer: int = <ast.Call object at 0x0000028E2246CC10>
virtual_interface: bool = <ast.Call object at 0x0000028E2246CD90>
class dataclass.geoProfiles.SectionLine
Inherits from:

BaseModel

Attributes:

name: str | None = <ast.Call object at 0x0000028E2246D000>
bores: list[str] | None = <ast.Call object at 0x0000028E2246D270>
class dataclass.geoProfiles.SectionHatch

地质剖面图填充信息

Inherits from:

BaseModel

Attributes:

coords: list[tuple[(float, float)]] = <ast.Call object at 0x0000028E2246D600>
material: int = <ast.Call object at 0x0000028E2246D780>
layer: int = <ast.Call object at 0x0000028E2246D900>
class dataclass.geoProfiles.SectionMaterial
Inherits from:

BaseModel

Methods:

normalize_texture(cls, value)
normalize_fill_color(cls, value)

Attributes:

material_name: str | None = <ast.Call object at 0x0000028E2246DB40>
layer_number: str | None = <ast.Call object at 0x0000028E2246DD50>
texture: str | None = <ast.Call object at 0x0000028E2246DF60>
fill_color: tuple[(int, int, int)] | None = <ast.Call object at 0x0000028E2246E260>
geological_age_symbol: str | None = <ast.Call object at 0x0000028E2246E470>
geological_origin_symbol: str | None = <ast.Call object at 0x0000028E2246E680>
weathering_degree: str | None = <ast.Call object at 0x0000028E2246E890>
layer_description: str | None = <ast.Call object at 0x0000028E2246EAA0>
bearing_capacity: float | None = <ast.Call object at 0x0000028E2246ECB0>
pile_side_friction: float | None = <ast.Call object at 0x0000028E2246EEC0>
class dataclass.geoProfiles.BoreForPlanDraw

钻孔平面布置图需要的信息

Inherits from:

BaseModel

Attributes:

project_infos: ProjectInfo | None = <ast.Call object at 0x0000028E2247D5A0>
bores: list[SectionBore] | None = <ast.Call object at 0x0000028E2247D8A0>
scection_lines: list[SectionLine] | None = <ast.Call object at 0x0000028E2247DC30>
y_direction: Literal[(N, E)] | None = <ast.Call object at 0x0000028E2247DCF0>
class dataclass.geoProfiles.BoreForCadDraw

钻孔柱状图需要的信息

Inherits from:

BaseModel

Attributes:

project_infos: ProjectInfo | None = <ast.Call object at 0x0000028E2247E0E0>
bores: list[SectionBore] | None = <ast.Call object at 0x0000028E2247E230>
materials: dict[(int, SectionMaterial)] | None = <ast.Call object at 0x0000028E2247E440>
class dataclass.geoProfiles.SectionForCadDraw

地质剖面图需要的信息

Inherits from:

BaseModel

Attributes:

bounds: tuple[(float, float, float, float)] | None = <ast.Call object at 0x0000028E2247EDD0>
bores: list[SectionBore] | None = <ast.Call object at 0x0000028E2247EBC0>
interfaces: list[SectionInterface] | None = <ast.Call object at 0x0000028E2247F100>
hatches: list[SectionHatch] | None = <ast.Call object at 0x0000028E2247EEC0>
materials: dict[(int, SectionMaterial)] | None = <ast.Call object at 0x0000028E2247F400>
section_line: list[tuple[(float, float)]] | None = <ast.Call object at 0x0000028E2247F9A0>
section_num: str | None = <ast.Call object at 0x0000028E2247F730>
class dataclass.geoProfiles.SectionInterface3D
Inherits from:

BaseModel

Attributes:

coords: list[tuple[(float, float, float)]] = <ast.Call object at 0x0000028E2247FBB0>
material: int = <ast.Call object at 0x0000028E2247FF10>
layer: int = <ast.Call object at 0x0000028E2247FFD0>
class dataclass.geoProfiles.SectionHatch3D
Inherits from:

BaseModel

Attributes:

coords: list[tuple[(float, float, float)]] = <ast.Call object at 0x0000028E22028250>
material: int = <ast.Call object at 0x0000028E22028400>
layer: int = <ast.Call object at 0x0000028E22028130>
class dataclass.geoProfiles.Section3D
Inherits from:

BaseModel

Attributes:

bounds: tuple[(float, float, float, float, float, float)] | None = <ast.Call object at 0x0000028E22028940>
interfaces: list[SectionInterface3D] | None = <ast.Call object at 0x0000028E22028B50>
materials: dict[(int, SectionMaterial)] | None = <ast.Call object at 0x0000028E220290C0>
hatches: list[SectionHatch3D] | None = <ast.Call object at 0x0000028E22029660>
section_num: str | None = <ast.Call object at 0x0000028E22029360>

Functions

dataclass.geoProfiles.sort_layer_numbers(layer_numbers: list, raise_on_invalid: bool = False) list[str]

Sort layer numbers considering the format like “2”, “2-1”, “3”, “4”.

The layer number should follow the format: ‘1’, ‘1-1’, ‘2-1-0’, etc. Three numbers at most, 1 is equal to 1-0-0, 1-1 is equal to 1-1-0.

Parameters

layer_numberslist

List of layer numbers (can be strings or numbers)

Returns

Any
list[str]
    Sorted list of layer numbers as strings