Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify Great Group formative elements #20

Merged
merged 2 commits into from
Apr 15, 2021
Merged

Simplify Great Group formative elements #20

merged 2 commits into from
Apr 15, 2021

Conversation

brownag
Copy link
Member

@brownag brownag commented Apr 9, 2021

This simplifies some duplicate-definition entries that share a common formative element with various vowels or other characters appended.

They are not needed with the current version of the FormativeElements function.

These changes should make it a little easier to plan updates to formative elements LUT since definitions will only need to be changed in one place and the simplest "pattern" for a given element will be used.

There is room to make any of these more specific if different definitions are warranted, but that can be addressed further in #17

@brownag brownag requested a review from dylanbeaudette April 9, 2021 18:28
@dylanbeaudette
Copy link
Member

dylanbeaudette commented Apr 15, 2021

They are not needed with the current version of the FormativeElements function.

I wanted to verify that retaining only the "root" form of the formative elements will not interfere with explainST().

For example, are the results identical in master vs. this PR. I have not had time to check. If results are identical, then I approve this PR.

Thanks.

library(SoilTaxonomy)

taxa <- c("sulfic endoaquents", "sulfic fluvaquents", "sulfic hydraquents", 
          "thapto-histic sulfaquents", "typic sulfaquents", "haplic sulfaquents", 
          "histic sulfaquents", "sulfic fluviwassents", "sulfic haplowassents", 
          "sulfic hydrowassents", "sulfic psammowassents", "thapto-histic sulfiwassents", 
          "typic sulfiwassents", "lithic sulfiwassents", "fluventic sulfiwassents", 
          "haplic sulfiwassents", "aeric sulfiwassents", "sulfuric aquorthels", 
          "sulfuric aquiturbels", "typic sulfihemists", "terric sulfihemists", 
          "typic sulfohemists", "typic sulfisaprists", "terric sulfisaprists", 
          "typic sulfosaprists", "sulfic haplowassists", "typic sulfiwassists", 
          "sapric sulfiwassists", "fibric sulfiwassists", "sulfic cryaquepts", 
          "sulfic endoaquepts", "typic sulfaquepts", "salidic sulfaquepts", 
          "hydraquentic sulfaquepts", "typic sulfudepts", "sulfaqueptic dystraquerts", 
          "typic sulfaquerts", "salic sulfaquerts", "sulfic sulfaquerts"
)

for(i in taxa) {
  cat(explainST(i), sep = '\n')
}

@brownag
Copy link
Member Author

brownag commented Apr 15, 2021

Thanks, after last commit I can confirm those taxa outputs from explainST are identical

Everything in terms of finding the formative elements was the same, but I had to undo some wordsmithing regarding the linking of "sulf-" at great group level to specific diagnostics. I wound up elaborating on that much more in #17, and didn't intend to actually have that be in this PR.

library(SoilTaxonomy)

taxa <- c("sulfic endoaquents", "sulfic fluvaquents", "sulfic hydraquents", 
          "thapto-histic sulfaquents", "typic sulfaquents", "haplic sulfaquents", 
          "histic sulfaquents", "sulfic fluviwassents", "sulfic haplowassents", 
          "sulfic hydrowassents", "sulfic psammowassents", "thapto-histic sulfiwassents", 
          "typic sulfiwassents", "lithic sulfiwassents", "fluventic sulfiwassents", 
          "haplic sulfiwassents", "aeric sulfiwassents", "sulfuric aquorthels", 
          "sulfuric aquiturbels", "typic sulfihemists", "terric sulfihemists", 
          "typic sulfohemists", "typic sulfisaprists", "terric sulfisaprists", 
          "typic sulfosaprists", "sulfic haplowassists", "typic sulfiwassists", 
          "sapric sulfiwassists", "fibric sulfiwassists", "sulfic cryaquepts", 
          "sulfic endoaquepts", "typic sulfaquepts", "salidic sulfaquepts", 
          "hydraquentic sulfaquepts", "typic sulfudepts", "sulfaqueptic dystraquerts", 
          "typic sulfaquerts", "salic sulfaquerts", "sulfic sulfaquerts"
)

res <- lapply(taxa, explainST)

# save(res, file = "before.rda")
# save(res, file = "after.rda")

res <- NULL
load("E:/workspace/SoilTaxonomy/before.rda")
res_before <- res

res <- NULL
load("E:/workspace/SoilTaxonomy/after.rda")
res_after <- res

as.character(res_before) == as.character(res_after)
#>  [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
#> [16] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
#> [31] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE

@brownag brownag merged commit 3a46622 into master Apr 15, 2021
@brownag brownag deleted the grtgrpelmnts branch April 15, 2021 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants