sgf-parser 0.0.8__tar.gz → 0.0.9__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/.github/workflows/branch.yaml +4 -2
  2. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/.github/workflows/release.yaml +1 -1
  3. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/CHANGES.md +7 -0
  4. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/PKG-INFO +1 -1
  5. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/pyproject.toml +1 -1
  6. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/src/sgf_parser/models/method_dt.py +7 -2
  7. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/src/sgf_parser/parser.py +9 -1
  8. sgf_parser-0.0.9/tests/data/dt-test-2.dpt +993 -0
  9. sgf_parser-0.0.9/tests/data/dt-test-3.dpt +1048 -0
  10. sgf_parser-0.0.9/tests/data/dt-test-4.dpt +1001 -0
  11. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/integration/test_parse.py +15 -5
  12. sgf_parser-0.0.9/uv.lock +1042 -0
  13. sgf_parser-0.0.8/uv.lock +0 -995
  14. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/.gitattributes +0 -0
  15. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/.gitignore +0 -0
  16. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/LICENSE +0 -0
  17. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/README.md +0 -0
  18. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/poetry.lock +0 -0
  19. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/src/sgf_parser/__init__.py +0 -0
  20. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/src/sgf_parser/datetime_parser.py +0 -0
  21. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/src/sgf_parser/models/__init__.py +0 -0
  22. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/src/sgf_parser/models/method.py +0 -0
  23. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/src/sgf_parser/models/method_cpt.py +0 -0
  24. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/src/sgf_parser/models/method_dp.py +0 -0
  25. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/src/sgf_parser/models/method_rp.py +0 -0
  26. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/src/sgf_parser/models/method_slb.py +0 -0
  27. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/src/sgf_parser/models/method_srs.py +0 -0
  28. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/src/sgf_parser/models/method_sti.py +0 -0
  29. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/src/sgf_parser/models/method_svt.py +0 -0
  30. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/src/sgf_parser/models/method_tot.py +0 -0
  31. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/src/sgf_parser/models/method_tr.py +0 -0
  32. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/src/sgf_parser/models/method_type.py +0 -0
  33. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/src/sgf_parser/models/method_wst.py +0 -0
  34. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/src/sgf_parser/models/types.py +0 -0
  35. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/cpt-dt-test-1.std +0 -0
  36. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/cpt-test-1.cpt +0 -0
  37. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/cpt-test-2.cpt +0 -0
  38. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/cpt-test-3.cpt +0 -0
  39. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/cpt-test-4.cpt +0 -0
  40. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/cpt-test-malformed-data-1.cpt +0 -0
  41. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/cpt-test-malformed-date-header.cpt +0 -0
  42. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/cpt-test-multi-line-header.cpt +0 -0
  43. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/cpt-test-two-lines-header.cpt +0 -0
  44. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/cpt-test-with-method-block.cpt +0 -0
  45. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/cpt-test-wrong-type.cpt +0 -0
  46. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/dp-test-1.hfa +0 -0
  47. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/dp-test-2.hfa +0 -0
  48. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/dp-test-3.hfa +0 -0
  49. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/dp-test-4.hfa +0 -0
  50. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/dp-test-modified-2.hfa +0 -0
  51. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/dt-test-1.std +0 -0
  52. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/rp-test-1.std +0 -0
  53. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/rp-test-2.std +0 -0
  54. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/srs-test-1.jb3 +0 -0
  55. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/srs-test-2.jbt +0 -0
  56. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/srs-test-3.jbt +0 -0
  57. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/srs-test-4.jb2 +0 -0
  58. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/srs-test-5.jb3 +0 -0
  59. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/srs-test-problem-comment.jbt +0 -0
  60. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/svt-test-1.std +0 -0
  61. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/tot-malformed-code.tot +0 -0
  62. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/tot-test-1.tot +0 -0
  63. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/tot-test-2.tot +0 -0
  64. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/tot-test-3.tot +0 -0
  65. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/tot-test-4.tot +0 -0
  66. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/tot-test-5.tot +0 -0
  67. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/tot-test-6.tot +0 -0
  68. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/tot-test-7.tot +0 -0
  69. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/tot-test-8.tot +0 -0
  70. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/tot-test-9.TOT +0 -0
  71. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/tot-test-data-ending-with-comma.tot +0 -0
  72. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/tot-test-multiple-codes.tot +0 -0
  73. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/tr-test-1.trt +0 -0
  74. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/tr-test-2.trt +0 -0
  75. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/tr-test-3.trt +0 -0
  76. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/wst-test-1.vim +0 -0
  77. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/data/wst-test-2.vim +0 -0
  78. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/integration/test_file_errors.py +0 -0
  79. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/integration/test_parse_tr.py +0 -0
  80. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/unit/test_cpt_application_class.py +0 -0
  81. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/unit/test_dates.py +0 -0
  82. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/unit/test_tot_depth.py +0 -0
  83. {sgf_parser-0.0.8 → sgf_parser-0.0.9}/tests/unit/test_tot_k_codes.py +0 -0
