Open lhchg opened 2 weeks ago
Sorry, seems some error will be introduced. I'm checking
Hi @paulromano @gridley
I updated the code to use hardcode for the reference part. And I think if included a python script to generate the reference part, maybe this would introduce new python package dependencies when running the catch2 unit tests?
What do you think of this hardcode approach?
If you think it would be better to include a python script, I will continue to modify it.
There seems to be some dependency on the python math api
self = <openmc.polynomial.ZernikeRadial object at 0x7fe6bfe0dc90>, r = 0.196
def __call__(self, r):
import openmc.lib as lib
if isinstance(r, Iterable):
return [np.sum(self._norm_coef * lib.calc_zn_rad(self.order, r_i / self.radius))
for r_i in r]
else:
> return np.sum(self._norm_coef * lib.calc_zn_rad(self.order, r / self.radius))
E AttributeError: module 'openmc.lib' has no attribute 'calc_zn_rad'
openmc/polynomial.py:82: AttributeError
I have fixed it
Description
Some interfaces do not need to be exposed to the python API, except for unit testing, so move math unit tests to C++ unit tests, which implemented in python before
Fixes #2943
Checklist
I have followed the style guidelines for Python source files (if applicable)I have made corresponding changes to the documentation (if applicable)I have added tests that prove my fix is effective or that my feature works (if applicable)