-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BUG tie PSF section to objects in RNGs (#29)
* BUG tie PSF section to objects in RNGs * Update des_tile.py * REF clean this up more * REF use logger * turn down logger * no logging * REF set rng_num more completely * TST add test for function to set rng num * BUG dumb bug * STY please the flake8
- Loading branch information
Showing
4 changed files
with
113 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import copy | ||
from montara.des_tile import _set_catalog_sampler_rng_num | ||
|
||
|
||
def test_set_catalog_sampler_rng_num(): | ||
cfg = { | ||
"blah": {"foo": [{"type": "catalog_sampler_value"}]}, | ||
"blahblah": {"type": "blah"}, | ||
"bar": {"type": "catalog_sampler_value"}, | ||
} | ||
new_cfg = _set_catalog_sampler_rng_num(copy.deepcopy(cfg), 1) | ||
assert new_cfg == { | ||
"blah": { | ||
"foo": [{"type": "catalog_sampler_value", "rng_num": 1}] | ||
}, | ||
"blahblah": { | ||
"type": "blah" | ||
}, | ||
"bar": { | ||
"type": "catalog_sampler_value", | ||
"rng_num": 1 | ||
} | ||
} | ||
|
||
cfg = { | ||
"blah": {"foo": [{"type": "catalog_sampler_value"}]}, | ||
"blahblah": {"type": "blah"}, | ||
"bar": {"type": "catalog_sampler_value"}, | ||
} | ||
cfg = _set_catalog_sampler_rng_num(cfg, 1) | ||
assert cfg == { | ||
"blah": { | ||
"foo": [{"type": "catalog_sampler_value", "rng_num": 1}] | ||
}, | ||
"blahblah": { | ||
"type": "blah" | ||
}, | ||
"bar": { | ||
"type": "catalog_sampler_value", | ||
"rng_num": 1 | ||
} | ||
} |