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

remove RNGSettings:base_noise_seed #86

Merged
merged 1 commit into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions bluecellulab/rngsettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,14 @@ def __init__(
self,
mode: Optional[str] = None,
circuit_access: Optional[CircuitAccess] = None,
base_seed: Optional[int] = None,
base_noise_seed: Optional[int] = None):
base_seed: Optional[int] = None):
"""Constructor.

Parameters
----------
mode : rng mode, if not specified mode is taken from circuit_access
circuit: circuit access object, if present seeds are read from simulation
base_seed: base seed for entire sim, overrides config value
base_noise_seed: base seed for the noise stimuli
"""

self._mode = ""
Expand Down Expand Up @@ -77,11 +75,6 @@ def __init__(
self.minis_seed = circuit_access.config.minis_seed if circuit_access else 0
bluecellulab.neuron.h.minisSeed = self.minis_seed

if base_noise_seed is None:
self.base_noise_seed = 0
else:
self.base_noise_seed = base_noise_seed

@property
def mode(self):
return self._mode
Expand All @@ -103,14 +96,12 @@ def mode(self, new_val):
def __repr__(self) -> str:
"""Returns a string representation of the object."""
return "RNGSettings(mode={mode}, base_seed={base_seed}, " \
"base_noise_seed={base_noise_seed}, " \
"synapse_seed={synapse_seed}, " \
"ionchannel_seed={ionchannel_seed}, " \
"stimulus_seed={stimulus_seed}, " \
"minis_seed={minis_seed})".format(
mode=self.mode,
base_seed=self.base_seed,
base_noise_seed=self.base_noise_seed,
synapse_seed=self.synapse_seed,
ionchannel_seed=self.ionchannel_seed,
stimulus_seed=self.stimulus_seed,
Expand Down
9 changes: 1 addition & 8 deletions bluecellulab/ssim.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ def __init__(
dt: float = 0.025,
record_dt: Optional[float] = None,
base_seed: Optional[int] = None,
base_noise_seed: Optional[int] = None,
rng_mode: Optional[str] = None,
print_cellstate: bool = False,
):
Expand All @@ -75,11 +74,6 @@ def __init__(
Has to positive integer.
When this is not set, and no seed is set in the
simulation config, the seed will be 0.
base_noise_seed :
Base seed used for the noise stimuli in the simulation.
Not setting this will result in the default Neurodamus
behavior (i.e. seed=0)
Has to positive integer.
rng_mode : String with rng mode, if not specified mode is taken from
simulation config. Possible values are Compatibility, Random123
and UpdatedMCell.
Expand All @@ -103,8 +97,7 @@ def __init__(
self.rng_settings = bluecellulab.RNGSettings(
rng_mode,
self.circuit_access,
base_seed=base_seed,
base_noise_seed=base_noise_seed)
base_seed=base_seed)

self.cells: CellDict = CellDict()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_rngsettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def test_str_repr_obj():
"""Test the str and repr methods of RNGSettings."""
rng_obj = bluecellulab.RNGSettings(mode="UpdatedMCell")
assert repr(rng_obj) == "RNGSettings(mode=UpdatedMCell, base_seed=0, " \
"base_noise_seed=0, synapse_seed=0, " \
"synapse_seed=0, " \
"ionchannel_seed=0, stimulus_seed=0, " \
"minis_seed=0)"

Expand Down