Skip to content

Commit a93b8d8

Browse files
authored
Merge branch 'develop' into documentation
2 parents 34e4a01 + 4670c2b commit a93b8d8

File tree

11 files changed

+52
-19
lines changed

11 files changed

+52
-19
lines changed

.travis.yml

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ notifications:
1515
webhooks: https://coveralls.io/webhook?repo_token=$COVERALLS_REPO_TOKEN
1616
matrix:
1717
include:
18+
- python: "3.10"
19+
env: OMP=n MPI=n
1820
- python: "3.6"
1921
env: OMP=n MPI=n
2022
- python: "3.6"

LICENSE

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (C) 2012-2023 Massachusetts Institute of Technology
2+
and OpenMOC contributors
3+
4+
Permission is hereby granted, free of charge, to any person obtaining a copy of
5+
this software and associated documentation files (the "Software"), to deal in
6+
the Software without restriction, including without limitation the rights to
7+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
8+
the Software, and to permit persons to whom the Software is furnished to do so,
9+
subject to the following conditions:
10+
11+
The above copyright notice and this permission notice shall be included in all
12+
copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
17+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
18+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Please cite OpenMOC in your publications if it helps your research:
7070
License
7171
-------
7272

73-
OpenMOC is approved for distribution under the MIT/X license_.
73+
OpenMOC is approved for distribution under the MIT license_.
7474

7575
.. _installation instructions: https://mit-crpg.github.io/OpenMOC/usersguide/install.html
7676
.. _license: https://mit-crpg.github.io/OpenMOC/license.html

docs/source/license.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
License Agreement
55
=================
66

7-
Copyright © 2012-2019 Massachusetts Institute of Technology
7+
Copyright © 2012-2023 Massachusetts Institute of Technology
88

99
Permission is hereby granted, free of charge, to any person obtaining a copy of
1010
this software and associated documentation files (the "Software"), to deal in

openmoc/checkvalue.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
else:
1717
from openmoc.log import *
1818

19+
if sys.version_info >= (3, 3):
20+
from collections.abc import Iterable
21+
else:
22+
from collections import Iterable
23+
1924

2025
def _isinstance(value, expected_type):
2126
"""A Numpy-aware replacement for isinstance
@@ -206,7 +211,7 @@ def check_value(name, value, accepted_values):
206211
----------
207212
name : str
208213
Description of value being checked
209-
value : collections.Iterable
214+
value : Iterable
210215
Object to check
211216
accepted_values : collections.Container
212217
Container of acceptable values

openmoc/materialize.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ def compute_sph_factors(mgxs_lib, max_sph_iters=30, sph_tol=1E-5,
761761
solver.resetFixedSources()
762762

763763
# Collect SPH factors for each FSR, energy group
764-
fsrs_to_sph = np.ones((num_fsrs, num_groups), dtype=np.float)
764+
fsrs_to_sph = np.ones((num_fsrs, num_groups), dtype=np.float64)
765765
for i, openmc_domain in enumerate(mgxs_lib.domains):
766766
if openmc_domain.id in openmoc_domains:
767767
if openmc_domain.id in sph_domains:

openmoc/plotter.py

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
import os
22
import sys
33
from numbers import Integral, Real
4-
54
try:
65
from collections import Iterable
76
except ImportError: # changed in python 3.3
87
from collections.abc import Iterable
9-
108
import warnings
119

1210
import numpy as np
1311
import numpy.random
1412
import matplotlib
1513
from mpl_toolkits.mplot3d import Axes3D
1614

15+
# For Python 3.3.X and above
16+
if sys.version_info >= (3, 3):
17+
from collections.abc import Iterable
18+
else:
19+
from collections import Iterable
20+
1721
# Force headless backend for plotting on clusters
1822
if "DISPLAY" not in os.environ:
1923
matplotlib.use('Agg')
@@ -609,7 +613,7 @@ def plot_flat_source_regions(geometry, gridsize=250, xlim=None, ylim=None,
609613
if centroids:
610614

611615
# Populate a NumPy array with the FSR centroid coordinates
612-
centroids = np.zeros((num_fsrs, 2), dtype=np.float)
616+
centroids = np.zeros((num_fsrs, 2), dtype=np.float64)
613617
for fsr_id in range(num_fsrs):
614618
coords = geometry.getGlobalFSRCentroidData(fsr_id)
615619
if plane == 'xy':
@@ -952,7 +956,7 @@ def plot_energy_fluxes(solver, fsrs, group_bounds=None, norm=True,
952956
for fsr in fsrs:
953957

954958
# Allocate memory for an array of this FSR's fluxes
955-
fluxes = np.zeros(num_groups, dtype=np.float)
959+
fluxes = np.zeros(num_groups, dtype=np.float64)
956960

957961
# Extract the flux in each energy group
958962
for group in range(num_groups):
@@ -1317,7 +1321,7 @@ def plot_spatial_data(domains_to_data, plot_params, get_figure=False):
13171321
surface = domains_to_data.take(domains.flatten())
13181322
# If domains-to-data was input as a Python dictionary
13191323
else:
1320-
surface = np.zeros(domains.shape, dtype=np.float)
1324+
surface = np.zeros(domains.shape, dtype=np.float64)
13211325
for domain_id in domains_to_data:
13221326
indices = np.where(domains == domain_id)
13231327
surface[indices] = domains_to_data[domain_id]
@@ -1947,7 +1951,7 @@ def _get_pil_image(array, plot_params):
19471951
from PIL import Image
19481952

19491953
# Convert array to a normalized array of floating point values
1950-
float_array = np.zeros(array.shape, dtype=np.float)
1954+
float_array = np.zeros(array.shape, dtype=np.float64)
19511955
float_array[:,:] = array[:,:]
19521956
float_array[:,:] /= np.max(float_array)
19531957

openmoc/process.py

+8-5
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@
66
import datetime
77
import operator
88
from numbers import Integral, Real
9-
109
try:
1110
from collections import Iterable
1211
except ImportError: # changed in python 3.3
1312
from collections.abc import Iterable
14-
1513
import pickle
1614

1715
import numpy as np
@@ -28,6 +26,11 @@
2826
from openmoc.log import *
2927
import openmoc.checkvalue as cv
3028

29+
if sys.version_info >= (3, 3):
30+
from collections.abc import Iterable
31+
else:
32+
from collections import Iterable
33+
3134
# Store viable OpenMOC solver types for type checking
3235
solver_types = (openmoc.Solver,)
3336
# Store implemented reaction types for value checking
@@ -994,7 +997,7 @@ def tally_fission_rates(self, solver, volume='integrated', nu=False):
994997
solver.computeFSRFissionRates(int(geometry.getNumTotalFSRs()), nu)
995998

996999
# Initialize a 2D or 3D NumPy array in which to tally
997-
tally = np.zeros(tuple(self.dimension), dtype=np.float)
1000+
tally = np.zeros(tuple(self.dimension), dtype=np.float64)
9981001

9991002
# Tally the fission rates in each FSR to the corresponding mesh cell
10001003
for fsr in range(num_fsrs):
@@ -1117,7 +1120,7 @@ def tally_on_mesh(self, solver, domains_to_coeffs, domain_type='fsr',
11171120

11181121
# Initialize a 2D or 3D NumPy array in which to tally
11191122
tally_shape = tuple(self.dimension) + (num_groups,)
1120-
tally = np.zeros(tally_shape, dtype=np.float)
1123+
tally = np.zeros(tally_shape, dtype=np.float64)
11211124

11221125
# Compute product of fluxes with domains-to-coeffs mapping by group, FSR
11231126
for fsr in range(num_fsrs):
@@ -1128,7 +1131,7 @@ def tally_on_mesh(self, solver, domains_to_coeffs, domain_type='fsr',
11281131
continue
11291132

11301133
volume = solver.getFSRVolume(fsr)
1131-
fsr_tally = np.zeros(num_groups, dtype=np.float)
1134+
fsr_tally = np.zeros(num_groups, dtype=np.float64)
11321135

11331136
# Determine domain ID (material, cell or FSR) for this FSR
11341137
if domain_type == 'fsr':

sample-input/sph-factors/slab/sph-factors.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@
8686
# Allocate arrays for FSR-specific data to extract from OpenMOC model
8787
num_fsrs = openmoc_geometry.getNumFSRs()
8888
cell_ids = np.zeros(num_fsrs, dtype=np.int)
89-
centroids = np.zeros(num_fsrs, dtype=np.float)
90-
volumes = np.zeros(num_fsrs, dtype=np.float)
89+
centroids = np.zeros(num_fsrs, dtype=np.float64)
90+
volumes = np.zeros(num_fsrs, dtype=np.float64)
9191

9292
# Find the cell IDs, volumes, centroids and fluxes for each FSR
9393
for fsr_id in range(num_fsrs):

src/CPUSolver.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ void CPUSolver::setNumThreads(int num_threads) {
166166
* routine may be used as follows from within Python:
167167
*
168168
* @code
169-
* fluxes = numpy.random.rand(num_FSRs * num_groups, dtype=np.float)
169+
* fluxes = numpy.random.rand(num_FSRs * num_groups, dtype=np.float64)
170170
* solver.setFluxes(fluxes)
171171
* @endcode
172172
*

src/accel/cuda/GPUSolver.cu

+1-1
Original file line numberDiff line numberDiff line change
@@ -1061,7 +1061,7 @@ void GPUSolver::setTrackGenerator(TrackGenerator* track_generator) {
10611061
* @code
10621062
* num_FSRs = solver.getGeometry.getNumFSRs()
10631063
* NUM_GROUPS = solver.getGeometry.getNumEnergyGroups()
1064-
* fluxes = numpy.random.rand(num_FSRs * NUM_GROUPS, dtype=np.float)
1064+
* fluxes = numpy.random.rand(num_FSRs * NUM_GROUPS, dtype=np.float64)
10651065
* solver.setFluxes(fluxes)
10661066
* @endcode
10671067
*

0 commit comments

Comments
 (0)