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

Implement MST class #3

Merged
merged 50 commits into from
Dec 4, 2023
Merged
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
6386946
Add basic gitignore
daffidwilde Nov 14, 2023
7133deb
Add API dependency
daffidwilde Nov 14, 2023
c8aafe0
Write instantiation test for MST
daffidwilde Nov 14, 2023
37e4abf
Implement instantiation of MST class
daffidwilde Nov 14, 2023
325e1e3
Separate instantiation tests
daffidwilde Nov 14, 2023
58f9717
Write base test for domain feature getter
daffidwilde Nov 14, 2023
83086bf
Factor test strategies out into their own module.
daffidwilde Nov 14, 2023
e71b47e
Factor out mocked MST creation
daffidwilde Nov 14, 2023
bb4a2df
Add metadata id check to domain getter test
daffidwilde Nov 14, 2023
14387f0
Write CI workflow
daffidwilde Nov 14, 2023
61cca25
Implement domain feature getter in MST
daffidwilde Nov 14, 2023
7d3a6ae
Update black and reformat code base
daffidwilde Nov 14, 2023
b840fd0
Write overall domain getter test
daffidwilde Nov 14, 2023
85f006d
Implement basic domain getter
daffidwilde Nov 14, 2023
315393c
Write tests for marginal getter
daffidwilde Nov 14, 2023
81f54bc
Implement marginal getter
daffidwilde Nov 14, 2023
81d8cab
Write tests for measurement and failed marginal
daffidwilde Nov 15, 2023
8eeb979
Write measure method
daffidwilde Nov 15, 2023
8fc60fd
Write tests for model fitter (rm measure deadline)
daffidwilde Nov 15, 2023
1e95c24
Implement model fitter
daffidwilde Nov 15, 2023
c444138
Write pair importance calculator test
daffidwilde Nov 15, 2023
ce6e283
Implement calculator of pair importance
daffidwilde Nov 15, 2023
49bc5e9
Write test for failed call in importance checker
daffidwilde Nov 15, 2023
220dee2
Write test for calculating importances
daffidwilde Nov 15, 2023
5e56172
Implement importance calculator; idx task execut'n
daffidwilde Nov 15, 2023
28a6542
Write test finding MST
daffidwilde Nov 15, 2023
26aff3f
Implement method to find MST
daffidwilde Nov 15, 2023
7e1948a
Write tests for selection method
daffidwilde Nov 15, 2023
3b6f469
Implement selection method
daffidwilde Nov 15, 2023
732dae0
Format code base
daffidwilde Nov 15, 2023
7f92d1c
Separate out tests
daffidwilde Nov 15, 2023
05fc466
Format tests
daffidwilde Nov 15, 2023
8694b4b
Write test for column synthesiser
daffidwilde Nov 16, 2023
85307be
Implement column synthesiser
daffidwilde Nov 16, 2023
d728322
Write tests for dependent column synthesiser
daffidwilde Nov 16, 2023
5e048f1
Implement column synthesisers.
daffidwilde Nov 16, 2023
7813d53
Fix group/marginal strategies
daffidwilde Nov 16, 2023
3c432db
Fix dependent column test and strategy (for real)
daffidwilde Nov 16, 2023
051dc7f
Improve dependent column test
daffidwilde Nov 17, 2023
e09338b
Write test for setting up generation
daffidwilde Nov 23, 2023
5573af3
Dump commit. Moving offline.
daffidwilde Nov 23, 2023
7ed1672
Write test for synthesising first column
daffidwilde Nov 24, 2023
963e640
Write test for finding prerequisite columns
daffidwilde Nov 24, 2023
1a2681e
Test and implement generation method
daffidwilde Nov 27, 2023
e537472
Write test for independent columns in generate
daffidwilde Nov 27, 2023
bf341dc
Skip patched delayed tests for 3.8
daffidwilde Nov 27, 2023
fc341af
Fix skipif expressions to skip 3.8 and below
daffidwilde Nov 28, 2023
baf01f7
Separate CI workflow to check coverage on 3.11+
daffidwilde Nov 28, 2023
034fdca
Separate python version components in CI workflow
daffidwilde Nov 28, 2023
02496f6
Force synchronous (serial) computation in tests
daffidwilde Nov 28, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Write test for failed call in importance checker
daffidwilde committed Nov 15, 2023
commit 49bc5e97e22720265a7740d69b0cc23ae1507da9
19 changes: 19 additions & 0 deletions tests/test_mst.py
Original file line number Diff line number Diff line change
@@ -273,3 +273,22 @@ def test_calculate_importance_of_pair(params):
interim.project.assert_called_once_with(clique)
interim.project.return_value.datavector.assert_called_once_with()
get_marginal.assert_called_once_with(clique)


@given(st_single_marginals(kind="pair"))
def test_calculate_importance_of_pair_failed_call(params):
"""Test that a failed call doesn't stop importance processing."""

population_type, area_type, dimensions, clique, _ = params
mst = mocked_mst(population_type, area_type, dimensions)

interim = mock.MagicMock()
with mock.patch("centhesus.mst.MST.get_marginal") as get_marginal:
get_marginal.return_value = None
weight = mst._calculate_importance_of_pair(interim, clique)

assert weight is None

interim.project.assert_not_called()
interim.project.return_value.datavector.assert_not_called()
get_marginal.assert_called_once_with(clique)