Skip to content

Commit

Permalink
Revert "Revert "Pointing to the legacy endpoint for model configs for…
Browse files Browse the repository at this point in the history
… now. (#…" (#91)

This reverts commit 8def5f6.
  • Loading branch information
mwdchang authored Jun 11, 2024
1 parent 8def5f6 commit c0cbe7d
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 11 deletions.
2 changes: 1 addition & 1 deletion service/utils/tds.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
TDS_PASSWORD = settings.TDS_PASSWORD
TDS_SIMULATIONS = "/simulations"
TDS_DATASETS = "/datasets"
TDS_CONFIGURATIONS = "/model-configurations"
TDS_CONFIGURATIONS = "/model-configurations-legacy"


def tds_session():
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_calibrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def test_calibrate_example(
requests_mock.put(
f"{TDS_URL}/simulations/{simulation_id}", json={"status": "success"}
)
requests_mock.get(f"{TDS_URL}/model-configurations/{config_id}", json=model)
requests_mock.get(f"{TDS_URL}/model-configurations-legacy/{config_id}", json=model)

worker.work(burst=True)

Expand Down
4 changes: 3 additions & 1 deletion tests/integration/test_ensemble_calibrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ def test_ensemble_calibrate_example(
]
for config_id in config_ids:
model = json.loads(example_context["fetch"](config_id + ".json"))
requests_mock.get(f"{TDS_URL}/model-configurations/{config_id}", json=model)
requests_mock.get(
f"{TDS_URL}/model-configurations-legacy/{config_id}", json=model
)

dataset_id = example_context["request"]["dataset"]["id"]
filename = example_context["request"]["dataset"]["filename"]
Expand Down
4 changes: 3 additions & 1 deletion tests/integration/test_ensemble_simulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ def test_ensemble_simulate_example(
]
for config_id in config_ids:
model = json.loads(example_context["fetch"](config_id + ".json"))
requests_mock.get(f"{TDS_URL}/model-configurations/{config_id}", json=model)
requests_mock.get(
f"{TDS_URL}/model-configurations-legacy/{config_id}", json=model
)

requests_mock.post(f"{TDS_URL}/simulations", json={"id": str(job_id)})

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def test_optimize_example(
requests_mock.put(
f"{TDS_URL}/simulations/{simulation_id}", json={"status": "success"}
)
requests_mock.get(f"{TDS_URL}/model-configurations/{config_id}", json=model)
requests_mock.get(f"{TDS_URL}/model-configurations-legacy/{config_id}", json=model)

worker.work(burst=True)

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_simulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_simulate_example(
requests_mock.put(
f"{TDS_URL}/simulations/{simulation_id}", json={"status": "success"}
)
requests_mock.get(f"{TDS_URL}/model-configurations/{config_id}", json=model)
requests_mock.get(f"{TDS_URL}/model-configurations-legacy/{config_id}", json=model)

worker.work(burst=True)

Expand Down
20 changes: 15 additions & 5 deletions tests/test_conversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ def test_example_conversion(self, example_context, requests_mock):

config_id = example_context["request"]["model_config_id"]
model = json.loads(example_context["fetch"](config_id + ".json"))
requests_mock.get(f"{TDS_URL}/model-configurations/{config_id}", json=model)
requests_mock.get(
f"{TDS_URL}/model-configurations-legacy/{config_id}", json=model
)

### Act and Assert

Expand All @@ -60,7 +62,9 @@ def test_example_conversion(self, example_context, requests_mock):

config_id = example_context["request"]["model_config_id"]
model = json.loads(example_context["fetch"](config_id + ".json"))
requests_mock.get(f"{TDS_URL}/model-configurations/{config_id}", json=model)
requests_mock.get(
f"{TDS_URL}/model-configurations-legacy/{config_id}", json=model
)

dataset_id = example_context["request"]["dataset"]["id"]
filename = example_context["request"]["dataset"]["filename"]
Expand Down Expand Up @@ -89,7 +93,9 @@ def test_example_conversion(self, example_context, requests_mock):
]
for config_id in config_ids:
model = json.loads(example_context["fetch"](config_id + ".json"))
requests_mock.get(f"{TDS_URL}/model-configurations/{config_id}", json=model)
requests_mock.get(
f"{TDS_URL}/model-configurations-legacy/{config_id}", json=model
)

### Act and Assert

Expand All @@ -110,7 +116,9 @@ def test_example_conversion(self, example_context, requests_mock):
]
for config_id in config_ids:
model = json.loads(example_context["fetch"](config_id + ".json"))
requests_mock.get(f"{TDS_URL}/model-configurations/{config_id}", json=model)
requests_mock.get(
f"{TDS_URL}/model-configurations-legacy/{config_id}", json=model
)

dataset_id = example_context["request"]["dataset"]["id"]
filename = example_context["request"]["dataset"]["filename"]
Expand All @@ -137,7 +145,9 @@ def test_example_conversion(self, example_context, requests_mock):

config_id = example_context["request"]["model_config_id"]
model = json.loads(example_context["fetch"](config_id + ".json"))
requests_mock.get(f"{TDS_URL}/model-configurations/{config_id}", json=model)
requests_mock.get(
f"{TDS_URL}/model-configurations-legacy/{config_id}", json=model
)

### Act and Assert

Expand Down

0 comments on commit c0cbe7d

Please sign in to comment.