* update the id formatter to use staticmethods to not fake the unused self arg, and then use the formatter for the user session endpoints
* missed an id (ty treble)
* clean up duplicate code
* Update WebHostLib/__init__.py
Co-authored-by: Aaron Wagener <mmmcheese158@gmail.com>
* keep the BaseConverter format
* lol, change all the instances
* revert this
---------
Co-authored-by: Aaron Wagener <mmmcheese158@gmail.com>
* Add new deprioritized item flag
* 4 retries
* indent
* .
* style
* I think this is nicer
* Nicer
* remove two lines again that I added unnecessarily
* I think this test makes a bit more sense like this
* Idk how to word this lol
* Add progression_deprioritized_skip_balancing bc why not ig
* More text
* Update Fill.py
* Update Fill.py
* I am the big stupid
* Actually collect the other half of progression items into state when filling without them
* More clarity on the descriptions (hopefully)
* visually separate technical description and use cases
* Actually make the call do what the comments say it does
* replace Clique with V6 in unit tests
* no hard mode in V6
* modify regex in copy_world to allow : str
* oops
* I see now
* work around all typing
* there actually needs to be something
* CounterOption
* bring back the negative exception for ItemDict
* Backwards compatibility
* ruff on witness
* fix in calls
* move the contains
* comment
* comment
* Add option min and max values for CounterOption
* Use min 0 for TrapWeights
* This is safe now
* ruff
* This fits on one line again now
* OptionCounter
* Update Options.py
* Couple more typing things
* Update Options.py
* Make StartInventory work again, also make LocationCounter theoretically work
* Docs
* more forceful wording
* forced line break
* Fix unit test (that wasn't breaking?)
* Add trapweights to witness option presets to 'prove' that the unit test passes
* Make it so you can order stuff
* Update macros.html
* Only consider usable exits when calculating whether or not a region is a dead-end
* Update EntranceLookup unit tests
* Add new dead-end test
* Add additional explanation to the new test
* minor formatting tweak
based on review feedback
---------
Co-authored-by: CodeGorilla <3672561+Ars-Ignis@users.noreply.github.com>
* [Core][GER] Allow and require user-provided target name when splitting 1-way entrances
* Move target naming onto a parameter of disconnect_entrance_for_randomization
* Tests: unroll test_multiworlds.TestTwoPlayerMulti
Also adds a helper function that other tests can use to unroll tests.
* Docs: add more details to docs/tests.md
* Explain parametrization, subtests and link to the new helper
* Mention some performance details and work-arounds
* Mention multithreading / pytest-xdist
* Tests: make param.classvar_matrix accept sets
* CI: add test/param.py to type checking
* Tests: add missing typing to test/param.py
* Tests: fix typo in test/param.py doc comment
Co-authored-by: qwint <qwint.42@gmail.com>
* update docs
* Docs: reword note on performance
---------
Co-authored-by: qwint <qwint.42@gmail.com>
* Add test that stage1 ER will not fail due to speculative sweeping an indirect conditioned dead end
* Skip speculative sweep if it's the last entrance placement
* Better implementation of needs_speculative_sweep
* pep8
* CI: ctest: fix trigger on CMakeLists change
* CI: ctest: update cmake version
this removes a warning
and matches gtest
* CI: ctest: remove explicit build mode for MSVC
gtest switched to dynamic libc (/MD), which is default, so this just works now
* uses itempool count vs unfilled location count instead of counting prog_items values which could have custom counters
* move unfilled location check to before can_reach
* add tests for successful minimal GER call with extra collect override prog_items in the pool to regression test issue fixed in this PR
* Tests: massively improve the memory leak test performance
With the growing number of worlds, GC becomes the bottleneck and slows down the test.
* Tests: fix typing in general/test_memory
* unit test that get all state is called with partial entrances before connect_entrances
* fix the two worlds doing it
* lol
* unused import
* Update test/general/test_entrances.py
Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
* Update test_entrances.py
---------
Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
* Add connect_entrances
* update ER docs
* fix that test, but also ew
* Add a test that asserts the new finalization
* Rewrite test a bit
* rewrite some more
* blank line
* rewrite rewrite rewrite
* rewrite rewrite rewrite
* RE. WRITE.
* oops
* Bruh
* I guess, while we're at it
* giga oops
* It's been a long day
* Switch KH1 over to this design with permission of GICU
* Revert
* Oops
* Bc I like it
* Update locations.py
* Core: some low-hanging fruit on the strict type check
* bump pyright version
* bump pyright version
* bump pyright and remove file that's no longer easy
* Initial implementation of Generic ER
* Move ERType to Entrance.Type, fix typing imports
* updates based on testing (read: flailing)
* Updates from feedback
* Various bug fixes in ERCollectionState
* Use deque instead of queue.Queue
* Allow partial entrances in collection state earlier, doc improvements
* Prevent early loops in region graph, improve reusability of ER stage code
* Typos, grammar, PEP8, and style "fixes"
* use RuntimeError instead of bare Exceptions
* return tuples from connect since it's slightly faster for our purposes
* move the shuffle to the beginning of find_pairing
* do er_state placements within pairing lookups to remove code duplication
* requested adjustments
* Add some temporary performance logging
* Use CollectionState to track available exits and placed regions
* Add a method to automatically disconnect entrances in a coupled-compliant way
Update docs and cleanup todos
* Make find_placeable_exits deterministic by sorting blocked_connections set
* Move EntranceType out of Entrance
* Handle minimal accessibility, autodetect regions, and improvements to disconnect
* Add on_connect callback to react to succeeded entrance placements
* Relax island-prevention constraints after a successful run on minimal accessibility; better error message on failure
* First set of unit tests for generic ER
* Change on_connect to send lists, add unit tests for EntranceLookup
* Fix duplicated location names in tests
* Update tests after merge
* Address review feedback, start docs with diagrams
* Fix rendering of hidden nodes in ER doc
* Move most docstring content into a docs article
* Clarify when randomize_entrances can be called safely
* Address review feedback
* Apply suggestions from code review
Co-authored-by: Aaron Wagener <mmmcheese158@gmail.com>
* Docs on ERPlacementState, add coupled/uncoupled handling to deadend detection
* Documentation clarifications
* Update groups to allow any hashable
* Restrict groups from hashable to int
* Implement speculative sweeping in stage 1, address misc review comments
* Clean unused imports in BaseClasses.py
* Restrictive region/speculative sweep test
* sweep_for_events->advancement
* Remove redundant __str__
Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
* Allow partial entrances in auto indirect condition sweep
* Treat regions needed for logic as non-dead-end regardless of if they have exits, flip order of stage 3 and 4 to ensure there are enough exits for the dead ends
* Typing fixes suggested by mypy
* Remove erroneous newline
Not sure why the merge conflict editor is different and worse than the normal editor. Crazy
* Use modern typing for ER
* Enforce the use of explicit indirect conditions
* Improve doc on required indirect conditions
---------
Co-authored-by: qwint <qwint.42@gmail.com>
Co-authored-by: alwaysintreble <mmmcheese158@gmail.com>
Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
* Core: fix settings API for removal of Python 3.8, 3.9
This is fixing 2 problems:
- The `World` class has the annotation:
`settings: ClassVar[Optional["Group"]]`
so `MyWorld.settings` should not raise an exception like it does for some worlds.
With the `Optional` there, it looks like it should return `None` for the worlds that don't use it. So that's what I changed it to.
- `Group.update` had some code that required `typing.Union` instead of the Python 3.10 `|` for unions.
added unit test for this fix
added change in Zillion that I used to discover this problem and used it to test the test
* fix copy-pasted stuff
* tuple instead of set
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
---------
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
* WebHost: use new safe yaml template filename
this mirrors the change in ArchipelagoMW/#4106 in WebHost
* WebHost: install docs into safe filename and require docs to be named safe
* Test: update doc test for safe name
* WebHost: fix import order to not break ModuleUpdate
* add quotes around strings containing {{ game }}
* do the actually correct thing instead of a hack
thanks berserker66 for pointing out to me that I was doing this the
completly wrong way, so I fixed it up
* Clean up filenames to prevent illegal chars
* Use %s substitution instead of concatenation
* whoops
somehow i removed a space from the comment for the regex, so this adds
it back
* Use pre-existing function in Utils.py
* Test: add test for option yaml with colon
---------
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
* Tests: Add a test that weights file generates different results per player correctly
* Update test/programs/test_generate.py
* Generate.main() return and accessibility options were changed