-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #199 from pytti-tools/fix_show_palette
Fix show palette
- Loading branch information
Showing
2 changed files
with
34 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import pytest | ||
|
||
from hydra import initialize, compose | ||
from loguru import logger | ||
from pytti.workhorse import _main as render_frames | ||
from omegaconf import OmegaConf, open_dict | ||
|
||
|
||
CONFIG_BASE_PATH = "config" | ||
CONFIG_DEFAULTS = "default.yaml" | ||
|
||
|
||
def run_cfg(cfg_str): | ||
with initialize(config_path=CONFIG_BASE_PATH): | ||
cfg_base = compose( | ||
config_name=CONFIG_DEFAULTS, | ||
overrides=[f"conf=_empty"], | ||
) | ||
cfg_this = OmegaConf.create(cfg_str) | ||
|
||
with open_dict(cfg_base) as cfg: | ||
cfg = OmegaConf.merge(cfg_base, cfg_this) | ||
render_frames(cfg) | ||
|
||
|
||
def test_show_palette(): | ||
cfg_str = f"""# @package _global_ | ||
scenes: a photograph of an apple | ||
image_model: Limited Palette | ||
show_palette: true | ||
""" | ||
run_cfg(cfg_str) |