Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LCFS - BUG - Other diesel #1553

Closed
airinggov opened this issue Dec 20, 2024 · 11 comments
Closed

LCFS - BUG - Other diesel #1553

airinggov opened this issue Dec 20, 2024 · 11 comments
Assignees
Labels
bug Something isn't working Compliance Reporting Critical Ticket is critical and top priority Tested :) Testing passed

Comments

@airinggov
Copy link
Collaborator

airinggov commented Dec 20, 2024

Describe the Bug
The label 'Other diesel' should be updated to 'Other diesel fuel'. Additionally, it is currently resolving to 'Prescribed carbon intensity' when it should provide the select options for Default carbon intensity and Fuel codes. The volume is being incorrectly added to Line 1 of the summary instead of Line 2, as 'Other diesel fuel' is a renewable fuel.

Expected Behaviour

  • The label should display as 'Other diesel fuel'.
  • 'Determining carbon intensity' should provide the select options for Default carbon intensity and Fuel codes
  • Volumes should be added to Line 2 of the summary under Diesel. (may already be resolved other card)

Actual Behaviour

  • The label shows as 'Other diesel'.
  • 'Determining carbon intensity' incorrectly resolves to 'Prescribed carbon intensity'.
  • Volumes are incorrectly added to Line 1 of the summary.

Implications

  • Incorrect labeling and resolution lead to data misrepresentation.
  • Renewable fuel volumes are inaccurately categorized, potentially affecting reporting and compliance calculations.

Steps To Reproduce
User/Role: BCeID user.

  1. Navigate to the relevant data entry, Fuel supply, Export fuel, Other use, Allocation agreements
  2. Input Fuel type 'Other diesel'.
  3. Observe that:
    • The label reads 'Other diesel'.
    • It resolves to 'Prescribed carbon intensity'.
    • Volumes are added to Line 1 of the summary instead of Line 2.
@airinggov airinggov added bug Something isn't working Compliance Reporting High High priority ticket but not critical at this time Critical Ticket is critical and top priority and removed High High priority ticket but not critical at this time labels Dec 20, 2024
@areyeslo areyeslo self-assigned this Dec 23, 2024
@airinggov
Copy link
Collaborator Author

airinggov commented Jan 3, 2025

@areyeslo Hi Arturo, this critical 2 point card has been in progress for 2 weeks, is it near completion?

@areyeslo
Copy link
Collaborator

areyeslo commented Jan 3, 2025

sorry Al in the last 2 weeks I worked just 3 days, and compleated the other tickets in WIP 1540 and 1509. This ticket is the next. I will let you know when it is ready for your review.

@airinggov
Copy link
Collaborator Author

@areyeslo ok thanks, I guess we should make a point that if taking a critical card it can be completed before vacation or else assigned to another dev

@areyeslo
Copy link
Collaborator

areyeslo commented Jan 4, 2025

We have the following scenario:
fuel export & supply of fuel are using get_fuel_supply_options function which includes the following logic:
For non-fossil derived fuels includes ALL provisions where provision of the act is not Prescribed carbon intensity - section 19 (a) for other diesel option. Then, we are showing provision_of_the_act_id = 2 (Fuel code) and provision_of_the_act_id=3 (Default carbon intensity)

allocation agreement has a different logic using ``get_formatted_fuel_typesfunction which is just querying by fuel type =other diesel` and getting the provision_of_the_act_id value in `fuel_type` table which in dev is provision_of_the_act = 1.

To have allocation_agreement with the same logic, we would need to query provision_of_the_act table instead of querying fuel_type.provision_1_id and fuel_type_provision_2_id. The change I attempted to implement is the following in fuel_code/repo.py (get_formatted_fuel_types):

query = (
            select(
                FuelType,
                ProvisionOfTheAct.provision_of_the_act_id,
                ProvisionOfTheAct.name.label("provision_of_the_act"),
            )
            .outerjoin(FuelType.fuel_instances)
            .outerjoin(FuelInstance.fuel_category)
            .outerjoin(FuelType.fuel_codes)
            .outerjoin(
                ProvisionOfTheAct,
                or_(
                    and_(
                        FuelType.fossil_derived == True,
                        ProvisionOfTheAct.provision_of_the_act_id == 1,
                    ),
                    and_(
                        FuelType.fossil_derived == False,
                        ProvisionOfTheAct.provision_of_the_act_id != 1,
                    ),
                ),
            )

However, still getting the record from fuel_type.provision_1_id

@areyeslo areyeslo assigned areyeslo and unassigned areyeslo Jan 4, 2025
@areyeslo
Copy link
Collaborator

areyeslo commented Jan 4, 2025

Created PR for approval:
#1604

Note: January 6th I am off, I will be back on January 7th.

@airinggov
Copy link
Collaborator Author

airinggov commented Jan 7, 2025

@areyeslo The two select fields (fuel category & end use) aren't being autoset or giving options to select. Also the CI fields aren't being set. This is on the Fuel supply schedule.

There may be a conflict with card #1545 work with Kevin to resolve.

Image

@areyeslo
Copy link
Collaborator

areyeslo commented Jan 7, 2025

@airinggov going to take a look. the implementation for allocation agreement is using a different function which is isolated from the other schedules. Going to take a look at this.

@areyeslo
Copy link
Collaborator

areyeslo commented Jan 7, 2025

On Dev, I am not getting the behaviour mentioned above (selecting fuel type - Other diesel fuel, auto sets Fuel Category and End use as well as CI of fuel).

Fuel Supply schedule - autoselects fuel category, fuel use and CI of fuel:
Image

Image

Allocation Agreement - autoselects fuel category, fuel use and CI of fuel:
Image

Fuel Export is NOT selecting automatically End use:
Image

Checking this last schedule.

@areyeslo
Copy link
Collaborator

areyeslo commented Jan 7, 2025

These are the PR related in the comments, but there is no affectation between them:
https://github.com/bcgov/lcfs/pull/1587/files
https://github.com/bcgov/lcfs/pull/1604/files

@airinggov
Copy link
Collaborator Author

@areyeslo Yes there was a conversation in Teams that I think addressed these issues through a data reset in dev

@airinggov
Copy link
Collaborator Author

@areyeslo looks great now

@airinggov airinggov added Tested :) Testing passed and removed Tested w/ issues Testing did not pass labels Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Compliance Reporting Critical Ticket is critical and top priority Tested :) Testing passed
Projects
None yet
Development

No branches or pull requests

2 participants