Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .github/workflows/format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ jobs:
- name: Failure Check
if: steps.linter.outputs.checks-failed > 0
run: echo "Some files failed the formatting check! See job summary and file annotations for more info" && exit 1

- uses: isort/isort-action@v1
3 changes: 2 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os
import os
import sys

# Determine if we're on Read the Docs server
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
Expand Down
1 change: 1 addition & 0 deletions examples/assembly/assembly.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from math import log10

import numpy as np

import openmc

# Define surfaces
Expand Down
1 change: 1 addition & 0 deletions examples/custom_source/show_flux.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import matplotlib.pyplot as plt

import openmc

# Get the flux from the statepoint
Expand Down
1 change: 1 addition & 0 deletions examples/parameterized_custom_source/show_flux.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import matplotlib.pyplot as plt

import openmc

# Get the flux from the statepoint
Expand Down
1 change: 1 addition & 0 deletions examples/pincell/build_xml.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from math import log10

import numpy as np

import openmc

###############################################################################
Expand Down
2 changes: 1 addition & 1 deletion examples/pincell/plot_spectrum.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import matplotlib.pyplot as plt
import openmc

import openmc

# Get results from statepoint
with openmc.StatePoint('statepoint.100.h5') as sp:
Expand Down
3 changes: 2 additions & 1 deletion examples/pincell_depletion/restart_depletion.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import matplotlib.pyplot as plt

import openmc
import openmc.deplete
import matplotlib.pyplot as plt

###############################################################################
# Load previous simulation results
Expand Down
3 changes: 2 additions & 1 deletion examples/pincell_depletion/run_depletion.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from math import pi

import matplotlib.pyplot as plt

import openmc
import openmc.deplete
import matplotlib.pyplot as plt

###############################################################################
# Define materials
Expand Down
47 changes: 23 additions & 24 deletions openmc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,40 @@
from openmc.bounding_box import *
from openmc.cell import *
from openmc.checkvalue import *
from openmc.mesh import *
from openmc.element import *
from openmc.executor import *
from openmc.filter import *
from openmc.filter_expansion import *
from openmc.geometry import *
from openmc.nuclide import *
from openmc.lattice import *
from openmc.macroscopic import *
from openmc.material import *
from openmc.mesh import *
from openmc.mgxs_library import *
from openmc.mixin import *
# Import a few names from the model module
from openmc.model import Model, hexagonal_prism, rectangular_prism
from openmc.nuclide import *
from openmc.particle_restart import *
from openmc.plots import *
from openmc.plotter import *
from openmc.polynomial import *
from openmc.region import *
from openmc.volume import *
from openmc.weight_windows import *
from openmc.surface import *
from openmc.universe import *
from openmc.source import *
from openmc.search import *
from openmc.settings import *
from openmc.lattice import *
from openmc.filter import *
from openmc.filter_expansion import *
from openmc.trigger import *
from openmc.tally_derivative import *
from openmc.tallies import *
from openmc.mgxs_library import *
from openmc.executor import *
from openmc.source import *
from openmc.statepoint import *
from openmc.summary import *
from openmc.particle_restart import *
from openmc.mixin import *
from openmc.plotter import *
from openmc.search import *
from openmc.polynomial import *
from openmc.surface import *
from openmc.tallies import *
from openmc.tally_derivative import *
from openmc.tracks import *
from openmc.trigger import *
from openmc.universe import *
from openmc.volume import *
from openmc.weight_windows import *

from . import examples
from .config import *

# Import a few names from the model module
from openmc.model import rectangular_prism, hexagonal_prism, Model


__version__ = '0.13.4-dev'
4 changes: 2 additions & 2 deletions openmc/arithmetic.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from collections.abc import Iterable
import copy
from collections.abc import Iterable

import numpy as np
import pandas as pd

import openmc
import openmc.checkvalue as cv
from .filter import _FILTER_TYPES

from .filter import _FILTER_TYPES

# Acceptable tally arithmetic binary operations
_TALLY_ARITHMETIC_OPS = ['+', '-', '*', '/', '^']
Expand Down
9 changes: 5 additions & 4 deletions openmc/cell.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
from collections import OrderedDict
from collections.abc import Iterable
from math import cos, sin, pi
from math import cos, pi, sin
from numbers import Real
import lxml.etree as ET

import lxml.etree as ET
import numpy as np
from uncertainties import UFloat

import openmc
import openmc.checkvalue as cv

from ._xml import get_text
from .bounding_box import BoundingBox
from .mixin import IDManagerMixin
from .region import Region, Complement
from .region import Complement, Region
from .surface import Halfspace
from .bounding_box import BoundingBox


class Cell(IDManagerMixin):
Expand Down
11 changes: 6 additions & 5 deletions openmc/cmfd.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,21 @@

