Skip to content

Commit

Permalink
Merge pull request #10054 from gem/312
Browse files Browse the repository at this point in the history
Tried to run the tests with Python 3.12
  • Loading branch information
micheles authored Oct 15, 2024
2 parents 8eee7f0 + 753397d commit 51123ca
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/engine_pr_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-24.04]
python-version: ["3.11"]
python-version: ["3.12"]
env:
GITHUB_HEAD_REF: ${{ github.head_ref }}
FROM_FORK: ${{ github.event.pull_request.head.repo.fork }}
Expand Down
4 changes: 2 additions & 2 deletions openquake/commonlib/readinput.py
Original file line number Diff line number Diff line change
Expand Up @@ -1262,8 +1262,8 @@ def _taxonomy_mapping(filename, taxidx):
if 'conversion' in tmap_df.columns:
# conversion was the old name in the header for engine <= 3.12
tmap_df = tmap_df.rename(columns={'conversion': 'risk_id'})
assert set(tmap_df) == {'country', 'loss_type', 'taxonomy', 'risk_id', 'weight'}

assert set(tmap_df) == {'country', 'loss_type', 'taxonomy', 'risk_id', 'weight'
}, set(tmap_df)
taxos = set()
for (taxo, lt), df in tmap_df.groupby(['taxonomy', 'loss_type']):
taxos.add(taxo)
Expand Down
4 changes: 2 additions & 2 deletions openquake/hazardlib/tests/pmf_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ def test_creation(self):
self.assertEqual(pmf.data, [(0.1, i) for i in range(10)])

def test_wrong_sum(self):
data = [(0.1, i) for i in range(10)]
self.assertRaises(ValueError, PMF, data, 1E-16)
data = [(0.100001, i) for i in range(10)]
self.assertRaises(ValueError, PMF, data, 1E-10)

def test_empty_data(self):
self.assertRaises(ValueError, PMF, [])
Expand Down

0 comments on commit 51123ca

Please sign in to comment.