Package Details: python-nurbs 5.3.1-3

Git Clone URL: https://aur.archlinux.org/python-nurbs.git (read-only, click to copy)
Package Base: python-nurbs
Description: Object-oriented pure Python B-Spline and NURBS library
Upstream URL: https://onurraufbingol.com/NURBS-Python
Licenses: MIT
Submitter: greyltc
Maintainer: Maik93
Last Packager: Maik93
Votes: 1
Popularity: 0.000000
First Submitted: 2020-12-21 16:09 (UTC)
Last Updated: 2023-11-22 10:23 (UTC)

Dependencies (9)

Required by (1)

Sources (2)

Latest Comments

tapia commented on 2023-11-21 22:24 (UTC)

Thanks for the patch jenrik! This should be added to the PKGBUILD.

jenrik commented on 2023-10-01 11:34 (UTC)

Here is a patch to the 5.3.1-2 package that patches the np.float issue:

diff --git a/PKGBUILD b/PKGBUILD
index 17ada72..fdbc699 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -17,11 +17,18 @@ optdepends=(
 )
 makedepends=(python-setuptools cython)
 checkdepends=(python-pytest python-matplotlib)
-source=("${pkgname}-${pkgver}.tar.gz"::${_giturl}/archive/v${pkgver}.tar.gz)
-sha256sums=('a9a7c5830294a90aa4d5249c9bb4741075816087ff2484b68ee08c93c80bda56')
+source=(
+  "${pkgname}-${pkgver}.tar.gz"::${_giturl}/archive/v${pkgver}.tar.gz
+  "np-float.patch"
+)
+sha256sums=(
+  'a9a7c5830294a90aa4d5249c9bb4741075816087ff2484b68ee08c93c80bda56'
+  'SKIP'
+)

 build() {
   cd NURBS-Python-${pkgver}
+  patch -p0 < ../np-float.patch
   python setup.py build
 }

