Skip to content

Commit

Permalink
Adjusted tests to work with the dictionary changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrhosk committed Aug 1, 2023
1 parent 4d79a1c commit 19ccc44
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1,161 deletions.
1,156 changes: 20 additions & 1,136 deletions stakeholder_test/alma_stakeholder_test.ipynb

Large diffs are not rendered by default.

11 changes: 2 additions & 9 deletions stakeholder_test/vla_stakeholder_test.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,10 @@
" \n",
" import numpy as np\n",
"\n",
" from astrohack._utils._tools import _jsonify\n",
"\n",
" ref_holog_obj = {}\n",
" ref_holog_obj = copy.deepcopy(holog_obs_dict)\n",
"\n",
" _jsonify(ref_holog_obj)\n",
"\n",
" with open(\".holog_obs_dict.json\") as json_file:\n",
" holog_obj = json.load(json_file)\n",
" \n",
" assert holog_obj == ref_holog_obj, \"Error: holog_obs_descrition dictionary has changes unexpectedly.\"\n",
" assert json.loads(holog_obj) == holog_obs_dict, \"Error: holog_obs_descrition dictionary has changes unexpectedly.\"\n",
" \n",
"def test_holog_diagnostics(json_data, tolerance=1e-7):\n",
" import json\n",
Expand Down Expand Up @@ -488,7 +481,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.13"
"version": "3.8.17"
}
},
"nbformat": 4,
Expand Down
9 changes: 1 addition & 8 deletions tests/stakeholder/test_stakeholder_alma.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

from astrohack.gdown_utils import gdown_data

from astrohack._utils._tools import _jsonify

from astrohack.extract_pointing import extract_pointing
from astrohack.extract_holog import extract_holog
from astrohack.holog import holog
Expand Down Expand Up @@ -103,15 +101,10 @@ def verify_center_pixels(file, antenna, ddi, reference_center_pixels, tolerance=

def verify_holog_obs_dictionary(holog_obs_dict):

ref_holog_obj = {}
ref_holog_obj = copy.deepcopy(holog_obs_dict)

_jsonify(ref_holog_obj)

with open(".holog_obs_dict.json") as json_file:
holog_obj = json.load(json_file)

return holog_obj == ref_holog_obj
return json.loads(holog_obj) == holog_obs_dict

def verify_holog_diagnostics(json_data, truth_json, tolerance=1e-7):

Expand Down
9 changes: 1 addition & 8 deletions tests/stakeholder/test_stakeholder_vla.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

from astrohack.gdown_utils import gdown_data

from astrohack._utils._tools import _jsonify

from astrohack.extract_pointing import extract_pointing
from astrohack.extract_holog import extract_holog
from astrohack.holog import holog
Expand Down Expand Up @@ -118,15 +116,10 @@ def verify_center_pixels(file, antenna, ddi, reference_center_pixels, tolerance=

def verify_holog_obs_dictionary(holog_obs_dict):

ref_holog_obj = {}
ref_holog_obj = copy.deepcopy(holog_obs_dict)

_jsonify(ref_holog_obj)

with open(".holog_obs_dict.json") as json_file:
holog_obj = json.load(json_file)

return holog_obj == ref_holog_obj
return json.loads(holog_obj) == holog_obs_dict

def verify_holog_diagnostics(json_data, truth_json, tolerance=1e-7):

Expand Down

0 comments on commit 19ccc44

Please sign in to comment.