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
13 changes: 6 additions & 7 deletions .github/workflows/R-CMD-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fail-fast: false
matrix:
config:
- {os: ubuntu-latest, r: 'release'}
- { os: ubuntu-latest, r: "release" }

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
Expand All @@ -32,22 +32,21 @@ jobs:
r-version: ${{ matrix.config.r }}

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
extra-packages: any::rcmdcheck, any::aqp
needs: check

- name: Install SoilKnowledgeBase
run: |
sudo apt install poppler-utils

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true

- name: Post-processing
run: |
Rscript misc/OSD-error-reporting/typical-pedon.R
Rscript misc/OSD-error-reporting/osd-sections.R

12 changes: 9 additions & 3 deletions R/create_OSD.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ validateOSD <- function(logfile, filepath) {

raw <- trimws(raw[trimws(raw) != ""])

if (length(raw) == 0) {
logmsg(logfile, "EMPTY OSD FILE: %s", filepath)
return(FALSE)
}

ser.raw.idx <- grep("SERIES$", raw)[1]
tax.raw.idx <- grep("TAXONOMIC CLASS[:]", raw)[1]
brief.desc.idx <- which(1:length(raw) > ser.raw.idx &
Expand Down Expand Up @@ -390,15 +395,16 @@ osd_to_json <- function(logfile = file.path(output_dir, "OSD.log"),

x <- validateOSD(logfile, filepath)

if (is.logical(x)) {
if (!x) return(FALSE)
}

parsed.OSD <- .doParseOSD(x, logfile, filepath)

# SPC-style components from parseOSD returned as nested data.frames in JSON
x$SITE <- I(list(parsed.OSD$`site-data`))
x$HORIZONS <- I(list(parsed.OSD$`hz-data`))

if (is.logical(x))
if (!x) return(FALSE)

fld <- file.path(output_dir, substr(x$SERIES, 1, 1))

if (!dir.exists(fld))
Expand Down
26 changes: 13 additions & 13 deletions inst/extdata/OSD-error-reporting/log.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### Problems by RO ###
auburn, al bozeman, mt davis, ca morgantown, wv salina, ks
81 840 833 107 94
81 840 830 107 94
temple, tx wasilla, AK
55 281
--------------------------------------------------------
Expand All @@ -9,7 +9,7 @@
FALSE TRUE
auburn, al 67 14
bozeman, mt 501 339
davis, ca 460 373
davis, ca 457 373
morgantown, wv 93 14
salina, ks 49 45
temple, tx 34 21
Expand All @@ -20,7 +20,7 @@
FALSE TRUE
auburn, al 74 7
bozeman, mt 508 332
davis, ca 472 361
davis, ca 469 361
morgantown, wv 94 13
salina, ks 52 42
temple, tx 47 8
Expand All @@ -33,7 +33,7 @@
AL 2 0
AR 6 5
AZ 8 4
CA 230 229
CA 224 229
CO 67 30
CT 4 0
DE 2 0
Expand Down Expand Up @@ -81,7 +81,7 @@
VA 22 6
VT 7 1
WA 104 184
WI 8 3
WI 5 3
WV 4 0
WY 208 5
--------------------------------------------------------
Expand All @@ -92,7 +92,7 @@
AL 2 0
AR 8 3
AZ 9 3
CA 225 234
CA 219 234
CO 73 24
CT 4 0
DE 2 0
Expand Down Expand Up @@ -140,7 +140,7 @@
VA 24 4
VT 7 1
WA 101 187
WI 9 2
WI 6 2
WV 4 0
WY 208 5
--------------------------------------------------------
Expand All @@ -151,7 +151,7 @@
AL 1 1
AR 8 3
AZ 5 7
CA 444 15
CA 438 15
CO 80 17
CT 4 0
DE 2 0
Expand Down Expand Up @@ -199,7 +199,7 @@
VA 18 10
VT 5 3
WA 233 55
WI 7 4
WI 4 4
WV 1 3
WY 202 11
--------------------------------------------------------
Expand All @@ -210,7 +210,7 @@
AL 2 0
AR 11 0
AZ 12 0
CA 459 0
CA 453 0
CO 92 5
CT 4 0
DE 2 0
Expand Down Expand Up @@ -258,7 +258,7 @@
VA 28 0
VT 8 0
WA 248 40
WI 11 0
WI 8 0
WV 4 0
WY 212 1
--------------------------------------------------------
Expand All @@ -269,7 +269,7 @@
AL 2 0
AR 11 0
AZ 12 0
CA 459 0
CA 453 0
CO 90 7
CT 4 0
DE 2 0
Expand Down Expand Up @@ -317,7 +317,7 @@
VA 19 9
VT 8 0
WA 251 37
WI 11 0
WI 8 0
WV 4 0
WY 212 1
--------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion inst/extdata/OSD-error-reporting/misc-errors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ GUALALA
HATU
KANA`A
LONOKE
MECCA
NEOLA
NUTALL
ODESANGEL
Expand Down
8 changes: 4 additions & 4 deletions inst/extdata/OSD/A/ALBEPEAKE.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"SERIES": "ALBEPEAKE",
"STATUS": "Tentative Series",
"BYREV": "JDK-RBT",
"REVDATE": "06/2026",
"REVDATE": "09/2026",
"STATES": "NC,VA",
"OVERVIEW": "MLRA(s)--153B\nDepth class--Very deep\nDrainage class--Subaqueous\nWater depth range--0 to 2 meters (0 to 7 feet)\nParent material--Human-transported materials over loamy estuarine deposits\nGeomorphic location--Dredge-deposit shoals\nSlope range--0 to 1 percent\nMean annual air temperature--17 degrees C (63 degrees F)\nMean annual water temperature--15 degrees C (59 degrees F)",
"TAXONOMIC CLASS": {
Expand All @@ -11,7 +11,7 @@
},
"TYPICAL PEDON": {
"section": "TYPICAL PEDON",
"content": "TYPICAL PEDON: Albepeake loamy sand in a dredge-deposit shoal under 1.2 meters of brackish water (colors are for moist soil unless otherwise stated; electrical conductivity is 1:5 by volume solution mixture unless otherwise stated).\n^Aseg--0 to 12 centimeters; 60 percent black (N 2.5/) and 40 percent greenish gray (10Y 5/1) loamy sand; structureless, single grain; nonsticky, nonplastic; slightly fluid; common medium and common fine roots throughout; no sulfurous odor; color change with 3 percent hydrogen peroxide; slight effervescence with 30 percent hydrogen peroxide; nonsaline (0.6 dS/m); neutral (pH 7.0); clear boundary.\n^Cseg1--12 to 34 centimeters; dark greenish gray (10Y 4/1) loamy sand; structureless, single grain; nonsticky, nonplastic; nonfluid; few fine roots throughout; slight sulfurous odor; color change with 3 percent hydrogen peroxide; no effervescence with 30 percent hydrogen peroxide; nonsaline (0.7 dS/m); neutral (pH 6.8); abrupt boundary.\n^Cseg2--34 to 73 centimeters; very dark gray (N 3/) silt loam; structureless, massive; slightly sticky, slightly plastic; very fluid; no sulfurous odor; no color change with 3 percent hydrogen peroxide; slight effervescence with 30 percent hydrogen peroxide; nonsaline (0.7 dS/m); neutral (pH 7.0); clear boundary.\n^Cseg3--73 to 97 centimeters; dark gray (N 4/) silt loam; structureless, massive; slightly sticky, slightly plastic; very fluid; no sulfurous odor; no color change with 3 percent hydrogen peroxide; moderate effervescence with 30 percent hydrogen peroxide; nonsaline (0.8 dS/m); neutral (pH 7.2); abrupt boundary.\n^Cseg4--97 to 122 centimeters; dark greenish gray (10Y 4/1) fine sandy loam; structureless, massive; slightly sticky, slightly plastic; slightly fluid; no sulfurous odor; no color change with 3 percent hydrogen peroxide; moderate effervescence with 30 percent hydrogen peroxide; nonsaline (1.0 dS/m); neutral (pH 7.2); clear boundary.\nCseg5--122 to 205 centimeters; dark gray (N 4/) silty clay loam; structureless, massive; moderately sticky, moderately plastic; very fluid; no sulfurous odor; no color change with 3 percent hydrogen peroxide; slight effervescence with 30 percent hydrogen peroxide; nonsaline (1.3 dS/m); slightly alkaline (pH 7.8)."
"content": "TYPICAL PEDON: Albepeake loamy sand in a dredge-deposit shoal under 1.2 meters of brackish water (colors are for moist soil unless otherwise stated; electrical conductivity is 1:5 by volume solution mixture unless otherwise stated).\n^Aseg--0 to 12 centimeters; 60 percent black (N 2.5/) and 40 percent greenish gray (10Y 5/1) loamy sand; structureless, single grain; nonsticky, nonplastic; slightly fluid; common medium and common fine roots throughout; no sulfurous odor; color change with 3 percent hydrogen peroxide; slight effervescence with 30 percent hydrogen peroxide; nonsaline (0.6 dS/m); neutral (pH 7.0); clear boundary.\n^Cseg1--12 to 34 centimeters; dark greenish gray (10Y 4/1) loamy sand; structureless, single grain; nonsticky, nonplastic; nonfluid; few fine roots throughout; slight sulfurous odor; color change with 3 percent hydrogen peroxide; no effervescence with 30 percent hydrogen peroxide; nonsaline (0.7 dS/m); neutral (pH 6.8); abrupt boundary.\n^Cseg2--34 to 73 centimeters; very dark gray (N 3/) silt loam; structureless, massive; slightly sticky, slightly plastic; very fluid; no sulfurous odor; no color change with 3 percent hydrogen peroxide; slight effervescence with 30 percent hydrogen peroxide; nonsaline (0.7 dS/m); neutral (pH 7.0); clear boundary.\n^Cseg3--73 to 97 centimeters; dark gray (N 4/) silt loam; structureless, massive; slightly sticky, slightly plastic; very fluid; no sulfurous odor; no color change with 3 percent hydrogen peroxide; moderate effervescence with 30 percent hydrogen peroxide; nonsaline (0.8 dS/m); neutral (pH 7.2); abrupt boundary.\n^Cseg4--97 to 122 centimeters; dark greenish gray (10Y 4/1) fine sandy loam; structureless, massive; slightly sticky, slightly plastic; slightly fluid; no sulfurous odor; no color change with 3 percent hydrogen peroxide; moderate effervescence with 30 percent hydrogen peroxide; nonsaline (1.0 dS/m); neutral (pH 7.2); clear boundary.\n2Cseg5--122 to 205 centimeters; dark gray (N 4/) silty clay loam; structureless, massive; moderately sticky, moderately plastic; very fluid; no sulfurous odor; no color change with 3 percent hydrogen peroxide; slight effervescence with 30 percent hydrogen peroxide; nonsaline (1.3 dS/m); slightly alkaline (pH 7.8)."
},
"TYPE LOCATION": {
"section": "TYPE LOCATION",
Expand Down Expand Up @@ -187,7 +187,7 @@
"narrative": "^Cseg4--97 to 122 centimeters; dark greenish gray (10Y 4/1) fine sandy loam; structureless, massive; slightly sticky, slightly plastic; slightly fluid; no sulfurous odor; no color change with 3 percent hydrogen peroxide; moderate effervescence with 30 percent hydrogen peroxide; nonsaline (1.0 dS/m); neutral (pH 7.2); clear boundary."
},
{
"name": "Cseg5",
"name": "2Cseg5",
"top": 122,
"bottom": 205,
"dry_hue": "NA",
Expand All @@ -207,7 +207,7 @@
"eff_class": "slight effervescence",
"distinctness": "NA",
"topography": "NA",
"narrative": "Cseg5--122 to 205 centimeters; dark gray (N 4/) silty clay loam; structureless, massive; moderately sticky, moderately plastic; very fluid; no sulfurous odor; no color change with 3 percent hydrogen peroxide; slight effervescence with 30 percent hydrogen peroxide; nonsaline (1.3 dS/m); slightly alkaline (pH 7.8)."
"narrative": "2Cseg5--122 to 205 centimeters; dark gray (N 4/) silty clay loam; structureless, massive; moderately sticky, moderately plastic; very fluid; no sulfurous odor; no color change with 3 percent hydrogen peroxide; slight effervescence with 30 percent hydrogen peroxide; nonsaline (1.3 dS/m); slightly alkaline (pH 7.8)."
}
]
]
Expand Down
Loading
Loading