diff --git a/np-float.patch b/np-float.patch
new file mode 100644
index 0000000..4af7650
--- /dev/null
+++ b/np-float.patch
@@ -0,0 +1,107 @@
+diff --color -ruN ../NURBS-Python-5.3.1-clone/geomdl/visualization/VisMPL.py ./geomdl/visualization/VisMPL.py
+--- ../NURBS-Python-5.3.1-clone/geomdl/visualization/VisMPL.py 2023-10-01 13:28:01.284096807 +0200
++++ ./geomdl/visualization/VisMPL.py   2023-10-01 13:28:40.233660486 +0200
+@@ -68,7 +68,7 @@
+ 
+     def __init__(self, **kwargs):
+         super(VisConfig, self).__init__(**kwargs)
+-        self.dtype = np.float
++        self.dtype = float
+         self.display_ctrlpts = kwargs.get('ctrlpts', True)
+         self.display_evalpts = kwargs.get('evalpts', True)
+         self.display_bbox = kwargs.get('bbox', False)
+diff --color -ruN ../NURBS-Python-5.3.1-clone/geomdl/visualization/VisPlotly.py ./geomdl/visualization/VisPlotly.py
+--- ../NURBS-Python-5.3.1-clone/geomdl/visualization/VisPlotly.py  2023-10-01 13:28:01.284096807 +0200
++++ ./geomdl/visualization/VisPlotly.py    2023-10-01 13:28:40.240327074 +0200
+@@ -58,7 +58,7 @@
+     """
+     def __init__(self, **kwargs):
+         super(VisConfig, self).__init__(**kwargs)
+-        self.dtype = np.float
++        self.dtype = float
+         # Set Plotly custom variables
+         self.figure_image_filename = "temp-plot.html"
+         self.use_renderer = kwargs.get("use_renderer", False)
+diff --color -ruN ../NURBS-Python-5.3.1-clone/geomdl/visualization/VisVTK.py ./geomdl/visualization/VisVTK.py
+--- ../NURBS-Python-5.3.1-clone/geomdl/visualization/VisVTK.py 2023-10-01 13:28:01.284096807 +0200
++++ ./geomdl/visualization/VisVTK.py   2023-10-01 13:28:40.236993780 +0200
+@@ -132,10 +132,10 @@
+             # Plot control points
+             if plot['type'] == 'ctrlpts' and self.vconf.display_ctrlpts:
+                 # Points as spheres
+-                pts = np.array(plot['ptsarr'], dtype=np.float)
++                pts = np.array(plot['ptsarr'], dtype=float)
+                 # Handle 2-dimensional data
+                 if pts.shape[1] == 2:
+-                    pts = np.c_[pts, np.zeros(pts.shape[0], dtype=np.float)]
++                    pts = np.c_[pts, np.zeros(pts.shape[0], dtype=float)]
+                 vtkpts = numpy_to_vtk(pts, deep=False, array_type=VTK_FLOAT)
+                 vtkpts.SetName(plot['name'])
+                 actor1 = vtkh.create_actor_pts(pts=vtkpts, color=vtkh.create_color(plot['color']),
+@@ -148,10 +148,10 @@
+ 
+             # Plot evaluated points
+             if plot['type'] == 'evalpts' and self.vconf.display_evalpts:
+-                pts = np.array(plot['ptsarr'], dtype=np.float)
++                pts = np.array(plot['ptsarr'], dtype=float)
+                 # Handle 2-dimensional data
+                 if pts.shape[1] == 2:
+-                    pts = np.c_[pts, np.zeros(pts.shape[0], dtype=np.float)]
++                    pts = np.c_[pts, np.zeros(pts.shape[0], dtype=float)]
+                 vtkpts = numpy_to_vtk(pts, deep=False, array_type=VTK_FLOAT)
+                 vtkpts.SetName(plot['name'])
+                 actor1 = vtkh.create_actor_polygon(pts=vtkpts, color=vtkh.create_color(plot['color']),
+@@ -200,7 +200,7 @@
+                 vertices = [v.data for v in plot['ptsarr'][0]]
+                 faces = [q.data for q in plot['ptsarr'][1]]
+                 # Points as spheres
+-                pts = np.array(vertices, dtype=np.float)
++                pts = np.array(vertices, dtype=float)
+                 vtkpts = numpy_to_vtk(pts, deep=False, array_type=VTK_FLOAT)
+                 vtkpts.SetName(plot['name'])
+                 actor1 = vtkh.create_actor_pts(pts=vtkpts, color=vtkh.create_color(plot['color']),
+@@ -226,7 +226,7 @@
+             # Plot trim curves
+             if self.vconf.display_trims:
+                 if plot['type'] == 'trimcurve':
+-                    pts = np.array(plot['ptsarr'], dtype=np.float)
++                    pts = np.array(plot['ptsarr'], dtype=float)
+                     vtkpts = numpy_to_vtk(pts, deep=False, array_type=VTK_FLOAT)
+                     vtkpts.SetName(plot['name'])
+                     actor1 = vtkh.create_actor_polygon(pts=vtkpts, color=vtkh.create_color(plot['color']),
+@@ -269,7 +269,7 @@
+             # Plot control points
+             if plot['type'] == 'ctrlpts' and self.vconf.display_ctrlpts:
+                 # Points as spheres
+-                pts = np.array(plot['ptsarr'], dtype=np.float)
++                pts = np.array(plot['ptsarr'], dtype=float)
+                 vtkpts = numpy_to_vtk(pts, deep=False, array_type=VTK_FLOAT)
+                 vtkpts.SetName(plot['name'])
+                 temp_actor = vtkh.create_actor_pts(pts=vtkpts, color=vtkh.create_color(plot['color']),
+@@ -278,7 +278,7 @@
+ 
+             # Plot evaluated points
+             if plot['type'] == 'evalpts' and self.vconf.display_evalpts:
+-                pts = np.array(plot['ptsarr'], dtype=np.float)
++                pts = np.array(plot['ptsarr'], dtype=float)
+                 vtkpts = numpy_to_vtk(pts, deep=False, array_type=VTK_FLOAT)
+                 vtkpts.SetName(plot['name'])
+                 temp_actor = vtkh.create_actor_pts(pts=vtkpts, color=vtkh.create_color(plot['color']),
+@@ -321,7 +321,7 @@
+             # Plot control points
+             if plot['type'] == 'ctrlpts' and self.vconf.display_ctrlpts:
+                 # Points as spheres
+-                pts = np.array(plot['ptsarr'], dtype=np.float)
++                pts = np.array(plot['ptsarr'], dtype=float)
+                 vtkpts = numpy_to_vtk(pts, deep=False, array_type=VTK_FLOAT)
+                 vtkpts.SetName(plot['name'])
+                 temp_actor = vtkh.create_actor_pts(pts=vtkpts, color=vtkh.create_color(plot['color']),
+@@ -330,7 +330,7 @@
+ 
+             # Plot evaluated points
+             if plot['type'] == 'evalpts' and self.vconf.display_evalpts:
+-                faces = np.array(plot['ptsarr'][1], dtype=np.float)
++                faces = np.array(plot['ptsarr'][1], dtype=float)
+                 filled = np.array(plot['ptsarr'][2], dtype=np.int)
+                 grid_filled = faces[filled == 1]
+                 temp_actor = vtkh.create_actor_hexahedron(grid=grid_filled, color=vtkh.create_color(plot['color']),

leograyc commented on 2023-07-16 17:44 (UTC) (edited on 2023-07-16 17:44 (UTC) by leograyc)

I run into the same float error from this package while trying to install cadquery. Seems like there will be little hope of fixing this from upstream. Maybe it's better to create forks now.

greyltc commented on 2023-06-21 14:37 (UTC) (edited on 2023-06-21 14:41 (UTC) by greyltc)

I'm afraid upstream might be dead here. Anyone know?

Adding the following to the PKGBUILD fixes the package today:

prepare() {
  cd NURBS-Python-${pkgver}
  curl -s https://github.com/orbingol/NURBS-Python/commit/71923eeb8e8ec8e057b253a744c89d7dfa1cf89d.patch | patch -p1
}

sdp8483 commented on 2023-04-30 15:15 (UTC)

I get the following error:

============================================= ERRORS ==============================================
__________________________ ERROR collecting tests/test_visualization.py ___________________________
tests/test_visualization.py:17: in <module>
    from geomdl.visualization import VisMPL
geomdl/visualization/VisMPL.py:124: in <module>
    class VisCurve2D(vis.VisAbstract):
geomdl/visualization/VisMPL.py:126: in VisCurve2D
    def __init__(self, config=VisConfig(), **kwargs):
geomdl/visualization/VisMPL.py:71: in __init__
    self.dtype = np.float
/usr/lib/python3.10/site-packages/numpy/__init__.py:305: in __getattr__
    raise AttributeError(__former_attrs__[attr])
E   AttributeError: module 'numpy' has no attribute 'float'.
E   `np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
E   The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
E       https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations. Did you mean: 'cfloat'?

I was able to fix the error by modifying /src/geomdl/visualizaton/VisMPL.py line 71 np.float change to np.float64 Then install with makepkg -sei the e option disables extracting the source files so that the changes above are not overwritten.

And1G commented on 2022-08-18 17:40 (UTC)

Please also add python-matplotlib to checkdepends, otherwise makepkg will fail in clean chroot:

_________________ ERROR collecting tests/test_visualization.py _________________
ImportError while importing test module '/build/python-nurbs/src/NURBS-Python-5.3.1/tests/test_visualization.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_visualization.py:15: in <module>
    import matplotlib
E   ModuleNotFoundError: No module named 'matplotlib'
=========================== short test summary info ============================
ERROR tests/test_visualization.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.30s ===============================
==> ERROR: A failure occurred in check().