Skip to content

Rename function: matlab.palette() → palette_matlab() - #318

Merged
bryanhanson merged 13 commits into
cbeleites:developfrom
sangttruong:fix/aggregate-function
Jun 25, 2021
Merged

bryanhanson merged 13 commits into
cbeleites:developfrom
sangttruong:fix/aggregate-function

Conversation

@sangttruong

Copy link
Copy Markdown
Collaborator

In the development version of hyperSpec, I found 3 functions/objects that define color palettes.
Based on the suggestions, I rename all palette objects (prefix palette_)

Resolve #299

In the development version of hyperSpec, I found 3 functions/objects that define color palettes.
Based on the suggestions, I rename all palette objects (prefix palette_)

Resolve #299

@GegznaV GegznaV left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. If user-visible changes are introduced, they must be properly described in the NEWS.md file. Did you read CONTRIBUTION.md?
  2. Please avoid committing files that are not related to the issue. I mean hyperSpec_0.100.0.zip this time. Please, remove this file and do not include it in the future.
  3. Some tests do not pass on the old release of R (v.3.6). I'm not sure what is the reason.
  4. There are 3 renamed functions, so it would have been better if there were 3 separate commits (you will not fix this now, but adhere to this guideline in the future).
  5. The short commit messages should be self-explanatory, Not, e.g., "Resolve #299", but e.g., "Rename function: matlab.palette() → palette_matlab()" (you will not fix it now, but keep that in mind for the future).

@sangttruong sangttruong changed the title Resolve #299 Rename function: matlab.palette() → palette_matlab() Apr 15, 2021
@GegznaV

GegznaV commented Apr 30, 2021

Copy link
Copy Markdown
Collaborator

I think, most of the parts in this PR are OK.
But I haven't had enough time to review one thing: the new unit tests. I'll do that in the future. If @bryanhanson or @cbeleites have time to do that before me and write some comments, that would be totally fine.

@bryanhanson bryanhanson left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding the unit tests in palette_matlab.R my own opinion is that testing this sort of thing is unnecessary. Either the palettes exist, or they don't. The tests in this PR verify that one entry in the palette is the expected one, but I can't imagine a situation where this would change, so I'm not really sure what we are trying to defend against. If it were up to me I'd simply remove the unit tests for this function.

@GegznaV GegznaV left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is some general feedback on unit tests.

Comment thread hyperSpec/R/palette_matlab.R Resolved
Comment thread hyperSpec/R/palette_matlab.R Resolved
Comment thread hyperSpec/R/palette_matlab.R Outdated

hySpc.testthat::test(palette_alois) <- function() {
context("palette_alois")
test_that("test palette alois", {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whole line should be as a fluent and logical sentence.

Comment thread hyperSpec/R/palette_matlab.R Outdated

hySpc.testthat::test(palette_matlab) <- function() {
context("palette_matlab")
test_that("test palette matlab", {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whole line should be as a fluent and logical sentence

Comment thread hyperSpec/R/palette_matlab.R Resolved
@GegznaV

GegznaV commented May 27, 2021

Copy link
Copy Markdown
Collaborator

@bryanhanson:

Either the palettes exist, or they don't.

Some palettes depand on other functions of "R". And, e.g., in version 4.0 "R" changed some default colors.

@GegznaV GegznaV left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, add a new line at the end of files, where needed.

Comment thread hyperSpec/R/palette_matlab.R Outdated
alois <- palette_alois()
expect_equal(alois[1], "#000000")
expect_equal(alois[2], "#00000C")})
} No newline at end of file

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, leave a blank line at the end of each file. In some circumstances, the absence of a new line may result in unwanted issues.

image

@bryanhanson
bryanhanson merged commit 5ea1fdd into cbeleites:develop Jun 25, 2021
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.

Rename functions (1): palette_

3 participants