Skip to content

Commit fdbfb96

Browse files
committed
compatibility with spec v3.0.1
1 parent 1aa1831 commit fdbfb96

6 files changed

Lines changed: 294 additions & 61 deletions

File tree

meorg_client/cli.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -201,16 +201,21 @@ def file_delete(output_id: str, file_id: str):
201201

202202

203203
@click.command("start")
204-
@click.argument("id")
205-
def analysis_start(id: str):
204+
@click.argument("model_output_id")
205+
@click.argument("experiment_id")
206+
def analysis_start(model_output_id: str, experiment_id: str):
206207
"""
207-
Start the analysis for the model output id.
208+
Start the analysis for the model output id, and an associated experiment ID.
208209
209210
Prints the Analysis ID, which can be used in analysis-status.
210211
"""
211212
client = _get_client()
212213

213-
response = _call(client.start_analysis, id=id)
214+
response = _call(
215+
client.start_analysis,
216+
model_output_id=model_output_id,
217+
experiment_id=experiment_id,
218+
)
214219

215220
if client.success():
216221
analysis_id = response.get("data").get("analysisId")
@@ -219,9 +224,8 @@ def analysis_start(id: str):
219224

220225
@click.command("create")
221226
@click.argument("mod_prof_id")
222-
@click.argument("exp_id")
223227
@click.argument("name")
224-
def create_new_model_output(mod_prof_id: str, exp_id: str, name: str):
228+
def create_new_model_output(mod_prof_id: str, name: str):
225229
"""
226230
Create a new model output profile.
227231
@@ -241,9 +245,7 @@ def create_new_model_output(mod_prof_id: str, exp_id: str, name: str):
241245
"""
242246
client = _get_client()
243247

244-
response = _call(
245-
client.model_output_create, mod_prof_id=mod_prof_id, exp_id=exp_id, name=name
246-
)
248+
response = _call(client.model_output_create, mod_prof_id=mod_prof_id, name=name)
247249

248250
if client.success():
249251
model_output_id = response.get("data").get("modeloutput")

meorg_client/client.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,9 @@ def delete_all_files_from_model_output(self, id: str):
433433

434434
return responses
435435

436-
def start_analysis(self, id: str) -> Union[dict, requests.Response]:
436+
def start_analysis(
437+
self, model_output_id: str, experiment_id: str
438+
) -> Union[dict, requests.Response]:
437439
"""Start the analysis chain.
438440
439441
Parameters
@@ -449,11 +451,11 @@ def start_analysis(self, id: str) -> Union[dict, requests.Response]:
449451
return self._make_request(
450452
method=mcc.HTTP_PUT,
451453
endpoint=endpoints.ANALYSIS_START,
452-
url_path_fields=dict(id=id),
454+
url_path_fields=dict(id=model_output_id, expid=experiment_id),
453455
)
454456

455457
def model_output_create(
456-
self, mod_prof_id: str, exp_id: str, name: str
458+
self, mod_prof_id: str, name: str
457459
) -> Union[dict, requests.Response]:
458460
"""
459461
Create a new model output entity
@@ -474,7 +476,7 @@ def model_output_create(
474476
return self._make_request(
475477
method=mcc.HTTP_POST,
476478
endpoint=endpoints.MODEL_OUTPUT_CREATE,
477-
data=dict(experiment=exp_id, model=mod_prof_id, name=name),
479+
data=dict(model=mod_prof_id, name=name),
478480
)
479481

480482
def model_output_query(self, model_id: str) -> Union[dict, requests.Response]:

0 commit comments

Comments
 (0)