"""

from collections.abc import Iterable, Mapping
from contextlib import contextmanager
from numbers import Real, Integral
import sys
import time
import warnings
from collections.abc import Iterable, Mapping
from contextlib import contextmanager
from numbers import Integral, Real

import h5py
import numpy as np
from scipy import sparse

import openmc.lib
from .checkvalue import (check_type, check_length, check_value,
check_greater_than, check_less_than)

from .checkvalue import (check_greater_than, check_length, check_less_than,
check_type, check_value)
from .exceptions import OpenMCError

# See if mpi4py module can be imported, define have_mpi global variable
Expand Down
4 changes: 2 additions & 2 deletions openmc/config.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from collections.abc import MutableMapping
import os
from pathlib import Path
import warnings
from collections.abc import MutableMapping
from pathlib import Path

from openmc.data import DataLibrary
from openmc.data.decay import _DECAY_PHOTON_ENERGY
Expand Down
36 changes: 17 additions & 19 deletions openmc/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,27 @@
WMP_VERSION = (WMP_VERSION_MAJOR, WMP_VERSION_MINOR)


from .data import *
from .neutron import *
from .photon import *
from .decay import *
from .reaction import *
from . import ace
from . import ace, endf
from .angle_distribution import *
from . import endf
from .energy_distribution import *
from .product import *
from .angle_energy import *
from .uncorrelated import *
from .correlated import *
from .data import *
from .decay import *
from .effective_dose.dose import dose_coefficients
from .energy_distribution import *
from .fission_energy import *
from .function import *
from .grid import *
from .kalbach_mann import *
from .nbody import *
from .thermal import *
from .urr import *
from .library import *
from .fission_energy import *
from .multipole import *
from .nbody import *
from .neutron import *
from .photon import *
from .product import *
from .reaction import *
from .resonance import *
from .resonance_covariance import *
from .multipole import *
from .grid import *
from .function import *

from .effective_dose.dose import dose_coefficients
from .thermal import *
from .uncorrelated import *
from .urr import *
7 changes: 4 additions & 3 deletions openmc/data/ace.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,17 @@

"""

from collections import OrderedDict
import enum
from pathlib import Path
import struct
from collections import OrderedDict
from pathlib import Path

import numpy as np

import openmc.checkvalue as cv
from openmc.mixin import EqualityMixin
from .data import ATOMIC_SYMBOL, gnds_name, EV_PER_MEV, K_BOLTZMANN

from .data import ATOMIC_SYMBOL, EV_PER_MEV, K_BOLTZMANN, gnds_name
from .endf import ENDF_FLOAT_RE


Expand Down
9 changes: 5 additions & 4 deletions openmc/data/angle_distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@

import openmc.checkvalue as cv
from openmc.mixin import EqualityMixin
from openmc.stats import Univariate, Tabular, Uniform, Legendre
from .function import INTERPOLATION_SCHEME
from openmc.stats import Legendre, Tabular, Uniform, Univariate

from .data import EV_PER_MEV
from .endf import get_head_record, get_cont_record, get_tab1_record, \
get_list_record, get_tab2_record
from .endf import (get_cont_record, get_head_record, get_list_record,
get_tab1_record, get_tab2_record)
from .function import INTERPOLATION_SCHEME


class AngleDistribution(EqualityMixin):
Expand Down
9 changes: 5 additions & 4 deletions openmc/data/correlated.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
from collections.abc import Iterable
from numbers import Real, Integral
from numbers import Integral, Real
from warnings import warn

import numpy as np

import openmc.checkvalue as cv
from openmc.stats import Tabular, Univariate, Discrete, Mixture, \
Uniform, Legendre
from .function import INTERPOLATION_SCHEME
from openmc.stats import (Discrete, Legendre, Mixture, Tabular, Uniform,
Univariate)

from .angle_energy import AngleEnergy
from .data import EV_PER_MEV
from .endf import get_list_record, get_tab2_record
from .function import INTERPOLATION_SCHEME


class CorrelatedAngleEnergy(AngleEnergy):
Expand Down
4 changes: 2 additions & 2 deletions openmc/data/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
import json
import os
import re
from math import log, sqrt
from pathlib import Path
from math import sqrt, log
from warnings import warn
from typing import Dict
from warnings import warn

# Isotopic abundances from Meija J, Coplen T B, et al, "Isotopic compositions
# of the elements 2013 (IUPAC Technical Report)", Pure. Appl. Chem. 88 (3),
Expand Down
10 changes: 5 additions & 5 deletions openmc/data/decay.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import re
from collections.abc import Iterable
from io import StringIO
from math import log
import re
from typing import Optional
from warnings import warn

import numpy as np
from uncertainties import ufloat, UFloat
from uncertainties import UFloat, ufloat

import openmc
import openmc.checkvalue as cv
from openmc.exceptions import DataError
from openmc.mixin import EqualityMixin
from openmc.stats import Discrete, Tabular, Univariate, combine_distributions
from .data import ATOMIC_SYMBOL, ATOMIC_NUMBER
from .function import INTERPOLATION_SCHEME
from .endf import Evaluation, get_head_record, get_list_record, get_tab1_record

from .data import ATOMIC_NUMBER, ATOMIC_SYMBOL
from .endf import Evaluation, get_head_record, get_list_record, get_tab1_record
from .function import INTERPOLATION_SCHEME

# Gives name and (change in A, change in Z) resulting from decay
_DECAY_MODES = {
Expand Down
3 changes: 2 additions & 1 deletion openmc/data/endf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@

"""
import io
from pathlib import PurePath
import re
from pathlib import PurePath

import numpy as np

from .data import gnds_name
from .function import Tabulated1D

try:
from ._endf import float_endf
_CYTHON = True
Expand Down
5 changes: 3 additions & 2 deletions openmc/data/energy_distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@

import openmc.checkvalue as cv
from openmc.mixin import EqualityMixin
from openmc.stats.univariate import Univariate, Tabular, Discrete, Mixture
from openmc.stats.univariate import Discrete, Mixture, Tabular, Univariate

from .data import EV_PER_MEV
from .endf import get_tab1_record, get_tab2_record
from .function import Tabulated1D, INTERPOLATION_SCHEME
from .function import INTERPOLATION_SCHEME, Tabulated1D


class EnergyDistribution(EqualityMixin, ABC):
Expand Down
Loading