Skip to content

set random seed for sunrise/sunset estimation#221

Merged
bmeyers merged 5 commits into
mainfrom
sunrise-sunset-fix
Feb 14, 2026
Merged

set random seed for sunrise/sunset estimation#221
bmeyers merged 5 commits into
mainfrom
sunrise-sunset-fix

Conversation

@bmeyers

@bmeyers bmeyers commented Feb 13, 2026

Copy link
Copy Markdown
Collaborator

Closes #220 and #222

This PR addresses randomness in the sunrise/sunset estimation subroutine. This is a very easy fix. We now expose the random seed argument for the subroutine to the run_pipeline method and set a default value of 42. This causes the same estimate to be generated every time for a given data set (and numpy/cvxpy version). If the user wants the previous random behavior for some reason, this argument can be set to None at runtime.

Also fixes a minor bug in the Bundt Cake plotting function.

Checklist for PR authors (skip items if you don't have permissions or they are not applicable)

  • Updated or added relevant tests
  • Updated relevant documentation
  • Added relevant label(s)
  • All comments are resolved

@bmeyers

bmeyers commented Feb 13, 2026

Copy link
Copy Markdown
Collaborator Author

Tests pass, but linting fails because of bare except clauses in the webinar demo notebook. I'll just take the opportunity to fix those now...

@bmeyers

bmeyers commented Feb 13, 2026

Copy link
Copy Markdown
Collaborator Author

all tests passing and all lint checks successful! 🎉

@cdeline ready review if you don't mind

@cdeline cdeline 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.

Mostly linting changes and setting up a random number seed. Tests are passing, LGTM.

@bmeyers bmeyers merged commit eebad88 into main Feb 14, 2026
7 checks passed
@bmeyers bmeyers deleted the sunrise-sunset-fix branch February 14, 2026 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ENH: Remove randomness from sunrise-sunset estimation

2 participants