mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
Add deprecation warning for Cell.add_surface()
This commit is contained in:
parent
b9024f2d8e
commit
81ed29cc38
1 changed files with 7 additions and 0 deletions
|
|
@ -3,6 +3,7 @@ from collections import OrderedDict, Iterable
|
|||
from numbers import Real, Integral
|
||||
from xml.etree import ElementTree as ET
|
||||
import sys
|
||||
import warnings
|
||||
|
||||
import numpy as np
|
||||
|
||||
|
|
@ -181,6 +182,12 @@ class Cell(object):
|
|||
|
||||
"""
|
||||
|
||||
warnings.simplefilter('always', DeprecationWarning)
|
||||
warnings.warn("Cell.add_surface(...) has been deprecated and may be "
|
||||
"removed in a future version. The region for a Cell "
|
||||
"should be defined using the region property directly.",
|
||||
DeprecationWarning)
|
||||
|
||||
if not isinstance(surface, openmc.Surface):
|
||||
msg = 'Unable to add Surface "{0}" to Cell ID="{1}" since it is ' \
|
||||
'not a Surface object'.format(surface, self._id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue