File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
cads_processing_api_service Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,8 @@ def estimate_cost(
65
65
request .get ("inputs" , {}), adaptor_properties , request_origin
66
66
)
67
67
cost = costing .compute_highest_cost_limit_ratio (costing_info )
68
+ if costing_info .cost_bar_steps :
69
+ cost .cost_bar_steps = costing_info .cost_bar_steps
68
70
return cost
69
71
70
72
@@ -128,5 +130,8 @@ def compute_costing(
128
130
)
129
131
costing_config : dict [str , Any ] = adaptor_properties ["config" ].get ("costing" , {})
130
132
limits : dict [str , Any ] = costing_config .get ("max_costs" , {})
131
- costing_info = models .CostingInfo (costs = costs , limits = limits )
133
+ cost_bar_steps = costing_config .get ("cost_bar_steps" , None )
134
+ costing_info = models .CostingInfo (
135
+ costs = costs , limits = limits , cost_bar_steps = cost_bar_steps
136
+ )
132
137
return costing_info
Original file line number Diff line number Diff line change @@ -70,12 +70,14 @@ class Exception(ogc_api_processes_fastapi.models.Exception):
70
70
class CostingInfo (pydantic .BaseModel ):
71
71
costs : dict [str , float ] = {}
72
72
limits : dict [str , float ] = {}
73
+ cost_bar_steps : list [int ] | None = None
73
74
74
75
75
76
class RequestCost (pydantic .BaseModel ):
76
77
id : str | None = None
77
78
cost : float = 0.0
78
79
limit : float = 1.0
80
+ cost_bar_steps : list [int ] | None = None
79
81
80
82
81
83
class Execute (ogc_api_processes_fastapi .models .Execute ):
You can’t perform that action at this time.
0 commit comments