Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix type mismatch error in MatrixMarket #81

Merged
merged 2 commits into from
Dec 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions buffalo/data/mm.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,17 @@ def get_max_column_length(fname):
# if not given, assume id as is
if uid_path:
with open(uid_path) as fin:
idmap["rows"][:] = np.loadtxt(fin, dtype=f"S{uid_max_col}")
idmap["rows"][:] = np.loadtxt(fin, dtype=h5py.string_dtype("utf-8", length=uid_max_col))
else:
idmap["rows"][:] = np.array([str(i) for i in range(1, num_users + 1)],
dtype=f"S{uid_max_col}")
dtype=h5py.string_dtype("utf-8", length=uid_max_col))
pbar.update(1)
if iid_path:
with open(iid_path) as fin:
idmap["cols"][:] = np.loadtxt(fin, dtype=f"S{iid_max_col}")
idmap["cols"][:] = np.loadtxt(fin, dtype=h5py.string_dtype("utf-8", length=iid_max_col))
else:
idmap["cols"][:] = np.array([str(i) for i in range(1, num_items + 1)],
dtype=f"S{iid_max_col}")
dtype=h5py.string_dtype("utf-8", length=iid_max_col))
pbar.update(1)
num_header_lines = 0
with open(main_path) as fin:
Expand Down Expand Up @@ -252,8 +252,8 @@ def create(self) -> h5py.File:
self.logger.debug("Building meta part...")
db, num_header_lines = self._create(data_path,
{"main_path": mm_main_path,
"uid_path": mm_uid_path,
"iid_path": mm_iid_path},
"uid_path": mm_uid_path,
"iid_path": mm_iid_path},
header)
try:
num_header_lines += 1 # add metaline
Expand Down