Skip to content

Fix clippy warnings. Add nicer error messages for mmap files.#7

Merged
piobab merged 1 commit intomasterfrom
fix-clippy-warnings
Nov 20, 2020
Merged

Fix clippy warnings. Add nicer error messages for mmap files.#7
piobab merged 1 commit intomasterfrom
fix-clippy-warnings

Conversation

@piobab
Copy link
Copy Markdown
Contributor

@piobab piobab commented Nov 19, 2020

No description provided.

@piobab piobab mentioned this pull request Nov 19, 2020
Comment thread src/embedding.rs Outdated
Comment thread src/embedding.rs Outdated
@piobab piobab force-pushed the fix-clippy-warnings branch from 2dcc6d8 to 8ee275c Compare November 20, 2020 09:02
Copy link
Copy Markdown
Collaborator

@kodieg kodieg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@piobab piobab merged commit d09f752 into master Nov 20, 2020
@piobab piobab deleted the fix-clippy-warnings branch November 20, 2020 11:20
jaroslawkrolewski pushed a commit to jaroslawkrolewski/cleora that referenced this pull request Mar 18, 2026
Added four import functions to pycleora/io_utils.py:

1. from_pandas(df, source_col, target_col, weight_col=None, columns=...)
   - Creates SparseMatrix from a pandas DataFrame
   - weight_col filters out edges with NaN or zero weights
   - NaN filtering uses pd.isna() for pandas nullable dtype safety
   - try/except import pattern for pandas as optional dependency

2. from_scipy_sparse(matrix, entity_ids=None, columns=...)
   - Creates SparseMatrix from scipy sparse adjacency matrix
   - Uses integer string IDs when entity_ids is None
   - Deduplicates symmetric edges via min/max key pattern
   - try/except import pattern for scipy as optional dependency

3. from_edge_list(edges, columns=...)
   - Creates SparseMatrix from list of (source, target) or (source, target, weight) tuples
   - Weight values accepted but not used in SparseMatrix construction
     (actual weighting handled by embed_weighted per architecture)

4. from_numpy(adjacency_matrix, entity_ids=None, columns=...)
   - Creates SparseMatrix from dense numpy adjacency matrix
   - Handles asymmetric matrices by checking both (i,j) and (j,i)
   - Uses integer string IDs when entity_ids is None

All functions use SparseMatrix.from_iterator() internally, follow existing
patterns (from_networkx), include proper error messages and input validation,
and accept standard columns, hyperedge_trim_n, num_workers parameters.

Replit-Task-Id: ceadb42f-60cc-403a-aaa8-2cc81ff94db6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants