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

Allow processing multiple projects in desktop tool #219

Merged
merged 13 commits into from
Apr 25, 2024

Conversation

ndepaola
Copy link
Collaborator

@ndepaola ndepaola commented Feb 29, 2024

Description

  • Resolves Feature Request: Orders over 612 and/or multiple xml files at once #65
  • This is an enhanced iteration of the functionality added in Process multiple XML files in batch #103 - I decided to take this in a bit of a different direction to that PR's implementation (though I looked to it for inspiration).
  • Key functionality:
    • The XML file select now allows selecting multiple files rather than one
    • XML files can be arbitrarily large
      • There will probably be a frontend PR which removes the 612 card limit - problem for another day
        • The blocker here is slow performance with massive projects
    • Selected XML files are aggregated and then split back out
      • We identify projects which can be aggregated by their specified stock & finish settings
      • For example, consider a 400 card nonfoil S30 XML and a 300 card nonfoil S30 XML - the tool would aggregate these into a single 700 card nonfoil S30 project
      • The tool will then split these projects back up such that each of them fit with the max project size of 612 cards, in one of two ways:
        • Naively splitting every 612 cards, or
        • Asking the user to type in their desired splits
          • This captures the case where the user happens to know it's cheaper to split up the cards differently to the naive approach
    • The tool will then run in a loop on each aggregated-then-split-back-out project
      • The user specifies whether to continue editing an existing order or create a new one per-aggregated project

Checklist

  • I have installed pre-commit and installed the hooks with pre-commit install before creating any commits.
  • I have updated any related tests for code I modified or added new tests where appropriate.
  • Thorough manual testing
  • I have updated any relevant documentation or created new documentation where appropriate.
    • On the todo list - unfortunately, github wikis are (kind of?) sub-repositories so I can't update the docs in this PR

@ndepaola ndepaola added the enhancement New feature or request label Feb 29, 2024
@ndepaola ndepaola self-assigned this Feb 29, 2024
@ndepaola ndepaola force-pushed the allow-processing-multiple-projects-in-desktop-tool branch from 298dc37 to bbd2f0e Compare March 28, 2024 00:07
ndepaola and others added 13 commits April 2, 2024 20:01
this is a bit more verbose but it's the necessary groundwork
for reusing an autofill driver for multiple card orders
this refactor will simplify our order combination logic
[wip] a quick sketch of order combining. will flesh this out later.
bit late here (11:39pm) and i have work tomorrow

continued sketching of order combining & splitting
parking this again at 11:13pm

continue with order combination
it seems like it's now customary to note i'm writing this at 10:33pm
this involves removing --skipsetup as a CLI flag and reinstating it as
a question the tool asks the user for each order it's processing.
this refactor makes it easier to reason about our data and will help
when we look at merging the slots of multiple cards
...slots of identical cards across combined projects

this refactor allows for an enhancement to image collection combination
- we can now handle the case where an image is present in both
collections by taking the union of their slots.

for example, say you combine two projects which share the same cardback
- after this change, the tool will continue to recognise it as a single
cardback, so it'll choose "same images" and fill the cardback into one
slot; previously, it would have treated the cardbacks of each project
as distinct, then would have chosen "different cardbacks" which is way
slower and much more painful.

bit painful to update all these tests like this to be honest!
but i'm in utter shock that they all passed on the first try :0000
@ndepaola ndepaola force-pushed the allow-processing-multiple-projects-in-desktop-tool branch from 8d76ab6 to 4fdcee0 Compare April 2, 2024 10:01
@ndepaola ndepaola merged commit 2118034 into master Apr 25, 2024
4 checks passed
@ndepaola ndepaola deleted the allow-processing-multiple-projects-in-desktop-tool branch April 25, 2024 04:00
@ndepaola ndepaola mentioned this pull request Apr 25, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

Successfully merging this pull request may close these issues.

Feature Request: Orders over 612 and/or multiple xml files at once
1 participant