@@ -0,0 +1,1332 @@
+package org.openlca.core.matrix.io.npy;%0A%0Aimport java.io.BufferedInputStream;%0Aimport java.io.File;%0Aimport java.io.IOException;%0Aimport java.io.InputStream;%0Aimport java.util.ArrayList;%0Aimport java.util.Enumeration;%0Aimport java.util.List;%0Aimport java.util.zip.ZipEntry;%0Aimport java.util.zip.ZipFile;%0A%0Apublic class Npz %7B%0A%0A%09private Npz() %7B%0A%09%7D%0A%0A%09/**%0A%09 * Returns a list with the entries of the given NPZ file. As an NPZ file%0A%09 * is just a zip file of NPY files this gives the names of the NPY files%0A%09 * in the zip.%0A%09 */%0A%09public static List%3CString%3E entries(File file) %7B%0A%09%09try (ZipFile zip = new ZipFile(file))%7B%0A%09%09%09List%3CString%3E names = new ArrayList%3C%3E();%0A%09%09%09Enumeration%3C? extends ZipEntry%3E entries = zip.entries();%0A%09%09%09while (entries.hasMoreElements()) %7B%0A%09%09%09%09ZipEntry e = entries.nextElement();%0A%09%09%09%09names.add(e.getName());%0A%0A%09%09%09%09// TODO: this is currently just for testing%0A%09%09%09%09System.out.println(e.getName());%0A%09%09%09%09try (InputStream in = zip.getInputStream(e);%0A%09%09%09%09%09 BufferedInputStream buf = new BufferedInputStream(in)) %7B%0A%09%09%09%09%09System.out.println(Header.read(buf));%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%09return names;%0A%09%09%7D catch (IOException e) %7B%0A%09%09%09throw new RuntimeException(%22Failed to read NPZ file %22 + file, e);%0A%09%09%7D%0A%09%7D%0A%0A%09public static void main(String%5B%5D args) %7B%0A%09%09String path = %22/Users/ms/Downloads/csr.npz%22;%0A%09%09System.out.println(Npz.entries(new File(path)));%0A%09%7D%0A%0A%7D%0A

can we identify the type of a (scipy) sparse matrix from