HEPonHPC / apprentice

Other
9 stars 8 forks source link

problem finding scikit and astype(str) not recognized in io.py #9

Closed smrenna closed 6 months ago

smrenna commented 1 year ago

I had two issues I needed to resolve to use apprentice. I am working with the gitlab repo. I am using python3 on a linux machine. I needed to make these changes:

diff --git a/apprentice/io.py b/apprentice/io.py
index 8014468..a7f2640 100644
--- a/apprentice/io.py
+++ b/apprentice/io.py
@@ -360,7 +360,8 @@ def readPnamesH5(fname, xfield):
     import h5py

     with h5py.File(fname, "r") as f:
-        pnames = [p.astype(str) for p in f.get(xfield).attrs["names"]]
+        pnames = [str(p) for p in f.get(xfield).attrs["names"]]
+#        pnames = [p.astype(str) for p in f.get(xfield).attrs["names"]]

     return pnames

diff --git a/bin/app-yoda2h5 b/bin/app-yoda2h5
index 7e86dc1..d74a8a0 100755
--- a/bin/app-yoda2h5
+++ b/bin/app-yoda2h5
@@ -1,4 +1,5 @@
 #!/usr/bin/env python3
+import sklearn

 import apprentice as app