Skip to content

Commit

Permalink
Merge pull request #25 from dule1322/CTX-4251
Browse files Browse the repository at this point in the history
CTX-4251: Update "model-queue/custom" to "run" endpoint
  • Loading branch information
igorperic17 authored Jul 11, 2023
2 parents a56f872 + e361f67 commit 9415689
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
22 changes: 9 additions & 13 deletions coretex/coretex/experiment/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ def createQiimeArtifact(self, rootArtifactFolderName: str, qiimeArtifactPath: Pa
# logging.getLogger("coretexpylib").warning(f">> [Coretex] Failed to upload {localFilePath} to {remoteFilePath}")

@classmethod
def startCustomExperiment(
def run(
cls,
projectId: int,
nodeId: Union[int, str],
Expand Down Expand Up @@ -438,7 +438,7 @@ def startCustomExperiment(
]
\b
>>> try:
experiment = Experiment.startCustomExperiment(
experiment = Experiment.run(
projectId = 1023,
nodeId = 23,
name = "Dummy Custom Experiment
Expand All @@ -457,17 +457,13 @@ def startCustomExperiment(
if parameters is None:
parameters = []

response = networkManager.genericJSONRequest(
f"{cls._endpoint()}/custom",
RequestType.post,
parameters={
"sub_project_id": projectId,
"service_id": nodeId,
"name": name,
"description": description,
"parameters": parameters
}
)
response = networkManager.genericJSONRequest("run", RequestType.post, {
"sub_project_id": projectId,
"service_id": nodeId,
"name": name,
"description": description,
"parameters": parameters
})

if response.hasFailed():
raise NetworkRequestError(response, "Failed to create experiment")
Expand Down
2 changes: 1 addition & 1 deletion coretex/project/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def processLocal(args: Optional[List[str]] = None) -> Tuple[int, ProjectCallback

parameters = ExperimentParameter.readExperimentConfig()

experiment: Experiment = Experiment.startCustomExperiment(
experiment: Experiment = Experiment.run(
parser.projectId,
# Dummy Local node ID, hardcoded as it is only a temporary solution,
# backend will add a new ExperimentType (local) which does not require a specific
Expand Down

0 comments on commit 9415689

Please sign in to comment.