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

Fixing tests and issues with minimal install #280

Merged
merged 3 commits into from
Mar 7, 2023
Merged

Fixing tests and issues with minimal install #280

merged 3 commits into from
Mar 7, 2023

Conversation

brownag
Copy link
Member

@brownag brownag commented Feb 26, 2023

Some notes/fixes from testing on a fresh machine with a minimal set of dependencies.

  • removes {scales} dependency from plotSPC()
  • removes {plyr} usage from test-SPC-combine.R
  • skip mixMunsell() tests if {gower} not installed
    fixed bad logic that required {gower} for mixMunsell(..., mixingMethod="exact")
  • avoid usage of aqp::: in tests
  • skip profile_compare() (deprecated) tests if {scales} is not installed
  • skip some slab() tests if {Hmisc} is not installed

 - removes scales dependency from plotSPC
 - removes plyr usage from test-SPC-combine.R
 - skip `mixMunsell()` tests if gower not installed
 - avoid usage of aqp::: in tests
 - skip profile_compare() (deprecated) tests if scales is not installed
 - skip some slab() tests if Hmisc is not installed
 - also don't skip default method tests
@brownag brownag marked this pull request as ready for review March 7, 2023 16:32
@brownag brownag merged commit 57566bf into master Mar 7, 2023
@dylanbeaudette
Copy link
Member

Are we 100% sure that the scales replacement is 100% compatible with all current use cases? I haven't had a chance to test that. Will have more time this week.

@brownag
Copy link
Member Author

brownag commented Mar 7, 2023

Every instance I came up with gave pretty much identical results. Can you think of something that is not currently tested that might have broken?

@brownag
Copy link
Member Author

brownag commented Mar 7, 2023

Also--just to clarify--scales is still used conditionally if it is available-- to "test" you need to remove {scales} from your R lib

@dylanbeaudette
Copy link
Member

Also--just to clarify--scales is still used conditionally if it is available-- to "test" you need to remove {scales} from your R lib

Ah, ok. I didn't realize that--I thought that this was a replacement. I'll do some side/side testing and report back in the related issue. I've been wanting to remove scales from imports but haven't found the time or motivation to finish that. It works well and is less annoying than the old plyr code.

Thanks for the recent cleanup.

@brownag
Copy link
Member Author

brownag commented Mar 8, 2023

So, scales I believe is still used for the (now deprecated) profile_compare() code.

I believe the new function is a suitable replacement in so far as it works with tests and the color mapping appears to be identical in the cases we test. However I did not really rigorously test it other than trying some of the different data type inputs (numeric, factor/character, ordered factor) I did a bit of side by side and saw no obvious differences, but perhaps there is something I have missed in my replacement code. In theory I think scales could be dropped from Suggests entirely, but I didnt want to do that in this PR.

As a side motivation for this conditional usage of scales is I believe it means I can also drop scales from suggests from soilDB and remove a lot of the boilerplate related to scales for any examples that use scales in both packages

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