Skip to content

Commit 3e1e215

Browse files
authored
Merge branch 'hyperion-rt:main' into master
2 parents 1d3f1c4 + 7cae6d0 commit 3e1e215

File tree

20 files changed

+170
-285
lines changed

20 files changed

+170
-285
lines changed

.circleci/config.yml

Lines changed: 0 additions & 106 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Continuous Integration
2+
3+
on:
4+
push:
5+
branches:
6+
- '*'
7+
tags:
8+
- '*'
9+
pull_request:
10+
11+
jobs:
12+
tests:
13+
name: ${{ matrix.name }}
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
include:
19+
- name: Python 3.6
20+
os: ubuntu-20.04
21+
python: '3.6'
22+
- name: Python 3.7
23+
os: ubuntu-20.04
24+
python: '3.7'
25+
- name: Python 3.8
26+
os: ubuntu-20.04
27+
python: '3.8'
28+
- name: Python 3.9
29+
os: ubuntu-20.04
30+
python: '3.9'
31+
- name: Python 3.10
32+
os: ubuntu-20.04
33+
python: '3.10'
34+
steps:
35+
- name: Checkout code
36+
uses: actions/checkout@v2
37+
with:
38+
submodules: 'true'
39+
fetch-depth: 0
40+
- name: Set up Python
41+
uses: actions/setup-python@v2
42+
with:
43+
python-version: ${{ matrix.python }}
44+
- name: Install HDF5 and MPI
45+
if: startsWith(matrix.os, 'ubuntu')
46+
run: sudo apt-get install libhdf5-serial-dev libmpich-dev
47+
- name: Install tox
48+
run: pip install tox
49+
- name: Run tests
50+
run: tox -e test-bitlevel

.travis.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
About
22
-----
33

