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 0x0000021FE0EA5690>, 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 0x0000021FE2D84130>
projectName: str | None = <ast.Call object at 0x0000021FE2D84340>
project_number: str | None = <ast.Call object at 0x0000021FE2D84550>
class dataclass.geoProfiles.SamplingLog

取样记录,字段名与 sampling_log_table 一致。

sample_type 与 sample_type_name 逐项对应,由取样类型名称编码。 名称为 None 时编码为 -1。提供 sample_types_map 且名称命中时用映射值; 未命中时按子串依次判断:「原状」→ 0,「扰动」→ 1,「岩」→ 2,「水」→ 3, 其余为 -1。源值本身是数字时,编码直接取 int(源值)。

Inherits from:

BaseModel

Attributes:

sample_number: list[str | None] | None = <ast.Call object at 0x0000021FE2D84910>
sample_top_depth: Sequence[float] | None = <ast.Call object at 0x0000021FE2D84B80>
sample_length: Sequence[float] | None = <ast.Call object at 0x0000021FE2D84DF0>
sample_type: Sequence[int] | None = <ast.Call object at 0x0000021FE2D85060>
sample_type_name: Sequence[str | None] | None = <ast.Call object at 0x0000021FE2D85330>
class dataclass.geoProfiles.SptLog

标贯记录,字段名与 spt_table 一致。

Inherits from:

BaseModel

Attributes:

test_point_top_depth: Sequence[float] | None = <ast.Call object at 0x0000021FE2D85660>
penetration_depth: Sequence[float] | None = <ast.Call object at 0x0000021FE2D858D0>
blow_count: Sequence[int] | None = <ast.Call object at 0x0000021FE2D85B40>
class dataclass.geoProfiles.DptLog

动探记录,字段名与 dpt_table 一致。

Inherits from:

BaseModel

Attributes:

test_point_top_depth: Sequence[float] | None = <ast.Call object at 0x0000021FE2D85E70>
test_point_bottom_depth: Sequence[float] | None = <ast.Call object at 0x0000021FE2D860E0>
blow_count: Sequence[float] | None = <ast.Call object at 0x0000021FE2D86350>
class dataclass.geoProfiles.CptLog

静探记录,字段名与 cpt_table 一致。

Inherits from:

BaseModel

Attributes:

test_point_bottom_depth: Sequence[float] | None = <ast.Call object at 0x0000021FE2D86680>
cone_tip_resistance: Sequence[float] | None = <ast.Call object at 0x0000021FE2D868F0>
sleeve_friction: Sequence[float] | None = <ast.Call object at 0x0000021FE2D86B60>
class dataclass.geoProfiles.ShearWaveVelocityLog

波速记录,字段名与 sonic_logging_table 一致。

场地工程勘察 同时提供横波 shear_wave_velocity 与纵波 p_wave_velocity。 公路工程勘察 只有纵波波速,此时 shear_wave_velocity 为空。

Inherits from:

BaseModel

Attributes:

test_point_depth: Sequence[float] | None = <ast.Call object at 0x0000021FE2D86E90>
shear_wave_velocity: Sequence[float] | None = <ast.Call object at 0x0000021FE2D87100>
p_wave_velocity: Sequence[float] | None = <ast.Call object at 0x0000021FE2D87370>
class dataclass.geoProfiles.LoessCollapsibilityLog

湿陷记录。场地工程勘察从 soil_test_table 读取,字段名与湿陷系数列一致。

Inherits from:

BaseModel

Attributes:

sample_top_depth: Sequence[float] | None = <ast.Call object at 0x0000021FE2D876D0>
sample_length: Sequence[float] | None = <ast.Call object at 0x0000021FE2D87940>
collapsibility_coefficient: Sequence[float] | None = <ast.Call object at 0x0000021FE2D87BB0>
self_weight_collapsibility_coefficient: Sequence[float] | None = <ast.Call object at 0x0000021FE2D87E20>
class dataclass.geoProfiles.SectionBore

钻孔

Inherits from:

BaseModel

Attributes:

bore_number: str | None = <ast.Call object at 0x0000021FE2E3C130>
bore_type: BoreTypes | str | None = <ast.Call object at 0x0000021FE2E3C3A0>
bore_mileage: float | None = <ast.Call object at 0x0000021FE2E3C5B0>
x_coordinate: float | None = <ast.Call object at 0x0000021FE2E3C7C0>
y_coordinate: float | None = <ast.Call object at 0x0000021FE2E3C9D0>
bore_top: float | None = <ast.Call object at 0x0000021FE2E3CBE0>
bore_diameter: float | None = <ast.Call object at 0x0000021FE2E3CDF0>
start_drilling_date: str | None = <ast.Call object at 0x0000021FE2E3D000>
end_drilling_date: str | None = <ast.Call object at 0x0000021FE2E3D210>
steady_ground_water_depth: float | None = <ast.Call object at 0x0000021FE2E3D420>
water_level_measure_date: str | None = <ast.Call object at 0x0000021FE2E3D630>
drawing_scale: int | None = <ast.Call object at 0x0000021FE2E3D840>
layer_bottom_elevation: Sequence[float] | None = <ast.Call object at 0x0000021FE2E3DAB0>
layer_bottom_depth: Sequence[float] | None = <ast.Call object at 0x0000021FE2E3DD20>
material_id: Sequence[int] | None = <ast.Call object at 0x0000021FE2E3DF90>
layer_number: Sequence[str] | None = <ast.Call object at 0x0000021FE2E3E200>
offset_distance: float | None = <ast.Call object at 0x0000021FE2E3E410>
foundation_bottom_elevation: float | None = <ast.Call object at 0x0000021FE2E3E620>
sampling_log: SamplingLog | None = <ast.Call object at 0x0000021FE2E3E830>
spt: SptLog | None = <ast.Call object at 0x0000021FE2E3EA40>
dpt: DptLog | None = <ast.Call object at 0x0000021FE2E3EC50>
cpt: CptLog | None = <ast.Call object at 0x0000021FE2E3EE60>
shear_wave_velocity: ShearWaveVelocityLog | None = <ast.Call object at 0x0000021FE2E3F070>
loess_collapsibility: LoessCollapsibilityLog | None = <ast.Call object at 0x0000021FE2E3F280>
class dataclass.geoProfiles.SectionInterface

地质剖面图上的线:地层接触线、地表线、地下水位线、断层线。

Inherits from:

BaseModel

Attributes:

coords: list[tuple[(float, float)]] = <ast.Call object at 0x0000021FE2E3F640>
material_id: int = <ast.Call object at 0x0000021FE2E3F7C0>
layer_id: int = <ast.Call object at 0x0000021FE2E3F940>
virtual_interface: bool = <ast.Call object at 0x0000021FE2E3FAC0>
class dataclass.geoProfiles.SectionLine
Inherits from:

BaseModel

Attributes:

section_number: str | None = <ast.Call object at 0x0000021FE2E3FD30>
define_by: Literal[(bores, points)] | None = <ast.Call object at 0x0000021FE2E38040>
bore_numbers: list[str] | None = <ast.Call object at 0x0000021FE2E382B0>
points: list[tuple[(float, float)]] | None = <ast.Call object at 0x0000021FE2E385E0>
class dataclass.geoProfiles.SectionHatch

地质剖面图填充信息

Inherits from:

BaseModel

Attributes:

