Skip to content

Commit

Permalink
Merge branch 'multiburst-costs' of github.com:ASFHyP3/hyp3 into multi…
Browse files Browse the repository at this point in the history
…burst-costs
  • Loading branch information
jtherrmann committed Mar 10, 2025
2 parents 82d0190 + c1e3fe5 commit ef10d25
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/dynamo/dynamo/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,23 +150,25 @@ def _get_cost_parameter_value(job: dict, cost_parameter: str) -> str:
parameter_value = job['job_parameters'][cost_parameter]

if isinstance(parameter_value, str):
return parameter_value
cost_parameter_value = parameter_value

elif isinstance(parameter_value, int):
return str(parameter_value)
cost_parameter_value = str(parameter_value)

elif isinstance(parameter_value, float):
return str(int(parameter_value))
cost_parameter_value = str(int(parameter_value))

elif isinstance(parameter_value, list):
return str(len(parameter_value))
cost_parameter_value = str(len(parameter_value))

else:
raise ValueError(
f'Cost parameter {cost_parameter} for job type {job["job_type"]} has '
'unsupported type {type(parameter_value)}'
f'unsupported type {type(parameter_value)}'
)

return cost_parameter_value


def query_jobs(
user: str,
Expand Down

0 comments on commit ef10d25

Please sign in to comment.