Skip to content

Commit

Permalink
Fixing review notes
Browse files Browse the repository at this point in the history
  • Loading branch information
isaac-tfn committed Jan 9, 2024
1 parent cffcf81 commit 16b7162
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/caf/distribute/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def infill_cost_matrix(
min_row = np.min(np.ma.masked_where(cost_matrix <= 0, cost_matrix), axis=1) * diag_factor

np.fill_diagonal(cost_matrix, min_row)
# Needed due to a bug in np.fill_diagonal
cost_matrix[cost_matrix > 1e10] = zeros_infill
cost_matrix[cost_matrix == 0] = zeros_infill
return cost_matrix
Expand Down
2 changes: 1 addition & 1 deletion tests/gravity_model/test_multi_area.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def fixture_cal_furness(data_dir, infilled, furness_jac_conf, trip_ends, mock_di


class TestUtils:
# only one test currently so leaving in this file
# TODO(IS) only one test currently so leaving in this file
def test_infill_costs(self, infilled_from_code, infilled_expected):
"""Test the method to infill a cost matrix (mainly intrazonal costs)"""
assert np.array_equal(np.round(infilled_expected, 3), np.round(infilled_from_code, 3))
Expand Down

0 comments on commit 16b7162

Please sign in to comment.