sgf-parser 0.0.7__tar.gz → 0.0.8__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 (79) hide show
  1. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/CHANGES.md +6 -0
  2. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/PKG-INFO +1 -1
  3. sgf_parser-0.0.8/poetry.lock +218 -0
  4. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/pyproject.toml +1 -1
  5. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/src/sgf_parser/models/method.py +42 -149
  6. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/src/sgf_parser/models/method_rp.py +0 -13
  7. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/src/sgf_parser/models/method_srs.py +0 -14
  8. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/src/sgf_parser/models/method_tot.py +0 -14
  9. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/src/sgf_parser/models/types.py +0 -29
  10. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/src/sgf_parser/parser.py +6 -0
  11. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/integration/test_parse.py +3 -3
  12. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/unit/test_tot_k_codes.py +22 -22
  13. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/.gitattributes +0 -0
  14. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/.github/workflows/branch.yaml +0 -0
  15. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/.github/workflows/release.yaml +0 -0
  16. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/.gitignore +0 -0
  17. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/LICENSE +0 -0
  18. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/README.md +0 -0
  19. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/src/sgf_parser/__init__.py +0 -0
  20. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/src/sgf_parser/datetime_parser.py +0 -0
  21. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/src/sgf_parser/models/__init__.py +0 -0
  22. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/src/sgf_parser/models/method_cpt.py +0 -0
  23. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/src/sgf_parser/models/method_dp.py +0 -0
  24. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/src/sgf_parser/models/method_dt.py +0 -0
  25. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/src/sgf_parser/models/method_slb.py +0 -0
  26. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/src/sgf_parser/models/method_sti.py +0 -0
  27. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/src/sgf_parser/models/method_svt.py +0 -0
  28. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/src/sgf_parser/models/method_tr.py +0 -0
  29. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/src/sgf_parser/models/method_type.py +0 -0
  30. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/src/sgf_parser/models/method_wst.py +0 -0
  31. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/cpt-dt-test-1.std +0 -0
  32. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/cpt-test-1.cpt +0 -0
  33. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/cpt-test-2.cpt +0 -0
  34. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/cpt-test-3.cpt +0 -0
  35. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/cpt-test-4.cpt +0 -0
  36. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/cpt-test-malformed-data-1.cpt +0 -0
  37. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/cpt-test-malformed-date-header.cpt +0 -0
  38. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/cpt-test-multi-line-header.cpt +0 -0
  39. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/cpt-test-two-lines-header.cpt +0 -0
  40. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/cpt-test-with-method-block.cpt +0 -0
  41. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/cpt-test-wrong-type.cpt +0 -0
  42. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/dp-test-1.hfa +0 -0
  43. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/dp-test-2.hfa +0 -0
  44. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/dp-test-3.hfa +0 -0
  45. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/dp-test-4.hfa +0 -0
  46. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/dp-test-modified-2.hfa +0 -0
  47. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/dt-test-1.std +0 -0
  48. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/rp-test-1.std +0 -0
  49. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/rp-test-2.std +0 -0
  50. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/srs-test-1.jb3 +0 -0
  51. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/srs-test-2.jbt +0 -0
  52. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/srs-test-3.jbt +0 -0
  53. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/srs-test-4.jb2 +0 -0
  54. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/srs-test-5.jb3 +0 -0
  55. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/srs-test-problem-comment.jbt +0 -0
  56. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/svt-test-1.std +0 -0
  57. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/tot-malformed-code.tot +0 -0
  58. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/tot-test-1.tot +0 -0
  59. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/tot-test-2.tot +0 -0
  60. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/tot-test-3.tot +0 -0
  61. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/tot-test-4.tot +0 -0
  62. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/tot-test-5.tot +0 -0
  63. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/tot-test-6.tot +0 -0
  64. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/tot-test-7.tot +0 -0
  65. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/tot-test-8.tot +0 -0
  66. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/tot-test-9.TOT +0 -0
  67. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/tot-test-data-ending-with-comma.tot +0 -0
  68. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/tot-test-multiple-codes.tot +0 -0
  69. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/tr-test-1.trt +0 -0
  70. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/tr-test-2.trt +0 -0
  71. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/tr-test-3.trt +0 -0
  72. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/wst-test-1.vim +0 -0
  73. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/data/wst-test-2.vim +0 -0
  74. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/integration/test_file_errors.py +0 -0
  75. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/integration/test_parse_tr.py +0 -0
  76. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/unit/test_cpt_application_class.py +0 -0
  77. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/unit/test_dates.py +0 -0
  78. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/tests/unit/test_tot_depth.py +0 -0
  79. {sgf_parser-0.0.7 → sgf_parser-0.0.8}/uv.lock +0 -0
@@ -1,5 +1,11 @@
1
1
  # NGI Python SGF Parser Package
2
2
 
3
+ _2025-05-13_
4
+
5
+ Version 0.0.8
6
+
7
+ - Reverted the parsing strategy to go line by line, such that K-codes do not overrule the other data.
8
+
3
9
  _2025-04-11_
4
10
 
