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

sieve() for classifying arbitrary coarse fractions #283

Merged
merged 13 commits into from
Mar 31, 2023

Conversation

brownag
Copy link
Member

@brownag brownag commented Mar 28, 2023

This is following up from a soilDB issue ncss-tech/soilDB#217 where we wanted to make the workhorse sieve function (with custom thresholds) available for more general usage outside soilDB.

The function defined by this PR should be adequate as is to replace the internal soilDB .sieve() method (sometime in the future, probably after adding a aqp >2.0 import req). In the meantime we can do whatever we want to improve what this one does, and then adjust soilDB accordingly.

@dylanbeaudette
Copy link
Member

Nice, thanks for implementing. I like the more generalized approach in this version. I've made a couple of tiny adjustments. A tiny change, but what do you think about "class_" as the generic name vs. "grp" ?

@brownag
Copy link
Member Author

brownag commented Mar 30, 2023

A tiny change, but what do you think about "class_" as the generic name vs. "grp" ?

Totally fine with that! I pondered the default value there for about 0.5 seconds after realizing the code didnt work if sieves wasn't named; if you prefer "class_" as default for result names when sieves is an unnamed vector, that sounds great

@brownag
Copy link
Member Author

brownag commented Mar 30, 2023

Thanks for the additional example!

Also for docs probably this needs a reference to the SSM, field book, or similar for the (default) size classes.

@dylanbeaudette
Copy link
Member

OK, thanks. Good ideas. I'll adjust default prefix, and a citation.

Soil Science Division Staff. 2017. Soil survey manual. C. Ditzler, K. Scheffe, and H.C. Monger (eds.). USDA Handbook 18. Government Printing Office, Washington, D.C.

@brownag
Copy link
Member Author

brownag commented Mar 30, 2023

A couple other things I noticed:

  • "fine gravel" is one of 3 gravel subclasses and possibly shouldn't be a default cut in aqp
    • soilDB can use non-default sieves, and soilDB methods are smart enough to make sure the simplified data are composited correctly (i.e. fine gravel are included in "total gravel" volumes)
  • "parafragments" should probably be "pararock fragments"; can also mention artifacts

@dylanbeaudette
Copy link
Member

Good ideas. Feel free to add notes / examples related to artifacts.

@dylanbeaudette
Copy link
Member

Another idea, but I don't have a use case: optionally returned ordered factors.

@brownag
Copy link
Member Author

brownag commented Mar 30, 2023

Another idea, but I don't have a use case: optionally returned ordered factors.

This briefly occurred to me too; possibly a function like SoilTextureLevels() to generate the sieves argument instead of current usage of if() inside function def? This would provide an easy mechanism to swap between different standard systems used in US and abroad

@dylanbeaudette
Copy link
Member

Another idea, but I don't have a use case: optionally returned ordered factors.

This briefly occurred to me too; possibly a function like SoilTextureLevels() to generate the sieves argument instead of current usage of if() inside function def? This would provide an easy mechanism to swap between different standard systems used in US and abroad

I like that idea. Now ~90% implemented via fragmentClasses()

@dylanbeaudette
Copy link
Member

Have a peek, I'm done here and happy with the results.

@dylanbeaudette dylanbeaudette merged commit 7454939 into master Mar 31, 2023
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