coords: list[tuple[(float, float)]] = <ast.Call object at 0x0000021FE2E38970>
material_id: int = <ast.Call object at 0x0000021FE2E38AF0>
layer_id: int = <ast.Call object at 0x0000021FE2E38C70>
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 0x0000021FE2E38EB0>
layer_number: str | None = <ast.Call object at 0x0000021FE2E390C0>
texture: str | None = <ast.Call object at 0x0000021FE2E392D0>
fill_color: tuple[(int, int, int)] | None = <ast.Call object at 0x0000021FE2E395D0>
geological_age_symbol: str | None = <ast.Call object at 0x0000021FE2E397E0>
geological_origin_symbol: str | None = <ast.Call object at 0x0000021FE2E399F0>
weathering_degree: str | None = <ast.Call object at 0x0000021FE2E39C00>
layer_description: str | None = <ast.Call object at 0x0000021FE2E39E10>
soil_bearing_capacity_fak: float | None = <ast.Call object at 0x0000021FE2E3A020>
skin_friction: float | None = <ast.Call object at 0x0000021FE2E3A230>
class dataclass.geoProfiles.BoreForPlanDraw

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

Inherits from:

BaseModel

Attributes:

project_information: ProjectInfo | None = <ast.Call object at 0x0000021FE1A1C970>
bores: list[SectionBore] | None = <ast.Call object at 0x0000021FE1A1CBE0>
section_lines: list[SectionLine] | None = <ast.Call object at 0x0000021FE1A1CE50>
yAxisDirection: Literal[(N, E)] | None = <ast.Call object at 0x0000021FE1A1D120>
class dataclass.geoProfiles.BoreForCadDraw

钻孔柱状图需要的信息

Inherits from:

BaseModel

Attributes:

project_information: ProjectInfo | None = <ast.Call object at 0x0000021FE1A1D3F0>
bores: list[SectionBore] | None = <ast.Call object at 0x0000021FE1A1D660>
materials: dict[(int, SectionMaterial)] | None = <ast.Call object at 0x0000021FE1A1D930>
class dataclass.geoProfiles.SectionForCadDraw

地质剖面图需要的信息

Inherits from:

BaseModel

Attributes:

bounds: tuple[(float, float, float, float)] | None = <ast.Call object at 0x0000021FE1A1DD20>
bores: list[SectionBore] | None = <ast.Call object at 0x0000021FE1A1DF90>
interfaces: list[SectionInterface] | None = <ast.Call object at 0x0000021FE1A1E200>
hatches: list[SectionHatch] | None = <ast.Call object at 0x0000021FE1A1E470>
materials: dict[(int, SectionMaterial)] | None = <ast.Call object at 0x0000021FE1A1E740>
section_line_coords: list[tuple[(float, float)]] | None = <ast.Call object at 0x0000021FE1A1EA70>
section_number: str | None = <ast.Call object at 0x0000021FE1A1EC80>
class dataclass.geoProfiles.SectionInterface3D
Inherits from:

BaseModel

Attributes:

coords: list[tuple[(float, float, float)]] = <ast.Call object at 0x0000021FE1A1EFE0>
material_id: int = <ast.Call object at 0x0000021FE1A1F160>
layer_id: int = <ast.Call object at 0x0000021FE1A1F2E0>
class dataclass.geoProfiles.SectionHatch3D
Inherits from:

BaseModel

Attributes:

coords: list[tuple[(float, float, float)]] = <ast.Call object at 0x0000021FE1A1F610>
material_id: int = <ast.Call object at 0x0000021FE1A1F790>
layer_id: int = <ast.Call object at 0x0000021FE1A1F910>
class dataclass.geoProfiles.Section3D
Inherits from:

BaseModel

Attributes:

bounds: tuple[(float, float, float, float, float, float)] | None = <ast.Call object at 0x0000021FE1A1FD30>
interfaces: list[SectionInterface3D] | None = <ast.Call object at 0x0000021FE1A1FFA0>
materials: dict[(int, SectionMaterial)] | None = <ast.Call object at 0x0000021FE1A4D810>
hatches: list[SectionHatch3D] | None = <ast.Call object at 0x0000021FE1A4D420>
section_number: str | None = <ast.Call object at 0x0000021FE1A4C490>

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