5
11
  Version 0.0.7
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sgf-parser
3
- Version: 0.0.7
3
+ Version: 0.0.8
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
@@ -0,0 +1,218 @@
1
+ # This file is automatically @generated by Poetry 2.1.2 and should not be changed by hand.
2
+
3
+ [[package]]
4
+ name = "annotated-types"
5
+ version = "0.7.0"
6
+ description = "Reusable constraint types to use with typing.Annotated"
7
+ optional = false
8
+ python-versions = ">=3.8"
9
+ groups = ["main"]
10
+ files = [
11
+ {file = "annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53"},
12
+ {file = "annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89"},
13
+ ]
14
+
15
+ [[package]]
16
+ name = "pydantic"
17
+ version = "2.11.4"
18
+ description = "Data validation using Python type hints"
19
+ optional = false
20
+ python-versions = ">=3.9"
21
+ groups = ["main"]
22
+ files = [
23
+ {file = "pydantic-2.11.4-py3-none-any.whl", hash = "sha256:d9615eaa9ac5a063471da949c8fc16376a84afb5024688b3ff885693506764eb"},
24
+ {file = "pydantic-2.11.4.tar.gz", hash = "sha256:32738d19d63a226a52eed76645a98ee07c1f410ee41d93b4afbfa85ed8111c2d"},
25
+ ]
26
+
27
+ [package.dependencies]
28
+ annotated-types = ">=0.6.0"
29
+ pydantic-core = "2.33.2"
30
+ typing-extensions = ">=4.12.2"
31
+ typing-inspection = ">=0.4.0"
32
+
33
+ [package.extras]
34
+ email = ["email-validator (>=2.0.0)"]
35
+ timezone = ["tzdata ; python_version >= \"3.9\" and platform_system == \"Windows\""]
36
+
37
+ [[package]]
38
+ name = "pydantic-core"
39
+ version = "2.33.2"
40
+ description = "Core functionality for Pydantic validation and serialization"
41
+ optional = false
42
+ python-versions = ">=3.9"
43
+ groups = ["main"]
44
+ files = [
45
+ {file = "pydantic_core-2.33.2-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:2b3d326aaef0c0399d9afffeb6367d5e26ddc24d351dbc9c636840ac355dc5d8"},
46
+ {file = "pydantic_core-2.33.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:0e5b2671f05ba48b94cb90ce55d8bdcaaedb8ba00cc5359f6810fc918713983d"},
47
+ {file = "pydantic_core-2.33.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0069c9acc3f3981b9ff4cdfaf088e98d83440a4c7ea1bc07460af3d4dc22e72d"},
48
+ {file = "pydantic_core-2.33.2-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d53b22f2032c42eaaf025f7c40c2e3b94568ae077a606f006d206a463bc69572"},
49
+ {file = "pydantic_core-2.33.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0405262705a123b7ce9f0b92f123334d67b70fd1f20a9372b907ce1080c7ba02"},
50
+ {file = "pydantic_core-2.33.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4b25d91e288e2c4e0662b8038a28c6a07eaac3e196cfc4ff69de4ea3db992a1b"},
51
+ {file = "pydantic_core-2.33.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6bdfe4b3789761f3bcb4b1ddf33355a71079858958e3a552f16d5af19768fef2"},
52
+ {file = "pydantic_core-2.33.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:efec8db3266b76ef9607c2c4c419bdb06bf335ae433b80816089ea7585816f6a"},
53
+ {file = "pydantic_core-2.33.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:031c57d67ca86902726e0fae2214ce6770bbe2f710dc33063187a68744a5ecac"},
54
+ {file = "pydantic_core-2.33.2-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:f8de619080e944347f5f20de29a975c2d815d9ddd8be9b9b7268e2e3ef68605a"},
55
+ {file = "pydantic_core-2.33.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:73662edf539e72a9440129f231ed3757faab89630d291b784ca99237fb94db2b"},
56
+ {file = "pydantic_core-2.33.2-cp310-cp310-win32.whl", hash = "sha256:0a39979dcbb70998b0e505fb1556a1d550a0781463ce84ebf915ba293ccb7e22"},
57
+ {file = "pydantic_core-2.33.2-cp310-cp310-win_amd64.whl", hash = "sha256:b0379a2b24882fef529ec3b4987cb5d003b9cda32256024e6fe1586ac45fc640"},
58
+ {file = "pydantic_core-2.33.2-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:4c5b0a576fb381edd6d27f0a85915c6daf2f8138dc5c267a57c08a62900758c7"},
59
+ {file = "pydantic_core-2.33.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:e799c050df38a639db758c617ec771fd8fb7a5f8eaaa4b27b101f266b216a246"},
60
+ {file = "pydantic_core-2.33.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dc46a01bf8d62f227d5ecee74178ffc448ff4e5197c756331f71efcc66dc980f"},
61
+ {file = "pydantic_core-2.33.2-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:a144d4f717285c6d9234a66778059f33a89096dfb9b39117663fd8413d582dcc"},
62
+ {file = "pydantic_core-2.33.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:73cf6373c21bc80b2e0dc88444f41ae60b2f070ed02095754eb5a01df12256de"},
63
+ {file = "pydantic_core-2.33.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3dc625f4aa79713512d1976fe9f0bc99f706a9dee21dfd1810b4bbbf228d0e8a"},
64
+ {file = "pydantic_core-2.33.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:881b21b5549499972441da4758d662aeea93f1923f953e9cbaff14b8b9565aef"},
65
+ {file = "pydantic_core-2.33.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:bdc25f3681f7b78572699569514036afe3c243bc3059d3942624e936ec93450e"},
66
+ {file = "pydantic_core-2.33.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:fe5b32187cbc0c862ee201ad66c30cf218e5ed468ec8dc1cf49dec66e160cc4d"},
67
+ {file = "pydantic_core-2.33.2-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:bc7aee6f634a6f4a95676fcb5d6559a2c2a390330098dba5e5a5f28a2e4ada30"},
68
+ {file = "pydantic_core-2.33.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:235f45e5dbcccf6bd99f9f472858849f73d11120d76ea8707115415f8e5ebebf"},
69
+ {file = "pydantic_core-2.33.2-cp311-cp311-win32.whl", hash = "sha256:6368900c2d3ef09b69cb0b913f9f8263b03786e5b2a387706c5afb66800efd51"},
70
+ {file = "pydantic_core-2.33.2-cp311-cp311-win_amd64.whl", hash = "sha256:1e063337ef9e9820c77acc768546325ebe04ee38b08703244c1309cccc4f1bab"},
71
+ {file = "pydantic_core-2.33.2-cp311-cp311-win_arm64.whl", hash = "sha256:6b99022f1d19bc32a4c2a0d544fc9a76e3be90f0b3f4af413f87d38749300e65"},
72
+ {file = "pydantic_core-2.33.2-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:a7ec89dc587667f22b6a0b6579c249fca9026ce7c333fc142ba42411fa243cdc"},
73
+ {file = "pydantic_core-2.33.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:3c6db6e52c6d70aa0d00d45cdb9b40f0433b96380071ea80b09277dba021ddf7"},
74
+ {file = "pydantic_core-2.33.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4e61206137cbc65e6d5256e1166f88331d3b6238e082d9f74613b9b765fb9025"},
75
+ {file = "pydantic_core-2.33.2-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:eb8c529b2819c37140eb51b914153063d27ed88e3bdc31b71198a198e921e011"},
76
+ {file = "pydantic_core-2.33.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c52b02ad8b4e2cf14ca7b3d918f3eb0ee91e63b3167c32591e57c4317e134f8f"},
77
+ {file = "pydantic_core-2.33.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:96081f1605125ba0855dfda83f6f3df5ec90c61195421ba72223de35ccfb2f88"},
78
+ {file = "pydantic_core-2.33.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8f57a69461af2a5fa6e6bbd7a5f60d3b7e6cebb687f55106933188e79ad155c1"},
79
+ {file = "pydantic_core-2.33.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:572c7e6c8bb4774d2ac88929e3d1f12bc45714ae5ee6d9a788a9fb35e60bb04b"},
80
+ {file = "pydantic_core-2.33.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:db4b41f9bd95fbe5acd76d89920336ba96f03e149097365afe1cb092fceb89a1"},
81
+ {file = "pydantic_core-2.33.2-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:fa854f5cf7e33842a892e5c73f45327760bc7bc516339fda888c75ae60edaeb6"},
82
+ {file = "pydantic_core-2.33.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:5f483cfb75ff703095c59e365360cb73e00185e01aaea067cd19acffd2ab20ea"},
83
+ {file = "pydantic_core-2.33.2-cp312-cp312-win32.whl", hash = "sha256:9cb1da0f5a471435a7bc7e439b8a728e8b61e59784b2af70d7c169f8dd8ae290"},
84
+ {file = "pydantic_core-2.33.2-cp312-cp312-win_amd64.whl", hash = "sha256:f941635f2a3d96b2973e867144fde513665c87f13fe0e193c158ac51bfaaa7b2"},
85
+ {file = "pydantic_core-2.33.2-cp312-cp312-win_arm64.whl", hash = "sha256:cca3868ddfaccfbc4bfb1d608e2ccaaebe0ae628e1416aeb9c4d88c001bb45ab"},
86
+ {file = "pydantic_core-2.33.2-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:1082dd3e2d7109ad8b7da48e1d4710c8d06c253cbc4a27c1cff4fbcaa97a9e3f"},
87
+ {file = "pydantic_core-2.33.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:f517ca031dfc037a9c07e748cefd8d96235088b83b4f4ba8939105d20fa1dcd6"},
88
+ {file = "pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0a9f2c9dd19656823cb8250b0724ee9c60a82f3cdf68a080979d13092a3b0fef"},
89
+ {file = "pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:2b0a451c263b01acebe51895bfb0e1cc842a5c666efe06cdf13846c7418caa9a"},
90
+ {file = "pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1ea40a64d23faa25e62a70ad163571c0b342b8bf66d5fa612ac0dec4f069d916"},
91
+ {file = "pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0fb2d542b4d66f9470e8065c5469ec676978d625a8b7a363f07d9a501a9cb36a"},
92
+ {file = "pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9fdac5d6ffa1b5a83bca06ffe7583f5576555e6c8b3a91fbd25ea7780f825f7d"},
93
+ {file = "pydantic_core-2.33.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:04a1a413977ab517154eebb2d326da71638271477d6ad87a769102f7c2488c56"},
94
+ {file = "pydantic_core-2.33.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:c8e7af2f4e0194c22b5b37205bfb293d166a7344a5b0d0eaccebc376546d77d5"},
95
+ {file = "pydantic_core-2.33.2-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:5c92edd15cd58b3c2d34873597a1e20f13094f59cf88068adb18947df5455b4e"},
96
+ {file = "pydantic_core-2.33.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:65132b7b4a1c0beded5e057324b7e16e10910c106d43675d9bd87d4f38dde162"},
97
+ {file = "pydantic_core-2.33.2-cp313-cp313-win32.whl", hash = "sha256:52fb90784e0a242bb96ec53f42196a17278855b0f31ac7c3cc6f5c1ec4811849"},
98
+ {file = "pydantic_core-2.33.2-cp313-cp313-win_amd64.whl", hash = "sha256:c083a3bdd5a93dfe480f1125926afcdbf2917ae714bdb80b36d34318b2bec5d9"},
99
+ {file = "pydantic_core-2.33.2-cp313-cp313-win_arm64.whl", hash = "sha256:e80b087132752f6b3d714f041ccf74403799d3b23a72722ea2e6ba2e892555b9"},
100
+ {file = "pydantic_core-2.33.2-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:61c18fba8e5e9db3ab908620af374db0ac1baa69f0f32df4f61ae23f15e586ac"},
101
+ {file = "pydantic_core-2.33.2-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:95237e53bb015f67b63c91af7518a62a8660376a6a0db19b89acc77a4d6199f5"},
102
+ {file = "pydantic_core-2.33.2-cp313-cp313t-win_amd64.whl", hash = "sha256:c2fc0a768ef76c15ab9238afa6da7f69895bb5d1ee83aeea2e3509af4472d0b9"},
103
+ {file = "pydantic_core-2.33.2-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:a2b911a5b90e0374d03813674bf0a5fbbb7741570dcd4b4e85a2e48d17def29d"},
104
+ {file = "pydantic_core-2.33.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:6fa6dfc3e4d1f734a34710f391ae822e0a8eb8559a85c6979e14e65ee6ba2954"},
105
+ {file = "pydantic_core-2.33.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c54c939ee22dc8e2d545da79fc5381f1c020d6d3141d3bd747eab59164dc89fb"},
106
+ {file = "pydantic_core-2.33.2-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:53a57d2ed685940a504248187d5685e49eb5eef0f696853647bf37c418c538f7"},
107
+ {file = "pydantic_core-2.33.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:09fb9dd6571aacd023fe6aaca316bd01cf60ab27240d7eb39ebd66a3a15293b4"},
108
+ {file = "pydantic_core-2.33.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0e6116757f7959a712db11f3e9c0a99ade00a5bbedae83cb801985aa154f071b"},
109
+ {file = "pydantic_core-2.33.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8d55ab81c57b8ff8548c3e4947f119551253f4e3787a7bbc0b6b3ca47498a9d3"},
110
+ {file = "pydantic_core-2.33.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c20c462aa4434b33a2661701b861604913f912254e441ab8d78d30485736115a"},
111
+ {file = "pydantic_core-2.33.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:44857c3227d3fb5e753d5fe4a3420d6376fa594b07b621e220cd93703fe21782"},
112
+ {file = "pydantic_core-2.33.2-cp39-cp39-musllinux_1_1_armv7l.whl", hash = "sha256:eb9b459ca4df0e5c87deb59d37377461a538852765293f9e6ee834f0435a93b9"},
113
+ {file = "pydantic_core-2.33.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:9fcd347d2cc5c23b06de6d3b7b8275be558a0c90549495c699e379a80bf8379e"},
114
+ {file = "pydantic_core-2.33.2-cp39-cp39-win32.whl", hash = "sha256:83aa99b1285bc8f038941ddf598501a86f1536789740991d7d8756e34f1e74d9"},
115
+ {file = "pydantic_core-2.33.2-cp39-cp39-win_amd64.whl", hash = "sha256:f481959862f57f29601ccced557cc2e817bce7533ab8e01a797a48b49c9692b3"},
116
+ {file = "pydantic_core-2.33.2-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:5c4aa4e82353f65e548c476b37e64189783aa5384903bfea4f41580f255fddfa"},
117
+ {file = "pydantic_core-2.33.2-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:d946c8bf0d5c24bf4fe333af284c59a19358aa3ec18cb3dc4370080da1e8ad29"},
118
+ {file = "pydantic_core-2.33.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:87b31b6846e361ef83fedb187bb5b4372d0da3f7e28d85415efa92d6125d6e6d"},
119
+ {file = "pydantic_core-2.33.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aa9d91b338f2df0508606f7009fde642391425189bba6d8c653afd80fd6bb64e"},
120
+ {file = "pydantic_core-2.33.2-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2058a32994f1fde4ca0480ab9d1e75a0e8c87c22b53a3ae66554f9af78f2fe8c"},
121
+ {file = "pydantic_core-2.33.2-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:0e03262ab796d986f978f79c943fc5f620381be7287148b8010b4097f79a39ec"},
122
+ {file = "pydantic_core-2.33.2-pp310-pypy310_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:1a8695a8d00c73e50bff9dfda4d540b7dee29ff9b8053e38380426a85ef10052"},
123
+ {file = "pydantic_core-2.33.2-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:fa754d1850735a0b0e03bcffd9d4b4343eb417e47196e4485d9cca326073a42c"},
124
+ {file = "pydantic_core-2.33.2-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:a11c8d26a50bfab49002947d3d237abe4d9e4b5bdc8846a63537b6488e197808"},
125
+ {file = "pydantic_core-2.33.2-pp311-pypy311_pp73-macosx_10_12_x86_64.whl", hash = "sha256:dd14041875d09cc0f9308e37a6f8b65f5585cf2598a53aa0123df8b129d481f8"},
126
+ {file = "pydantic_core-2.33.2-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:d87c561733f66531dced0da6e864f44ebf89a8fba55f31407b00c2f7f9449593"},
127
+ {file = "pydantic_core-2.33.2-pp311-pypy311_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2f82865531efd18d6e07a04a17331af02cb7a651583c418df8266f17a63c6612"},
128
+ {file = "pydantic_core-2.33.2-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2bfb5112df54209d820d7bf9317c7a6c9025ea52e49f46b6a2060104bba37de7"},
129
+ {file = "pydantic_core-2.33.2-pp311-pypy311_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:64632ff9d614e5eecfb495796ad51b0ed98c453e447a76bcbeeb69615079fc7e"},
130
+ {file = "pydantic_core-2.33.2-pp311-pypy311_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:f889f7a40498cc077332c7ab6b4608d296d852182211787d4f3ee377aaae66e8"},
131
+ {file = "pydantic_core-2.33.2-pp311-pypy311_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:de4b83bb311557e439b9e186f733f6c645b9417c84e2eb8203f3f820a4b988bf"},
132
+ {file = "pydantic_core-2.33.2-pp311-pypy311_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:82f68293f055f51b51ea42fafc74b6aad03e70e191799430b90c13d643059ebb"},
133
+ {file = "pydantic_core-2.33.2-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:329467cecfb529c925cf2bbd4d60d2c509bc2fb52a20c1045bf09bb70971a9c1"},
134
+ {file = "pydantic_core-2.33.2-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:87acbfcf8e90ca885206e98359d7dca4bcbb35abdc0ff66672a293e1d7a19101"},
135
+ {file = "pydantic_core-2.33.2-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:7f92c15cd1e97d4b12acd1cc9004fa092578acfa57b67ad5e43a197175d01a64"},
136
+ {file = "pydantic_core-2.33.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d3f26877a748dc4251cfcfda9dfb5f13fcb034f5308388066bcfe9031b63ae7d"},
137
+ {file = "pydantic_core-2.33.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dac89aea9af8cd672fa7b510e7b8c33b0bba9a43186680550ccf23020f32d535"},
138
+ {file = "pydantic_core-2.33.2-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:970919794d126ba8645f3837ab6046fb4e72bbc057b3709144066204c19a455d"},
139
+ {file = "pydantic_core-2.33.2-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:3eb3fe62804e8f859c49ed20a8451342de53ed764150cb14ca71357c765dc2a6"},
140
+ {file = "pydantic_core-2.33.2-pp39-pypy39_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:3abcd9392a36025e3bd55f9bd38d908bd17962cc49bc6da8e7e96285336e2bca"},
141
+ {file = "pydantic_core-2.33.2-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:3a1c81334778f9e3af2f8aeb7a960736e5cab1dfebfb26aabca09afd2906c039"},
142
+ {file = "pydantic_core-2.33.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:2807668ba86cb38c6817ad9bc66215ab8584d1d304030ce4f0887336f28a5e27"},
143
+ {file = "pydantic_core-2.33.2.tar.gz", hash = "sha256:7cb8bc3605c29176e1b105350d2e6474142d7c1bd1d9327c4a9bdb46bf827acc"},
144
+ ]
145
+
146
+ [package.dependencies]
147
+ typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0"
148
+
149
+ [[package]]
150
+ name = "python-dateutil"
151
+ version = "2.9.0.post0"
152
+ description = "Extensions to the standard Python datetime module"
153
+ optional = false
154
+ python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7"
155
+ groups = ["main"]
156
+ files = [
157
+ {file = "python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3"},
158
+ {file = "python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427"},
159
+ ]
160
+
161
+ [package.dependencies]
162
+ six = ">=1.5"
163
+
164
+ [[package]]
165
+ name = "six"
166
+ version = "1.17.0"
167
+ description = "Python 2 and 3 compatibility utilities"
168
+ optional = false
169
+ python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7"
170
+ groups = ["main"]
171
+ files = [
172
+ {file = "six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274"},
173
+ {file = "six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81"},
174
+ ]
175
+
176
+ [[package]]
177
+ name = "types-python-dateutil"
178
+ version = "2.9.0.20241206"
179
+ description = "Typing stubs for python-dateutil"
180
+ optional = false
181
+ python-versions = ">=3.8"
182
+ groups = ["main"]
183
+ files = [
184
+ {file = "types_python_dateutil-2.9.0.20241206-py3-none-any.whl", hash = "sha256:e248a4bc70a486d3e3ec84d0dc30eec3a5f979d6e7ee4123ae043eedbb987f53"},
185
+ {file = "types_python_dateutil-2.9.0.20241206.tar.gz", hash = "sha256:18f493414c26ffba692a72369fea7a154c502646301ebfe3d56a04b3767284cb"},
186
+ ]
187
+
188
+ [[package]]
189
+ name = "typing-extensions"
190
+ version = "4.13.2"
191
+ description = "Backported and Experimental Type Hints for Python 3.8+"
192
+ optional = false
193
+ python-versions = ">=3.8"
194
+ groups = ["main"]
195
+ files = [
196
+ {file = "typing_extensions-4.13.2-py3-none-any.whl", hash = "sha256:a439e7c04b49fec3e5d3e2beaa21755cadbbdc391694e28ccdd36ca4a1408f8c"},
197
+ {file = "typing_extensions-4.13.2.tar.gz", hash = "sha256:e6c81219bd689f51865d9e372991c540bda33a0379d5573cddb9a3a23f7caaef"},
198
+ ]
199
+
200
+ [[package]]
201
+ name = "typing-inspection"
202
+ version = "0.4.0"
203
+ description = "Runtime typing introspection tools"
204
+ optional = false
205
+ python-versions = ">=3.9"
206
+ groups = ["main"]
207
+ files = [
208
+ {file = "typing_inspection-0.4.0-py3-none-any.whl", hash = "sha256:50e72559fcd2a6367a19f7a7e610e6afcb9fac940c650290eed893d61386832f"},
209
+ {file = "typing_inspection-0.4.0.tar.gz", hash = "sha256:9765c87de36671694a67904bf2c96e395be9c6439bb6c87b5142569dcdd65122"},
210
+ ]
211
+
212
+ [package.dependencies]
213
+ typing-extensions = ">=4.12.0"
214
+
215
+ [metadata]
216
+ lock-version = "2.1"
217
+ python-versions = ">=3.11,<4"
218
+ content-hash = "3fcef7ed2cc8d61da9285b1c2358fb316b8f4c5e67fa7eb29bb2147f86d64892"
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "sgf-parser"
3
- version = "0.0.7"
3
+ version = "0.0.8"
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"
@@ -8,7 +8,6 @@ from pydantic import BaseModel, Field, AliasChoices, model_validator, computed_f
8
8
 
