Skip to content

Test: Create test for get_instance for White Whole#49

Merged
2 commits merged intoopenworm:mainfrom
nanoman657:test/white-data-reader
Oct 14, 2025
Merged

Test: Create test for get_instance for White Whole#49
2 commits merged intoopenworm:mainfrom
nanoman657:test/white-data-reader

Conversation

@nanoman657
Copy link
Contributor

@nanoman657 nanoman657 commented Sep 15, 2025

Test the get_instance function for the White_whole dataset.

White_whole has a get_instance function like other complete connectome datasets. However, it has been untested, which creates risk for further development of the Connectome Toolbox. This PR tests the function, while also including abstracted caching logic which could also be extended to other data readers.

Notes:

  • This functionality was tested using unittest, and should be pytest compatible. I can convert to pytest if needed.
  • The imports have been rearranged to conform with PEP 8 import guidelines

@nanoman657
Copy link
Contributor Author

Hi @pgleeson , at your earliest convenience, would you let me know if I'm on the right track with this PR? If I am, I'll clean it up and make additional tests.

@pgleeson
Copy link
Member

Will look it over tomorrow @nanoman657, thanks.

@pgleeson
Copy link
Member

Thanks again for this. The reason that the WhiteDataReader didn't have a get_instnce method was because it was really a helperclass for White_whole, White_A etc. which do use specific spreadsheets and so are full connectome dataset. Test classes can maybe be added for these "real" connectome datasets

@pgleeson
Copy link
Member

By the way, do base your PRs on the latets main in the https://github.com/openworm/ConnectomeToolbox/ repo.

@nanoman657 nanoman657 force-pushed the test/white-data-reader branch from 25baf82 to 74ea77d Compare September 26, 2025 03:49
@nanoman657 nanoman657 force-pushed the test/white-data-reader branch from 74ea77d to 9f7dfcc Compare September 26, 2025 03:57
@nanoman657 nanoman657 changed the title Feature: Create get_instance for White Data Reader Test: Create test for get_instance for White Whole Sep 26, 2025
@nanoman657
Copy link
Contributor Author

Thanks @pgleeson for your feedback. To address your comment, I have adjusted the commits to address the White_whole.py file instead. I have also rebased on the latest Connectome Toolbox repository. Please let me know if the edits made are satisfactory.

@pgleeson
Copy link
Member

pgleeson commented Oct 9, 2025

Thanks, testing this out, unfortunately the GHA tests take an hour to run, so difficult not to get distracted by other things...

@nanoman657
Copy link
Contributor Author

@pgleeson No worries! I see that some of the builds have failed, so I'll work to correct those.

@pgleeson pgleeson closed this pull request by merging all changes into openworm:main in 8e3875b Oct 14, 2025
@pgleeson
Copy link
Member

Thanks @nanoman657, have tested this and merged it in. Note this change I made:

if not Path(white_cache).is_file():
self.cache_files_to_cleanup.append(white_cache)
else:
print(f"Cache file {white_cache} already exists - not cleaning it up")

i.e. if the test is run, and the cache file to generate already exists, don't delete it. In this case the cache file has been added to the repo.

@pgleeson
Copy link
Member

Also, this (0967715) puts a limit on the version of hiveplotlib to use, which prevents the test from failing.

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