4-
[![Build Status](https://travis-ci.org/hyperion-rt/hyperion.svg)](https://travis-ci.org/hyperion-rt/hyperion?branch=master)
5-
[![CircleCI](https://circleci.com/gh/hyperion-rt/hyperion/tree/master.svg?style=svg)](https://circleci.com/gh/hyperion-rt/hyperion/tree/master)
4+
[![Continuous Integration](https://github.com/hyperion-rt/hyperion/actions/workflows/main.yml/badge.svg)](https://github.com/hyperion-rt/hyperion/actions/workflows/main.yml)
65
[![Documentation Status](https://readthedocs.org/projects/hyperion/badge/?version=stable)](http://docs.hyperion-rt.org/en/stable/?badge=stable)
76

87
Hyperion is a 3D Monte-Carlo radiation transfer code - see http://www.hyperion-rt.org

hyperion/__init__.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,6 @@
22

33
from .version import __version__
44

5-
try:
6-
_HYPERION_SETUP_
7-
except NameError: # we are not currently running setup.py
8-
try:
9-
from .util import integrate
10-
except ImportError: # indicates the C extension failed to build
11-
import os
12-
import sys
13-
if os.path.exists('setup.py'):
14-
print("\nYou appear to be importing Hyperion from the source code "
15-
"directory. Try changing to a different directory and try "
16-
"importing Hyperion again.\n")
17-
sys.exit(0)
18-
else:
19-
raise
20-
215
# Set up the test function
226
_test_runner = None
237

hyperion/conftest.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,7 @@
11
import warnings
22

3-
import pytest
4-
53
from .util.nans import NaNWarning
64

75

8-
def pytest_addoption(parser):
9-
parser.addoption('--generate-reference', help="generate reference results for bit-level tests", type="string")
10-
parser.addoption('--enable-bit-level-tests', help="enable bit-level tests", action="store_true")
11-
12-
136
def pytest_configure(config):
147
warnings.simplefilter('error', NaNWarning)
15-
16-
17-
def pytest_collection_modifyitems(config, items):
18-
if config.getoption("--enable-bit-level-tests"):
19-
return
20-
skip_bit_level = pytest.mark.skip(reason="need --enable-bit-level-tests option to run")
21-
for item in items:
22-
if "bitlevel" in item.keywords:
23-
item.add_marker(skip_bit_level)

hyperion/grid/amr_grid.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import numpy as np
1010

1111
from ..util.meshgrid import meshgrid_nd
12-
from ..util.functions import FreezableClass, link_or_copy
12+
from ..util.functions import FreezableClass, link_or_copy, as_str
1313
from astropy import log as logger
1414
from .grid_helpers import single_grid_dims
1515

@@ -245,7 +245,7 @@ def read_geometry(self, group):
245245
'''
246246

247247
# Check that grid is indeed AMR
248-
if group.attrs['grid_type'].decode('utf-8') != 'amr':
248+
if as_str(group.attrs['grid_type']) != 'amr':
249249
raise Exception("Grid is not an AMR grid")
250250

251251
# Initialize levels list
@@ -285,7 +285,7 @@ def read_geometry(self, group):
285285
grid.nz = int(g_grid.attrs['n3'])
286286

287287
# Check that advertised hash matches real hash
288-
if group.attrs['geometry'].decode('utf-8') != self.get_geometry_id():
288+
if as_str(group.attrs['geometry']) != self.get_geometry_id():
289289
raise Exception("Calculated geometry hash does not match hash in file")
290290

291291
def read_quantities(self, group, quantities='all'):

hyperion/grid/cartesian_grid.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from astropy import log as logger
99

1010
from ..util.meshgrid import meshgrid_nd
11-
from ..util.functions import FreezableClass, is_numpy_array, monotonically_increasing, link_or_copy
11+
from ..util.functions import FreezableClass, is_numpy_array, monotonically_increasing, link_or_copy, as_str
1212
from .grid_helpers import single_grid_dims
1313

1414

@@ -252,15 +252,15 @@ def read_geometry(self, group):
252252
The HDF5 group to read the grid geometry from.
253253
'''
254254

255-
if group.attrs['grid_type'].decode('utf-8') != 'car':
255+
if as_str(group.attrs['grid_type']) != 'car':
256256
raise ValueError("Grid is not cartesian")
257257

258258
self.set_walls(group['walls_1']['x'],
259259
group['walls_2']['y'],
260260
group['walls_3']['z'])
261261

262262
# Check that advertised hash matches real hash
263-
if group.attrs['geometry'].decode('utf-8') != self.get_geometry_id():
263+
if as_str(group.attrs['geometry']) != self.get_geometry_id():
264264
raise Exception("Calculated geometry hash does not match hash in file")
265265

266266
def read_quantities(self, group, quantities='all'):

hyperion/grid/cylindrical_polar_grid.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import numpy as np
88

99
from ..util.meshgrid import meshgrid_nd
10-
from ..util.functions import FreezableClass, is_numpy_array, monotonically_increasing, link_or_copy
10+
from ..util.functions import FreezableClass, is_numpy_array, monotonically_increasing, link_or_copy, as_str
1111
from astropy import log as logger
1212
from .grid_helpers import single_grid_dims
1313

@@ -280,15 +280,15 @@ def read_geometry(self, group):
280280
The HDF5 group to read the grid geometry from.
281281
'''
282282

283-
if group.attrs['grid_type'].decode('utf-8') != 'cyl_pol':
283+
if as_str(group.attrs['grid_type']) != 'cyl_pol':
284284
raise ValueError("Grid is not cylindrical polar")
285285

286286
self.set_walls(group['walls_1']['w'],
287287
group['walls_2']['z'],
288288
group['walls_3']['p'])
289289

290290
# Check that advertised hash matches real hash
291-
if group.attrs['geometry'].decode('utf-8') != self.get_geometry_id():
291+
if as_str(group.attrs['geometry']) != self.get_geometry_id():
292292
raise Exception("Calculated geometry hash does not match hash in file")
293293

294294
def read_quantities(self, group, quantities='all'):

hyperion/grid/octree_grid.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import h5py
88
import numpy as np
99

10-
from ..util.functions import FreezableClass, is_numpy_array, link_or_copy
10+
from ..util.functions import FreezableClass, is_numpy_array, link_or_copy, as_str
1111
from astropy import log as logger
1212
from .grid_helpers import single_grid_dims
1313

@@ -341,7 +341,7 @@ def read_geometry(self, group):
341341
The HDF5 group to read the grid geometry from.
342342
'''
343343

344-
if group.attrs['grid_type'].decode('utf-8') != 'oct':
344+
if as_str(group.attrs['grid_type']) != 'oct':
345345
raise ValueError("Grid is not an octree")
346346

347347
self.set_walls(group.attrs['x'],
@@ -353,7 +353,7 @@ def read_geometry(self, group):
353353
group['cells']['refined'].astype(bool))
354354

355355
# Check that advertised hash matches real hash
356-
if group.attrs['geometry'].decode('utf-8') != self.get_geometry_id():
356+
if as_str(group.attrs['geometry']) != self.get_geometry_id():
357357
raise Exception("Calculated geometry hash does not match hash in file")
358358

359359
def read_quantities(self, group, quantities='all'):

0 commit comments

Comments
 (0)