You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fresh install of GEOUNED draws in numpy 2.2.X, which, at least in the case of MCNP-2-CAD translation ends up with an error. Few tests have been done and numpy 2.1.3 is the last version that still works. Downgrade of numpy is required for GEOUNED to work.
To Reproduce
Steps to reproduce the behavior:
Install GEOUNED in conda (windows env).
Do a reverse translation of a geometry.
See error
Expected behavior
GEOUNED crashes with the attached error message.
Error message
{
"name": "ValueError",
"message": "The truth value of an empty array is ambiguous. Use `array.size > 0` to check that an array is not empty.",
"stack": "---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In[1], line 5
1 import geouned
3 geo = geouned.CsgToCad()
----> 5 geo.export_cad(
6 input_filename='extracted.i',
7 csg_format='mcnp',
8 bounding_box=[3000,-3000,-5500,8000,3000,-2000],
9 cell_range_type='all',
10 mat_range_type='all',
11 output_filename='divertor',
12 )
File c:\\ProgramData\\Anaconda3\\envs\\geo_env\\Lib\\site-packages\\geouned\\GEOReverse\\core.py:104, in CsgToCad.export_cad(self, input_filename, csg_format, output_filename, bounding_box, universe_start, level_max, cell_range_type, cell_range, mat_range_type, mat_range)
91 CADselection = {
92 \"Ustart\": universe_start,
93 \"levelMax\": level_max,
(...)
100 \"mat_range\": mat_range,
101 }
103 # TODO don't return fails variable, just fail in the method and raise the error there
--> 104 CADCells, fails = buildCAD(UnivCell, geo, CADselection)
106 if fails:
107 print(\"failed in conversion\", fails)
File c:\\ProgramData\\Anaconda3\\envs\\geo_env\\Lib\\site-packages\\geouned\\GEOReverse\\Modules\\buildCAD.py:23, in buildCAD(UnivCell, data, config)
20 else:
21 factor = 1
---> 23 modelSurfaces = data.GetSurfaces(scale=factor) # scale change cm in mcnp to mm in CAD Obj
25 # read Cells and group into universes
26 print(config)
File c:\\ProgramData\\Anaconda3\\envs\\geo_env\\Lib\\site-packages\\geouned\\GEOReverse\\Modules\\MCNPinput.py:164, in McnpInput.GetSurfaces(self, scale)
161 number += 1
163 # return surface as surface Objects type
--> 164 return Get_primitive_surfaces(surf_cards, scale)
File c:\\ProgramData\\Anaconda3\\envs\\geo_env\\Lib\\site-packages\\geouned\\GEOReverse\\Modules\\MCNPinput.py:658, in Get_primitive_surfaces(mcnp_surfaces, scale)
656 Stype, quadric = sq2params(Qparams)
657 else:
--> 658 Stype, quadric = gq2params(Qparams)
660 if Stype == \"cylinder\":
661 # p = FreeCAD.Vector(quadric[0:3])
662 # v = FreeCAD.Vector(quadric[3:6])
663 # R = quadric[6]
664 p, v, R = quadric
File c:\\ProgramData\\Anaconda3\\envs\\geo_env\\Lib\\site-packages\\geouned\\GEOReverse\\Modules\\MCNPinput.py:1261, in gq2params(x)
1258 iz = zero[0]
1259 comp = 2 * XD[iz]
1260 if (
-> 1261 abs(comp) > 1e-6
1262 ): # zero eigenvalue but corresponding component in XD vector is non zero => paraboloid Curve => the k/comp value is the translation in this component direction
1263 TD[iz] = -k / comp
1264 U = (k, (iz, comp))
ValueError: The truth value of an empty array is ambiguous. Use `array.size > 0` to check that an array is not empty."
}
Screenshots
If applicable, add screenshots to help explain your problem.
Please complete the following information):
OS: Windows
GEOUNED v1.5.1
Python version: 3.11.11
numpy version: 2.2.3
Additional context
Downgrading numpy to v2.1.3 solves the issue.
The text was updated successfully, but these errors were encountered:
Describe the bug
Fresh install of GEOUNED draws in numpy 2.2.X, which, at least in the case of MCNP-2-CAD translation ends up with an error. Few tests have been done and numpy 2.1.3 is the last version that still works. Downgrade of numpy is required for GEOUNED to work.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
GEOUNED crashes with the attached error message.
Error message
Screenshots
If applicable, add screenshots to help explain your problem.
Please complete the following information):
Additional context
Downgrading numpy to v2.1.3 solves the issue.
The text was updated successfully, but these errors were encountered: