Skip to content

Commit

Permalink
Merge pull request #76 from AstarVienna/fh/nomoresystemdict
Browse files Browse the repository at this point in the history
Use `astar_utils.NestedMapping` instead of `scopesim.system_dict.SystemDict`
  • Loading branch information
teutoburg committed Feb 6, 2024
2 parents 21335bc + 9582dce commit adf12cf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ dependencies = [
"scopesim>=0.7.0",
"pyckles>=0.2",
"spextra>=0.33",
"astar-utils>=0.2.1",
]

[project.optional-dependencies]
Expand Down
5 changes: 3 additions & 2 deletions scopesim_templates/rc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@
import sys
import yaml

from astar_utils import NestedMapping

# TODO: what's this?
if Path("F:/Work/ScopeSim/").exists():
sys.path.append("F:/Work/ScopeSim/")

import scopesim

Source = scopesim.source.source.Source
SystemDict = scopesim.system_dict.SystemDict
ter_curve_utils = scopesim.effects.ter_curves_utils
im_plane_utils = scopesim.optics.image_plane_utils
scopesim_utils = scopesim.utils
load_example_optical_train = scopesim.load_example_optical_train

PKG_DIR = Path(__file__).parent
with (PKG_DIR / "defaults.yaml").open(encoding="utf-8") as file:
__config__ = SystemDict(yaml.full_load(file))
__config__ = NestedMapping(yaml.full_load(file))
4 changes: 3 additions & 1 deletion scopesim_templates/tests/test_utils/test_rc.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from astar_utils import NestedMapping

from scopesim_templates import rc


Expand All @@ -6,4 +8,4 @@ def test_source_object_is_imported(self):
assert hasattr(rc, "Source")

def test_default_yaml_is_read_in(self):
isinstance(rc.__config__, rc.SystemDict)
isinstance(rc.__config__, NestedMapping)

0 comments on commit adf12cf

Please sign in to comment.