CIL icon indicating copy to clipboard operation
CIL copied to clipboard

Readers import

Open paskino opened this issue 9 months ago • 1 comments

Description

Defer the import of dxchange and olefile to when the functionality is used. This will enable importing from the io package even if olefile and/or dxchange are not available.

I updated the unit test to test functionality.

Also, I set up a system to be able to pass to the test the location of the txrm test files, with 2 environment variables.:

  • CIL_TEST_TXRM_FILE
  • CIL_TEST_2D_RECON_FILE

Such files can be uploaded on our CI machine. Probably the environment variables can be saved to a script to be sourced here: https://github.com/TomographicImaging/CIL/blob/126efd3f6b7dc69f3c51b64661c9fade63ca0bbe/.github/workflows/build.yml#L55-L56

Testing you performed

Please add any demo scripts to https://github.com/TomographicImaging/CIL-Demos/tree/main/misc

  • updated unit tests which were very broken
  • added unit tests for new functionality
  • tested locally on environment with and without olefile and dxchange with appropriate txrm files available

[!IMPORTANT] The unit tests are not running on CI because they do not have the txrm files, nor miss dxchange and/or olefile.

  • #2103

Related issues/links

  • closes #2088
  • closes #2095

Checklist

  • [x] I have performed a self-review of my code
  • [ ] I have added docstrings in line with the guidance in the developer guide
  • [ ] I have updated the relevant documentation
  • [x] I have implemented unit tests that cover any new or modified functionality
  • [x] CHANGELOG.md has been updated with any functionality change
  • [x] Request review from all relevant developers
  • [x] Change pull request label to 'Waiting for review'

Contribution Notes

Please read and adhere to the developer guide and local patterns and conventions.

  • [x] The content of this Pull Request (the Contribution) is intentionally submitted for inclusion in CIL (the Work) under the terms and conditions of the Apache-2.0 License
  • [x] I confirm that the contribution does not violate any intellectual property rights of third parties

paskino avatar Mar 05 '25 09:03 paskino

I've made a simplified version of this with just the change to where dxchange and olefile are imported: https://github.com/TomographicImaging/CIL/pull/2149 We can look at updating the readers tests separately, possibly using a cached file and dataexample.WALNUT.download_data()

hrobarts avatar Apr 25 '25 10:04 hrobarts