9
9
  from sgf_parser.datetime_parser import convert_str_to_datetime, convert_str_to_time
10
10
  from sgf_parser.models import MethodType
11
- from sgf_parser.models.types import FlushingVariant, HammeringVariant, RotationVariant
12
11
 
13
12
 
14
13
  class MethodData(BaseModel, abc.ABC):
@@ -135,11 +134,8 @@ class MethodData(BaseModel, abc.ABC):
135
134
 
136
135
  # class Method(BaseModel, abc.ABC):
137
136
  class Method(BaseModel):
138
- _flushing_variant: FlushingVariant | None = None
139
137
  _current_flushing_active_state: bool = False
140
- _hammering_variant: HammeringVariant | None = None
141
138
  _current_hammer_active_state: bool = False
142
- _rotation_variant: RotationVariant | None = None
143
139
  _current_increased_rotation_state: bool = False
144
140
 
145
141
  def __init__(self, **kwargs):
@@ -148,31 +144,6 @@ class Method(BaseModel):
148
144
  def post_processing(self):
149
145
  pass
150
146
 
151
- def detect_flushing_rule(self) -> FlushingVariant:
152
- """
153
- Call this with the method data before parsing the method data.
154
-
155
- The result of calling this method will set the self.detected_flushing_variant to either use the "K" code if any
156
- regulating the flushing are present, the "AR" (flushing on/off) code or the "I" (flushing pressure) code.
157
- """
158
- if self._flushing_variant:
159
- return self._flushing_variant
160
-
161
- if any(
162
- [
163
- row.comment_code in (72, 73, 76, 77)
164
- or any(x in (72, 73, 76, 77) for x in self.extract_codes(row.remarks))
165
- for row in self.method_data
166
- ]
167
- ):
168
- self._flushing_variant = FlushingVariant.CODE_K
169
- elif any([getattr(row, "flushing") is not None for row in self.method_data]):
170
- self._flushing_variant = FlushingVariant.CODE_AR
171
- else:
172
- self._flushing_variant = FlushingVariant.CODE_I
173
-
174
- return self._flushing_variant
175
-
176
147
  @classmethod
177
148
  def extract_codes(cls, remarks: str | None) -> tuple[int, ...]:
178
149
  """
@@ -195,10 +166,10 @@ class Method(BaseModel):
195
166
 
196
167
  The following priority should be used to figure out if flushing is active:
197
168
 
198
- 1. Check K (kode) regulating flushing in file, use only K codes
199
- 2. If no K codes present in file, then check if "AR" code is present and has
169
+ 1. Check K (kode) regulating flushing in file
170
+ 2. If no K code present, then check if "AR" code is present and has
200
171
  a value (0 or 0.0 = off, 1 or 1.0 = on)
201
- 3. If no "AR" code is present in the file, then check if "I" (flushing pressure) > 0.1
172
+ 3. If no "AR" code is present, then check if "I" (flushing pressure) > 0.1
202
173
  4. Otherwise, return False
203
174
 
204
175
  Codes used:
@@ -207,49 +178,28 @@ class Method(BaseModel):
207
178
  Kode 76 (hammer and flushing on)
208
179
  Kode 77 (hammer and flushing off)
209
180
  """
210
- if self._flushing_variant == FlushingVariant.CODE_K:
211
- if data_row.comment_code in (72, 76) or any(x in (72, 76) for x in self.extract_codes(data_row.remarks)):
181
+ if data_row.comment_code in (72, 76) or any(x in (72, 76) for x in self.extract_codes(data_row.remarks)):
182
+ self._current_flushing_active_state = True
183
+ return self._current_flushing_active_state
184
+ # TODO: check remark for extra codes
185
+ elif data_row.comment_code in (73, 77) or any(x in (73, 77) for x in self.extract_codes(data_row.remarks)):
186
+ self._current_flushing_active_state = False
187
+ return self._current_flushing_active_state
188
+
189
+ if data_row.flushing is not None:
190
+ self._current_flushing_active_state = data_row.flushing
191
+ return self._current_flushing_active_state
192
+
193
+ if data_row.flushing_pressure is not None:
194
+ if data_row.flushing_pressure > Decimal("0.1"):
212
195
  self._current_flushing_active_state = True
213
- # TODO: check remark for extra codes
214
- elif data_row.comment_code in (73, 77) or any(x in (73, 77) for x in self.extract_codes(data_row.remarks)):
196
+ else:
215
197
  self._current_flushing_active_state = False
216
198
 
217
- elif self._flushing_variant == FlushingVariant.CODE_AR:
218
- if data_row.flushing is not None:
219
- self._current_flushing_active_state = data_row.flushing
220
-
221
- elif self._flushing_variant == FlushingVariant.CODE_I:
222
- if data_row.flushing_pressure is not None:
223
- if data_row.flushing_pressure > Decimal("0.1"):
224
- self._current_flushing_active_state = True
225
- else:
226
- self._current_flushing_active_state = False
199
+ return self._current_flushing_active_state
227
200
 
228
201
  return self._current_flushing_active_state
229
202
 
230
- def detect_hammering_rule(self) -> HammeringVariant | None:
231
- """
232
- Call this with the method data loaded before parsing the hammering in the method data.
233
-
234
- The result of calling this method will set the self._hammering_variant to either use the "K" code if
235
- any regulating the hammering are present, the "AP" (hammering on/off) code.
236
- """
237
- if self._hammering_variant:
238
- return self._hammering_variant
239
-
240
- if any(
241
- [
242
- row.comment_code in (74, 75, 76, 77)
243
- or any(x in (74, 75, 76, 77) for x in self.extract_codes(row.remarks))
244
- for row in self.method_data
245
- ]
246
- ):
247
- self._hammering_variant = HammeringVariant.K
248
- else:
249
- self._hammering_variant = HammeringVariant.AP
250
-
251
- return self._hammering_variant
252
-
253
203
  def is_hammer_active(
254
204
  self,
255
205
  data_row, #: models.MethodCPTData| models.MethodTOTData| models.MethodRPData| models.MethodSRSData,
@@ -269,46 +219,18 @@ class Method(BaseModel):
269
219
  Kode 76 (hammer and flushing on)
270
220
  Kode 77 (hammer and flushing off)
271
221
  """
272
- if self._hammering_variant == HammeringVariant.K:
273
- if data_row.comment_code in (74, 76) or any(x in (74, 76) for x in self.extract_codes(data_row.remarks)):
274
- self._current_hammer_active_state = True
275
- return self._current_hammer_active_state
276
- elif data_row.comment_code in (75, 77) or any(x in (75, 77) for x in self.extract_codes(data_row.remarks)):
277
- self._current_hammer_active_state = False
278
- return self._current_hammer_active_state
279
-
280
- elif self._hammering_variant == HammeringVariant.AP:
281
- if data_row.hammering is not None:
282
- self._current_hammer_active_state = data_row.hammering
283
- return self._current_hammer_active_state
284
-
285
- return self._current_hammer_active_state
286
-
287
- def detect_increased_rotation_rule(self) -> RotationVariant | None:
288
- """
289
- Call this with the method data before updating the increased rotation in the method data.
222
+ if data_row.comment_code in (74, 76) or any(x in (74, 76) for x in self.extract_codes(data_row.remarks)):
223
+ self._current_hammer_active_state = True
224
+ return self._current_hammer_active_state
225
+ elif data_row.comment_code in (75, 77) or any(x in (75, 77) for x in self.extract_codes(data_row.remarks)):
226
+ self._current_hammer_active_state = False
227
+ return self._current_hammer_active_state
290
228
 
291
- The result of calling this method will set the self._increased_rotation_variant to either use the
292
- "K" code if any regulating the increased rotation are present, the "AQ" (increased rotation on/off) code
293
- or the "R" (rotation rate) code.
294
- """
229
+ if data_row.hammering is not None:
230
+ self._current_hammer_active_state = data_row.hammering
231
+ return self._current_hammer_active_state
295
232
 
296
- if self._rotation_variant:
297
- return self._rotation_variant
298
-
299
- if any(
300
- [
301
- row.comment_code in (70, 71) or any(x in (70, 71) for x in self.extract_codes(row.remarks))
302
- for row in self.method_data
303
- ]
304
- ):
305
- self._rotation_variant = RotationVariant.K
306
- elif any([row.increased_rotation_rate is not None for row in self.method_data]):
307
- self._rotation_variant = RotationVariant.AQ
308
- else:
309
- self._rotation_variant = RotationVariant.R
310
-
311
- return self._rotation_variant
233
+ return self._current_hammer_active_state
312
234
 
313
235
  def is_increased_rotation_active(
314
236
  self,
@@ -328,53 +250,24 @@ class Method(BaseModel):
328
250
  Kode 70 (increased rotation speed on)
329
251
  Kode 71 (increased rotation speed off)
330
252
  """
331
- if self._rotation_variant == RotationVariant.K:
332
- if data_row.comment_code == 70:
253
+ if data_row.comment_code == 70:
254
+ self._current_increased_rotation_state = True
255
+ return self._current_increased_rotation_state
256
+ elif data_row.comment_code == 71:
257
+ self._current_increased_rotation_state = False
258
+ return self._current_increased_rotation_state
259
+ if data_row.increased_rotation_rate is not None:
260
+ self._current_increased_rotation_state = data_row.increased_rotation_rate
261
+ return self._current_increased_rotation_state
262
+ if data_row.rotation_rate is not None:
263
+ if data_row.rotation_rate > 35:
333
264
  self._current_increased_rotation_state = True
334
- elif data_row.comment_code == 71:
265
+ else:
335
266
  self._current_increased_rotation_state = False
336
- elif self._rotation_variant == RotationVariant.AQ:
337
- if data_row.increased_rotation_rate is not None:
338
- self._current_increased_rotation_state = data_row.increased_rotation_rate
339
- else:
340
- if data_row.rotation_rate is not None:
341
- if data_row.rotation_rate > 35:
342
- self._current_increased_rotation_state = True
343
- else:
344
- self._current_increased_rotation_state = False
267
+ return self._current_increased_rotation_state
345
268
 
346
269
  return self._current_increased_rotation_state
347
270
 
348
- def flushing_update(self):
349
- """
350
- Update flushing
351
-
352
- """
353
- self._flushing_variant = self.detect_flushing_rule()
354
-
355
- for data in self.method_data:
356
- data.flushing = self.is_flushing_active(data)
357
-
358
- def hammering_update(self):
359
- """
360
- Update hammering
361
-
362
- """
363
- self._hammering_variant = self.detect_hammering_rule()
364
-
365
- for data in self.method_data:
366
- data.hammering = self.is_hammer_active(data)
367
-
368
- def rotation_update(self):
369
- """
370
- Update rotation
371
-
372
- """
373
- self._rotation_variant = self.detect_increased_rotation_rule()
374
-
375
- for data in self.method_data:
376
- data.increased_rotation_rate = self.is_increased_rotation_active(data)
377
-
378
271
  @model_validator(mode="before")
379
272
  @classmethod
380
273
  def guess_date_format(cls, data: Any) -> Any:
@@ -39,16 +39,3 @@ class MethodRP(Method):
39
39
  method_data_type: type[MethodRPData] = MethodRPData
40
40
 
41
41
  method_data: list[MethodRPData] = []
42
-
43
- def post_processing(self):
44
- """
45
- Post-processing
46
-
47
- """
48
-
49
- if not self.method_data:
50
- return
51
-
52
- # Update flushing and increased rotation
53
- self.flushing_update()
54
- self.rotation_update()
@@ -93,20 +93,6 @@ class MethodSRS(Method):
93
93
 
94
94
  return data
95
95
 
96
- def post_processing(self):
97
- """
98
- Post-processing
99
-
100
- """
101
-
102
- if not self.method_data:
103
- return
104
-
105
- # Update flushing, hammering and increased rotation
106
- self.flushing_update()
107
- self.hammering_update()
108
- self.rotation_update()
109
-
110
96
  @computed_field
111
97
  def depth_in_rock(self) -> Decimal | None:
112
98
  _rock_top_depth = None
@@ -159,17 +159,3 @@ class MethodTOT(Method):
159
159
  return Decimal(self.point_z) - _depth_in_soil
160
160
 
161
161
  return None
162
-
163
- def post_processing(self):
164
- """
165
- Post-processing
166
-
167
- """
168
-
169
- if not self.method_data:
170
- return
171
-
172
- # Update flushing, hammering and increased rotation
173
- self.flushing_update()
174
- self.hammering_update()
175
- self.rotation_update()
@@ -81,35 +81,6 @@ class ParseState(enum.Enum):
81
81
  QUIT = 3
82
82
 
83
83
 
84
- class FlushingVariant(enum.StrEnum):
85
- """
86
- Flushing variants
87
- """
88
-
89
- CODE_K = "K"
90
- CODE_AR = "AR"
91
- CODE_I = "I"
92
-
93
-
94
- class HammeringVariant(enum.StrEnum):
95
- """
96
- Hammering variants
97
- """
98
-
99
- K = "K"
100
- AP = "AP"
101
-
102
-
103
- class RotationVariant(enum.StrEnum):
104
- """
105
- Rotation variants
106
- """
107
-
108
- K = "K"
109
- AQ = "AQ"
110
- R = "R"
111
-
112
-
113
84
  class SoundingClass(enum.StrEnum):
114
85
  """
115
86
  Soil-Rock-Sounding (Swedish Jord-bergsondering) classes
@@ -142,4 +142,10 @@ class Parser:
142
142
  def parse_data(self, method: Method, row: str) -> MethodData:
143
143
  row_dict = self._convert_str_to_dict(row)
144
144
  method_data = method.method_data_type.model_validate(row_dict)
145
+ if hasattr(method_data, "flushing"):
146
+ method_data.flushing = method.is_flushing_active(method_data)
147
+ if hasattr(method_data, "hammering"):
148
+ method_data.hammering = method.is_hammer_active(method_data)
149
+ if hasattr(method_data, "increased_rotation_rate"):
150
+ method_data.increased_rotation_rate = method.is_increased_rotation_active(method_data)
145
151
  return method_data
@@ -510,9 +510,9 @@ class TestParse:
510
510
  datetime(2018, 11, 20, 10, 50,21),
511
511
  {
512
512
  # load=A, hammering=AP, load=W, turning=H, rotation_rate=R
513
- Decimal("3.625"): {"load":Decimal("1.020"), "turning":Decimal("152"), "penetration_rate": Decimal("154.208"), "comment_code": None, "remarks": None, "hammering": None},
514
- Decimal("3.700"): {"load": Decimal("1.020"), "turning": Decimal("24"), "penetration_rate": Decimal("10.287"), "hammering": None,},
515
- Decimal("3.775"): {"load": Decimal("5.681"), "turning": Decimal("24"), "penetration_rate": Decimal("1.506"), "hammering": None, "comment_code": 91, "remarks": "Sond kan ej drivas normalt"},
513
+ Decimal("3.625"): {"load":Decimal("1.020"), "turning":Decimal("152"), "penetration_rate": Decimal("154.208"), "comment_code": None, "remarks": None, "hammering": False},
514
+ Decimal("3.700"): {"load": Decimal("1.020"), "turning": Decimal("24"), "penetration_rate": Decimal("10.287"), "hammering": False,},
515
+ Decimal("3.775"): {"load": Decimal("5.681"), "turning": Decimal("24"), "penetration_rate": Decimal("1.506"), "hammering": False, "comment_code": 91, "remarks": "Sond kan ej drivas normalt"},
516
516
  },
517
517
  ),
518
518
  ),
@@ -53,25 +53,25 @@ class TestTotKCodes:
53
53
  ("D", "K_72_F_ON", "D", "K_73_F_OFF", "D", "K_74_H_ON", "K_75_H_OFF", "D", "K_76_H_F_ON", "D", "K_77_H_F_OFF", "D", "K_72_F_ON", "D", "K_77_H_F_OFF", "K_90",),
54
54
  (False, False, False, False, False, True, False, False, True, True, False, False, False, False, False, False),
55
55
  ),
56
- ( # Case #4: K codes (overrides AP)
56
+ ( # Case #4: K codes do not override AP
57
57
  ("D", "AP_ON", "I_ON", "K_74_H_ON", "I_OFF", "D", "I_OFF", "AP_OFF", "AP_ON", "I_ON", "D", "I_OFF", "K_90"),
58
- (False, False, False, True, True, True, True, True, True, True, True, True, True),
58
+ (False, True, True, True, True, True, True, False, True, True, True, True, True),
59
59
  ),
60
60
  ( # Case #5: No K codes, AP codes
61
61
  ("AP_ON", "I_OFF", "AP_OFF", "D", "I_ON", "I_OFF", "D", "AP_ON", "D", "AP_OFF"),
62
62
  (True, True, False, False, False, False, False, True, True, False),
63
63
  ),
64
- ( # Case #6: Multiple K codes on the same row (overrides AP)
64
+ ( # Case #6: Multiple K codes on the same row do not overrides AP
65
65
  ("AP_ON", "D", "AP_OFF", "D", "I_ON", "K_MULTI_H_F_ON", "D", "K_MULTI_H_F_ON", "D", "AP_OFF", "K_MULTI_H_F_OFF", "K_MULTI_H_F_ON_REVERSE", "D", "K_MULTI_H_F_OFF_REVERSE", "K_90"),
66
- (False, False, False, False, False, True, True, True, True, True, False, True, True, False, False),
66
+ (True, True, False, False, False, True, True, True, True, False, False, True, True, False, False),
67
67
  ),
68
68
  ],
69
69
  )
70
70
  # fmt: on
71
71
  def test_hammering(self, rows, expected_hammering):
72
72
  """
73
- K - If K codes regulating flushing, then only look at K codes.
74
- AP - If no K codes present (regulating hammering), then look at the AP code.
73
+ K - If K code regulating hammering, then look at K code.
74
+ AP - If no K code present (regulating hammering), then look at the AP code.
75
75
 
76
76
  """
77
77
  # Header
@@ -106,25 +106,25 @@ class TestTotKCodes:
106
106
  ("D", "K_72_F_ON", "D", "K_73_F_OFF", "D","K_74_H_ON", "K_75_H_OFF", "D", "K_76_H_F_ON", "D", "K_77_H_F_OFF", "D", "K_72_F_ON", "D", "K_77_H_F_OFF", "K_90",),
107
107
  (False, True, True, False, False, False, False, False, True, True, False, False, True, True, False, False),
108
108
  ),
109
- ( # Case #4: K codes (overrides AR and I)
109
+ ( # Case #4: K codes do not override AR and I
110
110
  ("D", "AR_ON", "I_ON", "K_72_F_ON", "I_OFF", "D", "I_OFF", "D", "D", "I_ON", "D", "I_OFF", "K_90"),
111
- (False, False, False, True, True, True, True, True, True, True, True, True, True),
111
+ (False, True, True, True, False, False, False, False, False, True, True, False, False),
112
112
  ),
113
- ( # Case #5: No K codes, AR codes (overrides I)
113
+ ( # Case #5: No K codes, only AR codes and I codes
114
114
  ("AR_ON", "I_OFF", "AR_OFF", "D", "I_ON", "I_OFF", "D", "AR_ON", "D", "AR_OFF"),
115
- (True, True, False, False, False, False, False, True, True, False),
115
+ (True, False, False, False, True, False, False, True, True, False),
116
116
  ),
117
- ( # Case #6: Multiple K codes on the same row (overrides AR and I)
117
+ ( # Case #6: Multiple K codes on the same row do not overrides AR and I
118
118
  ("AR_ON", "I_ON", "AR_OFF", "D", "I_ON", "K_MULTI_H_F_ON", "D", "K_MULTI_H_F_ON", "D", "AR_OFF", "K_MULTI_H_F_OFF", "K_MULTI_H_F_ON_REVERSE", "D", "K_MULTI_H_F_OFF_REVERSE", "K_90"),
119
- (False, False, False, False, False, True, True, True, True, True, False, True, True, False, False),
119
+ (True, True, False, False, True , True, True, True, True, False, False, True, True, False, False),
120
120
  ),
121
121
  ],
122
122
  )
123
123
  # fmt: on
124
124
  def test_flushing(self, rows, expected_flushing):
125
125
  """
126
- K - If K codes regulating flushing, then only look at K codes.
127
- AR - If no K codes present (regulating flushing), then look at AR code.
126
+ K - If K code regulating flushing, then look at K code.
127
+ AR - If no K code present (regulating flushing), then look at AR code.
128
128
  I - If no K or AR code present (regulating flushing), then look at the I code. If I > 0.1 MPa then flushing is on.
129
129
 
130
130
  """
@@ -160,25 +160,25 @@ class TestTotKCodes:
160
160
  ("D", "K_70_R_ON", "D", "K_71_R_OFF", "D", "K_74_H_ON", "K_75_H_OFF", "D", "K_76_H_F_ON", "D", "K_70_R_ON", "D", "K_72_F_ON", "D", "K_70_R_ON", "K_90",),
161
161
  (False, True, True, False, False, False, False, False, False, False, True, True, True, True, True, True),
162
162
  ),
163
- ( # Case #4: K codes (overrides AQ and R)
163
+ ( # Case #4: K codes do not override AQ and R
164
164
  ("D", "AQ_ON", "R_ON", "K_70_R_ON", "R_OFF", "D", "R_OFF", "I_OFF", "D", "R_ON", "D", "R_OFF", "K_71_R_OFF", "K_90"),
165
- (False, False, False, True, True, True, True, True, True, True, True, True, False, False),
165
+ (False, True, True, True, False, False, False, False, False, True, True, False, False, False),
166
166
  ),
167
- ( # Case #5: No K codes, AQ codes (overrides R)
167
+ ( # Case #5: No K codes, AQ codes do not override R
168
168
  ("AQ_ON", "R_OFF", "AQ_OFF", "D", "R_ON", "R_OFF", "D", "AQ_ON", "D", "AQ_OFF"),
169
- (True, True, False, False, False, False, False, True, True, False),
169
+ (True, False, False, False, True, False, False, True, True, False),
170
170
  ),
171
- ( # Case #6: Multiple K codes on the same row (overrides AQ and R)
171
+ ( # Case #6: Multiple K codes on the same row, do not override AQ and R
172
172
  ("AQ_ON", "R_ON", "AQ_OFF", "D", "R_ON", "K_MULTI_H_F_R_ON_REVERSE", "D", "K_MULTI_H_F_R_ON_REVERSE", "D", "AQ_OFF", "K_MULTI_H_F_R_OFF_REVERSE", "K_MULTI_H_F_R_ON", "D", "K_MULTI_H_F_R_OFF", "K_90"),
173
- (False, False, False, False, False, True, True, True, True, True, False, True, True, False, False),
173
+ (True, True, False, False, True, True, True, True, True, False, False, True, True, False, False),
174
174
  ),
175
175
  ],
176
176
  )
177
177
  # fmt: on
178
178
  def test_rotation(self, rows, expected_rotation):
179
179
  """
180
- K - If K codes regulating increased rotation, then only look at K codes.
181
- AQ - If no K codes present (regulating increased rotation), then look at the AQ code.
180
+ K - If K code regulating increased rotation, then look at K code.
181
+ AQ - If no K code present (regulating increased rotation), then look at the AQ code.
182
182
  R - If no K or AQ code present (regulating increased rotation), then look at the R code.
183
183
  If R > 35 rpm then increased rotation is on.
184
184
  """
File without changes
File without changes
File without changes
File without changes
File without changes