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

define RNG seed for all dependencies #413

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

jd-lara
Copy link
Member

@jd-lara jd-lara commented Nov 11, 2024

This PR adds a constant for the random seed to be used by any RNG in the platform

@jd-lara jd-lara self-assigned this Nov 11, 2024
Copy link

codecov bot commented Nov 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.75%. Comparing base (cd78bac) to head (955658a).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #413   +/-   ##
=======================================
  Coverage   77.75%   77.75%           
=======================================
  Files          69       69           
  Lines        5481     5481           
=======================================
  Hits         4262     4262           
  Misses       1219     1219           
Flag Coverage Δ
unittests 77.75% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/common.jl 66.66% <ø> (ø)

@@ -41,6 +41,8 @@ const CONSTANT = Float64
const LIM_TOL = 1e-6
const XY_COORDS = @NamedTuple{x::Float64, y::Float64}

const RNG_SEED = get(ENV, "SIENNA_RNG_SEED", 2017)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you give an example of how setting the environment variable will be used? The value will be set the first time the code is compiled.

@jd-lara
Copy link
Member Author

jd-lara commented Nov 11, 2024

@daniel-thom I am trying to make something like this where we just need to define this once. It will be useful here and in PRASInterface.jl

NREL-Sienna/PowerSimulations.jl@f7d5caf

@daniel-thom
Copy link
Contributor

@daniel-thom I am trying to make something like this where we just need to define this once. It will be useful here and in PRASInterface.jl

NREL-Sienna/PowerSimulations.jl@f7d5caf

I'm still not following

  1. Starting with the same seed will always produce the sequence. Are you saying that you want that?
  2. How do you expect the value to be changed by the environment variable? It will get set at first compilation and then can never be changed.

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