bcgov / bcgov/wps

ASA: Reduce repetitive calls to get_all_sfms_fuel_types

Open
#4,626 0 comments 0 reactions 0 assignees View on GitHub
Task
Dominant language
Python
Stars
65
Forks
11
Avg merge
21h 25m
Merged PRs (30d)
70

Description

**Describe the task**
We currently make a call to `get_all_sfms_fuel_types()` from `store_advisory_fuel_stats()` which in turn is called within a `for` loop. This is unnecessary and we should just be making a single call to `get_all_sfms_fuel_types()` and pass along the result.

**Acceptance Criteria**
- [ ] `get_all_sfms_fuel_types()` is not called in a `for` loop

**Additional context**
- Add any other context about the task here.
- Or here

Contributor guide

Open the contributing guide

Research direction

Locate store_advisory_fuel_stats() and get_all_sfms_fuel_types() in the Python codebase, then trace the loop where the call currently occurs. Confirm the fuel-type result can be obtained once and passed into the looped work. Done means get_all_sfms_fuel_types() is no longer called from inside a for loop and the relevant tests still pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.