Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ jobs:
run: uv run safety check

- name: Check for acceptable licenses
run: uv run pip-licenses --allow-only="MIT License;BSD License;Python Software Foundation License;Apache Software License;Mozilla Public License 2.0 (MPL 2.0);ISC License (ISCL);The Unlicense (Unlicense)"
run: uv run pip-licenses --allow-only="MIT License;BSD License;Python Software Foundation License;Apache Software License;Mozilla Public License 2.0 (MPL 2.0);ISC License (ISCL);The Unlicense (Unlicense);UNKNOWN;Apache-2.0"
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# NGI Python SGF Parser Package

_2025-04-11_

Version 0.0.7

- Add `SP` as an alias for hammering pressure.
Affects method Total sounding (TOT) and Soil Rock Sounding (SRS).

_2025-03-13_

Version 0.0.6
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "sgf-parser"
version = "0.0.6"
version = "0.0.7"
description = "Parser for the Swedish Geotechnical Society / Svenska Geotekniska Föreningen (SGF) data format"
authors = [{ name = "Jostein Leira", email = "jostein@leira.net" }]
requires-python = ">=3.11,<4"
Expand Down
6 changes: 4 additions & 2 deletions src/sgf_parser/models/method_srs.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from decimal import Decimal
from typing import Literal, Any

from pydantic import computed_field, Field, model_validator
from pydantic import computed_field, Field, model_validator, AliasChoices

from sgf_parser.models import MethodType, Method, MethodData
from sgf_parser.models.types import SoundingClass, StopCode, CommentCode
Expand All @@ -28,7 +28,9 @@ def __init__(self, **kwargs):
penetration_force: Decimal | None = Field(None, alias="A", description="Penetration force (kN)")
penetration_rate: Decimal | None = Field(None, alias="B", description="Penetration rate (mm/s)")
engine_pressure: Decimal | None = Field(None, alias="P", description="Engine pressure (MPa)")
hammering_pressure: Decimal | None = Field(None, alias="AZ", description="Hammering pressure (MPa)")
hammering_pressure: Decimal | None = Field(
None, validation_alias=AliasChoices("AZ", "SP"), description="Hammering pressure (MPa)"
)
rotation_rate: Decimal | None = Field(None, alias="R", description="Rotation rate (rpm)")
flushing_pressure: Decimal | None = Field(None, alias="I", description="Flushing pressure (MPa)")
flushing_flow: Decimal | None = Field(None, alias="J", description="Flushing flow (l/min)")
Expand Down
7 changes: 4 additions & 3 deletions src/sgf_parser/models/method_tot.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from decimal import Decimal
from typing import Literal

from pydantic import Field, computed_field
from pydantic import Field, computed_field, AliasChoices

from sgf_parser.models import MethodType, Method, MethodData, StopCode
from sgf_parser.models.types import CommentCode
Expand All @@ -24,8 +24,9 @@ def __init__(self, **kwargs):
hammering: bool | None = Field(None, alias="AP")

# "AZ": "hammering_pressure",
hammering_pressure: Decimal | None = Field(None, alias="AZ", description="Hammering pressure (MPa)")

hammering_pressure: Decimal | None = Field(
None, validation_alias=AliasChoices("AZ", "SP"), description="Hammering pressure (MPa)"
)
# "AQ": "increased_rotation_rate",
increased_rotation_rate: bool | None = Field(None, alias="AQ")

Expand Down
Loading