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

Make player cleaning internal #115

Merged
merged 9 commits into from
Jul 14, 2020
Merged

Make player cleaning internal #115

merged 9 commits into from
Jul 14, 2020

Conversation

daffidwilde
Copy link
Owner

Following the point raised in #112 about a more organic interface, this PR moves the cleaning of players and their preferences into the scope of matching.

This will be achieved by refactoring the _check_input solver methods to give out warnings rather than errors. In addition, the BaseGame instance will change its Player instances, storing the original information as needed.

* Add `_remove_player` method to `BaseGame`.

Allow for the removal of a player from a party, and make every player in
another party forget them.

* Write tests for HR solver.

* Implement player cleaning at instantiation.

* Format codebase.

* Fix typo in HR source.

* Unify hospital-resident selection in tests.

* Fix unification to go the other way.

The former `.forget()` call was needed. This fixes that and adds one
into the `reciprocates_all_prefs` test.
* Write tests for SA solver.

* Allow for no `other_party` in `_remove_player`.

* Implement and test remaining SA behaviours.

* Remove default `other_party` from `_remove_player`

This behaviour is now within `StudentAllocation._remove_player`.

* Force warnings every time by default.

* Catch weird cases in `from_dictionaries` SA test.

* Format codebase.

* Add trailing comma flag to isort call in CI.
* Move to `exceptions` over `warning`

* Update relevant tests and source code in HR/SA.

* Add a `MatchingError` exception for post-checks.

* Format codebase with isort and black.

* Generalise post-solve checks (#119)

* Generalise for SA.

* Give attributes to MatchingError class.

* Update validity checks for SA.

* Move general validity checks under HR.

* Have SA inherit from HR.

* Clear up rebase for HR.

Messed up a rebase. This fixes that.

* Fix remaining issues from rebase in SA.

* Opt for "issue" over "error" in checks.

* Generalise for SM.

* Generalise for SR.

* Move Game check functions to Player classes.

* Add in extra unit tests for hospitals and players.

* Implement new player methods in game checks.

* Format codebase with isort and black.
* Add clean parameter to HR tests.

* Modularise checks out to BaseGame; add clean to HR

* Format codebase with isort and black.

* Catch failing test for Hospital class.

* Add unit test for hospital oversubbed check.

* Implement clean parameter for SA.

* Format codebase with isort and black.

* Make clean parameter optional in SA dict creation.

* Catch stray hypothesis clean params.

* Add unit test for unique preferences in game.

* Add integration tests for HR validity checks.

* Add extra tests for SA player removal coverage.

* Make minor grammatical tweaks.

* Make more rigorous the input checking processes.

* Format codebase with isort and black.

* Format codebase with isort, black, flake8.

* Format tests.

* Final linting from flake8.
@daffidwilde daffidwilde merged commit 2796339 into main Jul 14, 2020
@daffidwilde daffidwilde deleted the make-cleaning-internal branch July 14, 2020 09:26
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.

1 participant