Skip to content

Commit

Permalink
Add CLI arguments for yaml-yugi-ko proposal
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinlul committed Aug 9, 2023
1 parent 7e4ba4a commit 347c609
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ updates:
schedule:
interval: weekly
- package-ecosystem: pip
directory: /
directory: /src
schedule:
interval: weekly
13 changes: 10 additions & 3 deletions .github/workflows/merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ jobs:
with:
repository: DawnbrandBots/yaml-yugipedia
path: yaml-yugipedia
- uses: actions/checkout@v3
with:
repository: DawnbrandBots/yaml-yugi-ko
sparse-checkout: |
/*.csv
/overrides.tsv
- uses: actions/checkout@v3
with:
repository: DawnbrandBots/yaml-yugi-zh
Expand All @@ -38,7 +44,6 @@ jobs:
- name: Download yaml-yugi-ko exports
run: |
cd ..
curl -fsSLO https://github.com/DawnbrandBots/yaml-yugi-ko/raw/master/overrides.tsv
curl -fsSLO https://dawnbrandbots.github.io/yaml-yugi-ko/ocg.csv
- run: pip install -r src/requirements.txt
- name: Transform (series)
Expand All @@ -54,8 +59,10 @@ jobs:
--assignments ../../src/assignments/assignments.yaml \
--tcg ../../data/limit-regulation/tcg/current.vector.json \
--ocg ../../data/limit-regulation/ocg/current.vector.json \
--ko ../../../overrides.tsv \
--ko-csv ../../../ocg.csv \
--ko ../../../yaml-yugi-ko/overrides.tsv \
--ko-official ../../../ocg.csv \
--ko-override ../../../yaml-yugi-ko/ocg-override.csv \
--ko-prerelease ../../../yaml-yugi-ko/ocg-prerelease.csv \
--aggregate ../../../aggregate/cards.json
- name: Transform (Rush Duel)
working-directory: yaml-yugi/data/rush
Expand Down
8 changes: 5 additions & 3 deletions src/main_ocgtcg.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
parser.add_argument("--tcg", help="TCG Forbidden & Limited List, Konami ID vector JSON")
parser.add_argument("--ocg", help="OCG Forbidden & Limited List, English name vector JSON")
parser.add_argument("--ko", help="yaml-yugi-ko overrides.tsv")
parser.add_argument("--ko-csv", help="yaml-yugi-ko official database CSV")
parser.add_argument("--ko-official", help="yaml-yugi-ko official database CSV")
parser.add_argument("--ko-override", help="yaml-yugi-ko ocg-override.csv")
parser.add_argument("--ko-prerelease", help="yaml-yugi-ko ocg-prerelease.csv")
parser.add_argument("--generate-schema", action="store_true", help="output generated JSON schema file")
parser.add_argument("--processes", type=int, default=0, help="number of worker processes, default ncpu")
parser.add_argument("--aggregate", help="output aggregate JSON file")
Expand Down Expand Up @@ -48,7 +50,7 @@ def main() -> None:
]

if processes == 1:
cards = job(args.wikitext_directory, files, args.zh_CN, args.assignments, tcg, ocg, args.ko, args.ko_csv, args.aggregate is not None)
cards = job(args.wikitext_directory, files, args.zh_CN, args.assignments, tcg, ocg, args.ko, args.ko_official, args.aggregate is not None)
else:
size = math.ceil(len(files) / processes)
partitions = [files[i:i+size] for i in range(0, len(files), size)]
Expand All @@ -58,7 +60,7 @@ def main() -> None:
with Pool(processes) as pool:
jobs = [
pool.apply_async(job, (args.wikitext_directory, partition,
args.zh_CN, args.assignments, tcg, ocg, args.ko, args.ko_csv, args.aggregate is not None))
args.zh_CN, args.assignments, tcg, ocg, args.ko, args.ko_official, args.aggregate is not None))
for partition in partitions
]
for result in jobs:
Expand Down

0 comments on commit 347c609

Please sign in to comment.