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

Fix & improve .window_size validation #535

Merged
merged 7 commits into from
Oct 2, 2024

Conversation

brookslogan
Copy link
Contributor

@brookslogan brookslogan commented Oct 1, 2024

Checklist

Please:

  • Make sure this PR is against "dev", not "main" (unless this is a release
    PR).
  • [-] Request a review from one of the current main reviewers:
    brookslogan, nmdefries.
  • Makes sure to bump the version number in DESCRIPTION. Always increment
    the patch version number (the third number), unless you are making a
    release PR from dev to main, in which case increment the minor version
    number (the second number).
  • Describe changes made in NEWS.md, making sure breaking changes
    (backwards-incompatible changes to the documented interface) are noted.
    Collect the changes under the next release number (e.g. if you are on
    1.7.2, then write your changes under the 1.8 heading).
    • (going to merge others first & figure out right number)
  • See DEVELOPMENT.md for more information on the development
    process.

Change explanations for reviewer

  • Fixes where time_type = "day" would allow any type of difftime.
  • Complete docs and match code&messages wrt .window_size validation
    • Mention what's acceptable for yearmonth time_type
    • Mention Inf in validation errors as acceptable iff it's actually acceptable.
    • Reject any other strange "int" classes that pass test_int. (It rejects Date
      and POSIXt, but perhaps there are others.)
    • Refactor to use helper function test_sensible_int instead of test_int (as
      latter accepts difftimes and makes logic look confusing).-

Magic GitHub syntax to mark associated Issue(s) as resolved when this is merged into the default branch

  • Resolves #{issue number}

* Mention what's acceptable for yearmonth time_type
* Mention Inf in validation errors as acceptable iff it's actually acceptable.
* Reject any other strange "int" classes that pass test_int. (It rejects Date
  and POSIXt, but perhaps there are others.)
* Refactor to use helper function test_sensible_int instead of test_int (as
  latter accepts difftimes and makes logic look confusing).
Copy link
Contributor

@dshemetov dshemetov left a comment

Choose a reason for hiding this comment

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

Ah, I'm seeing a bunch of minor improvements to the slide args I didn't move over to epi_slide_opt, I can add a commit in a little. Thanks for noticing!

@brookslogan
Copy link
Contributor Author

brookslogan commented Oct 2, 2024

Will you be removing .window_size = 1 default as part of the epi_slide_opt sync? I was originally setting out to do that and got distracted, oops. [Wait, no, I removed the .window_size = 1 default but didn't test that it's actually complaining if given NULL... I didn't mean to commit that yet or in this PR...]

  • todo: actually check

@dshemetov
Copy link
Contributor

Yea I didn't port the validation from epi_slide over epi_slide_opt, but I'll do that now.

Copy link
Contributor

@dshemetov dshemetov left a comment

Choose a reason for hiding this comment

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

Ok looks better now. Should be good to go.

@brookslogan brookslogan merged commit 6237036 into dev Oct 2, 2024
5 checks passed
@brookslogan brookslogan deleted the lcb/slide-window-validation-edit branch October 2, 2024 20:45
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