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

🐛 fix double counting of raw resources in factory summary #1007

Merged
merged 2 commits into from
Nov 20, 2024

Conversation

twentylemon
Copy link
Member

Summary

Currently the factory output "double counts" raw resources when they are also produced by non-raw-resource-recipes, most notably water, but also with conversion recipes since they produce raw resources.

Tested with a factory producing 10 aluminium ingots using All recipe bank. Solution includes,

Bauxite#Copper
0.0833 Converter
0.8333 ReanimatedSam + 15.0 CopperOre -> 10.0 Bauxite
CopperOre
0.25 Miner
-> 15.0 CopperOre
CrudeOil
0.0083 OilExtractor
-> 1.0 CrudeOil
ElectrodeAluminumScrap
0.0667 Refinery
12.0 AluminaSolution + 4.0 PetroleumCoke -> 20.0 AluminumScrap + 7.0 Water
Sam
0.0556 Miner
-> 3.3333 Sam
Water
0.025 WaterExtractor
-> 3.0 Water

old, note only 3 water is actually produced, and bauxite is created by combining copper+sam

10.0 Bauxite + 15.0 CopperOre + 1.0 CrudeOil + 3.3333 Sam + 10.0 Water -> 10.0 AluminumIngot + 0.6667 PolymerResin

new:

15.0 CopperOre + 1.0 CrudeOil + 3.3333 Sam + 3.0 Water -> 10.0 AluminumIngot + 0.6667 PolymerResin

There's no tests for things in pretty, just manual testing.

Checklist
  • this is a source code change
    • run format in the repository root
    • run pytest in the repository root
    • link to issue being fixed using a fixes keyword, if such an issue exists
    • update the wiki documentation if necessary
  • or, this is not a source code change

@twentylemon twentylemon enabled auto-merge (squash) November 20, 2024 16:24
Copy link

codecov bot commented Nov 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.53%. Comparing base (b6e4d4c) to head (14315d3).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1007   +/-   ##
=======================================
  Coverage   96.53%   96.53%           
=======================================
  Files          95       95           
  Lines        2251     2251           
  Branches      168      168           
=======================================
  Hits         2173     2173           
  Misses         67       67           
  Partials       11       11           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

Copy link
Collaborator

@jameshughes89 jameshughes89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. How did you do to discover this?

@twentylemon twentylemon merged commit 3aee256 into duck-dynasty:main Nov 20, 2024
10 checks passed
@twentylemon twentylemon deleted the raw-summary branch November 20, 2024 16:41
@twentylemon
Copy link
Member Author

Good catch. How did you do to discover this?

Water is usually the last recipe in the factory. Just noticed at some point that it didn't match the summary for aluminium.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants