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

✨ add function to calculate item weights by cheapest possible cost #1003

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

twentylemon
Copy link
Member

Summary

It's not used yet in the solver, I couldn't get it to work as I wanted. It also seems to be a little wrong still, since StitchedIronPlate, for example, should probably be cheaper than the default recipe for super plates. It may be an approx thing, but I haven't looked that deeply into it yet. The alternate weights also ended up producing some wonky solutions in only ways optimizers can; it'd find extremely convoluted solutions that use many different recipes which would end up minimizing the new costs (though, only with non-raw factory inputs, the typical input+maximize still works fine).

I added two solver tests to show the issue that I was trying to resolve here. It is an edge case, at any rate.

Note that the changes to the solver file are only moving the declarations to a new file. alternate_weights is the only real new code (some minor alterations otherwise, but only cleanup [moving auxiliary item weighing, all_items addition in minmax_weights function).

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 13, 2024 17:26
Copy link

codecov bot commented Nov 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.51%. Comparing base (f7a8edd) to head (b0b08e6).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1003      +/-   ##
==========================================
+ Coverage   96.46%   96.51%   +0.04%     
==========================================
  Files          94       95       +1     
  Lines        2206     2237      +31     
  Branches      160      165       +5     
==========================================
+ Hits         2128     2159      +31     
  Misses         67       67              
  Partials       11       11              

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

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.

🚚

@twentylemon twentylemon merged commit a8f8852 into duck-dynasty:main Nov 13, 2024
11 checks passed
@twentylemon twentylemon deleted the item-weights branch November 13, 2024 17:35
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