Skip to content

Conversation

@leskovecg
Copy link
Collaborator

Issue

Fixes #534 – Corpus widget now supports saving and loading relative file paths.

Description of changes

This PR adds support for saving relative paths when a workflow is saved, and resolving them properly when the workflow is reloaded in a different directory.

  • Added fix_relative_path and fix_absolute_path utility functions.
  • Modified OWCorpus to save/load relative file paths using the current workflow location.
  • Adjusted test test_relative_corpus_path_serialization to verify correct path resolution.

Includes

  • Code changes
  • Test
  • Documentation (not required)

@leskovecg leskovecg force-pushed the fix-relative-corpus-path branch from e2547d9 to c4552bd Compare July 14, 2025 08:02
out_corpus = self.get_output(self.widget.Outputs.matching_docs)
self.assertEqual(len(out_corpus), 1)
self.assertEqual(self.widget.n_matches, 7)
self.assertEqual(int(self.widget.n_matches), 7)
Copy link
Collaborator

Choose a reason for hiding this comment

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

The PR should be rebased and then this test is no longer necessary.

@leskovecg leskovecg force-pushed the fix-relative-corpus-path branch from c4552bd to a689b71 Compare September 30, 2025 11:34
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.

Corpus: save data set as relative, check if in same folder

2 participants