@@ -54,7 +54,9 @@ jobs:
54
54
  run: uv run bandit .
55
55
 
56
56
  - name: Run safety
57
- run: uv run safety check
57
+ run: uv run safety --disable-optional-telemetry --stage cicd scan
58
+ env:
59
+ SAFETY_API_KEY: ${{ secrets.SAFETY_API_KEY }}
58
60
 
59
61
  - name: Check for acceptable licenses
60
- 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"
62
+ run: uv run pip-licenses --allow-only="MIT;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;Apache-2.0 or BSD-3-Clause"
@@ -10,7 +10,7 @@ jobs:
10
10
  strategy:
11
11
  fail-fast: false
12
12
  matrix:
13
- python-version: ['3.12']
13
+ python-version: ['3.13']
14
14
  steps:
15
15
  - uses: actions/checkout@v4
16
16
 
@@ -1,5 +1,12 @@
1
1
  # NGI Python SGF Parser Package
2
2
 
3
+ _2025-08-12_
4
+
5
+ Version 0.0.9
6
+
7
+ - Better support for importing Dissipation Tests (DT). Still need the code `HM=35`, and we do not handle dissipation
8
+ tests with `HM=7`.
9
+
3
10
  _2025-05-13_
4
11
 
5
12
  Version 0.0.8
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sgf-parser
3
- Version: 0.0.8
3
+ Version: 0.0.9
4
4
  Summary: Parser for the Swedish Geotechnical Society / Svenska Geotekniska Föreningen (SGF) data format
5
5
  Project-URL: homepage, https://github.com/norwegian-geotechnical-institute/sgf-parser
6
6
  Project-URL: repository, https://github.com/norwegian-geotechnical-institute/sgf-parser
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "sgf-parser"
3
- version = "0.0.8"
3
+ version = "0.0.9"
4
4
  description = "Parser for the Swedish Geotechnical Society / Svenska Geotekniska Föreningen (SGF) data format"
5
5
  authors = [{ name = "Jostein Leira", email = "jostein@leira.net" }]
6
6
  requires-python = ">=3.11,<4"
@@ -1,7 +1,7 @@
1
1
  from decimal import Decimal
2
2
  from typing import Literal
3
3
 
4
- from pydantic import Field
4
+ from pydantic import Field, AliasChoices
5
5
 
6
6
  from sgf_parser.models import MethodType, MethodData, Method
7
7
 
@@ -15,9 +15,14 @@ class MethodDTData(MethodData):
15
15
  super().__init__(**kwargs)
16
16
 
17
17
  time: Decimal | None = Field(None, alias="AD", description="Elapsed time (s)")
18
- u2: Decimal | None = Field(None, alias="AG", description="Shoulder pressure (kPa)")
18
+ u2: Decimal | None = Field(None, description="Shoulder pressure (kPa)", validation_alias=AliasChoices("U", "AG"))
19
+ fs: Decimal | None = Field(None, description="Friction (kPa)", validation_alias=AliasChoices("FS", "F"))
20
+ qc: Decimal | None = Field(None, description="Resistance (MPa)", validation_alias=AliasChoices("QC", "Q"))
19
21
  depth: Decimal | None = Field(None, alias="D", description="Depth (m)")
20
22
 
23
+ def __repr__(self):
24
+ return f"<{self.__class__.__name__} {self.time}>"
25
+
21
26
 
22
27
  class MethodDT(Method):
23
28
  """
@@ -1,3 +1,4 @@
1
+ import copy
1
2
  import re
2
3
  from typing import TextIO, Any
3
4
 
@@ -82,6 +83,13 @@ class Parser:
82
83
  # Starting a new data block, so store the current collected header in a new method
83
84
  method = self.parse_header(header)
84
85
  header = {}
86
+ elif _new_state == ParseState.DATA and _old_state == ParseState.DATA:
87
+ # Starting a new data block, while handling data. No new header,
88
+ # so use the previous method to create a new method of the same type
89
+ if method:
90
+ methods.append(method)
91
+ method = copy.copy(method)
92
+ method.method_data = []
85
93
  elif _new_state in (ParseState.HEADER, ParseState.METHOD) and _old_state == ParseState.DATA:
86
94
  # Finished populating current method, since new method is starting
87
95
  # Store the current method, and empty the current method
@@ -143,7 +151,7 @@ class Parser:
143
151
  row_dict = self._convert_str_to_dict(row)
144
152
  method_data = method.method_data_type.model_validate(row_dict)
145
153
  if hasattr(method_data, "flushing"):
146
- method_data.flushing = method.is_flushing_active(method_data)
154
+ method_data.flushing = method.is_flushing_active(method_data)
147
155
  if hasattr(method_data, "hammering"):
148
156
  method_data.hammering = method.is_hammer_active(method_data)
149
157
  if hasattr(method_data, "increased_rotation_rate"):