Context
subsurfaceio.cross_section.render.context
Render-time coordinate context for cross-section DXF export.
Classes:
| Name | Description |
|---|---|
RenderContext |
Meter-based layout state shared by all column renderers. |
RenderContext
dataclass
Meter-based layout state shared by all column renderers.
Methods:
| Name | Description |
|---|---|
from_section |
Build context bounds from section stations and optional overrides. |
iter_major_ticks |
Return major vertical axis tick values. |
section_x_max |
Right edge of the rendered section in meters. |
test_y_bounds |
Return the vertical frame for one test, including surface when needed. |
y_for_test_row |
Map one depth sample to section Y. |
y_values_for_test |
Return section Y coordinates for all rows in |
Attributes:
| Name | Type | Description |
|---|---|---|
axis_x_left |
float
|
|
axis_x_right |
float
|
|
section |
CrossSection
|
|
site_tests |
dict[str, InSituTest]
|
|
y_max |
float
|
|
y_min |
float
|
|
from_section
classmethod
Build context bounds from section stations and optional overrides.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
section
|
CrossSection
|
Cross-section definition. |
required |
site_tests
|
dict[str, InSituTest]
|
Tests keyed by |
required |
Returns:
| Type | Description |
|---|---|
RenderContext
|
Context with vertical bounds expanded to nice axis ticks. |
iter_major_ticks
Return major vertical axis tick values.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
y_min
|
float | None
|
Lower bound; defaults to the context |
None
|
y_max
|
float | None
|
Upper bound; defaults to the context |
None
|
Returns:
| Type | Description |
|---|---|
list[float]
|
Evenly spaced major tick values covering the range. |
section_x_max
Right edge of the rendered section in meters.
Returns:
| Type | Description |
|---|---|
float
|
Maximum station right edge in section meters. |
test_y_bounds
Return the vertical frame for one test, including surface when needed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
test
|
InSituTest
|
In-situ test placed on the section. |
required |
Returns:
| Type | Description |
|---|---|
tuple[float, float]
|
|
y_for_test_row
Map one depth sample to section Y.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
test
|
InSituTest
|
In-situ test providing surface elevation when needed. |
required |
depth
|
float | None
|
Sample depth in meters, or |
required |
Returns:
| Type | Description |
|---|---|
float | None
|
Section Y, or |
y_values_for_test
Return section Y coordinates for all rows in test.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
test
|
InSituTest
|
In-situ test whose |
required |
Returns:
| Type | Description |
|---|---|
list[float]
|
Section Y for each row with a non-null depth. |