Summary
Update the pseudonym creation logic to include a more robust approach for handling and cleaning entity_ids, improving pseudonym consistency and readability.
Problem Statement
Currently, the pseudonym creation method (create_pseudonym) directly converts entity_ids into pseudonyms without a comprehensive cleanup process. Some IDs may include characters or formats that lead to unreadable or inconsistent pseudonyms, especially if IDs contain slashes (/), whitespace, or other special characters. Improving this will make pseudonyms more user-friendly (for the future) and reduce potential conflicts or errors in file handling. This logic exists in the create_pseudonym function, located in artifact_manager.py.
Proposed Solution
- Implement a cleaning function for
entity_id that:
- Replaces or removes special characters (e.g.,
/, whitespace) with safe alternatives (e.g., underscores _).
- Limits the length if necessary to improve readability.
- Use this function within
create_pseudonym to ensure consistent pseudonyms.
- Document the cleaning process in code comments for future reference.
- Write and refactor tests to verify this change works as intended.
Acceptance Criteria
Note: This change affects the create_pseudonym function within the Artifact class and will impact how pseudonyms are generated across different artifact types.
Summary
Update the pseudonym creation logic to include a more robust approach for handling and cleaning
entity_ids, improving pseudonym consistency and readability.Problem Statement
Currently, the pseudonym creation method (
create_pseudonym) directly convertsentity_ids into pseudonyms without a comprehensive cleanup process. Some IDs may include characters or formats that lead to unreadable or inconsistent pseudonyms, especially if IDs contain slashes (/), whitespace, or other special characters. Improving this will make pseudonyms more user-friendly (for the future) and reduce potential conflicts or errors in file handling. This logic exists in thecreate_pseudonymfunction, located inartifact_manager.py.Proposed Solution
entity_idthat:/, whitespace) with safe alternatives (e.g., underscores_).create_pseudonymto ensure consistent pseudonyms.Acceptance Criteria
entity_idinputs.Note: This change affects the
create_pseudonymfunction within theArtifactclass and will impact how pseudonyms are generated across different artifact types.