Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download test including run-time rename fails #707

Open
Tracked by #710
hakonanes opened this issue Dec 8, 2024 · 0 comments
Open
Tracked by #710

Download test including run-time rename fails #707

hakonanes opened this issue Dec 8, 2024 · 0 comments
Labels
bug Something isn't working maintenance This relates to package maintenance

Comments

@hakonanes
Copy link
Member

A download test which renames a file at run-time, test_data.py::TestData::test_not_allow_download_raises, fails in the hyperspy-extension-list CI. Discovered in hyperspy/hyperspy-extensions-list#65, with this log.

Relevant part of log.
__________ ERROR at setup of TestData.test_not_allow_download_raises ___________

    @pytest.fixture
    def nickel_ebsd_large_h5ebsd_renamed() -> Generator[Path, None, None]:
        f1 = Path(marshall.path) / "data/nickel_ebsd_large/patterns.h5"
>       f2 = f1.rename(f1.with_suffix(".bak"))

/home/runner/miniconda3/envs/test/lib/python3.11/site-packages/kikuchipy/conftest.py:367: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/home/runner/.cache/kikuchipy/develop/data/nickel_ebsd_large/patterns.h5')
target = PosixPath('/home/runner/.cache/kikuchipy/develop/data/nickel_ebsd_large/patterns.bak')

    def rename(self, target):
        """
        Rename this path to the target path.
    
        The target path may be absolute or relative. Relative paths are
        interpreted relative to the current working directory, *not* the
        directory of the Path object.
    
        Returns the new Path instance pointing to the target path.
        """
>       os.rename(self, target)
E       FileNotFoundError: [Errno 2] No such file or directory: '/home/runner/.cache/kikuchipy/develop/data/nickel_ebsd_large/patterns.h5' -> '/home/runner/.cache/kikuchipy/develop/data/nickel_ebsd_large/patterns.bak'

/home/runner/miniconda3/envs/test/lib/python3.11/pathlib.py:1175: FileNotFoundError
=============================== warnings summary ===============================
../../../miniconda3/envs/test/lib/python3.11/site-packages/traits/observation/_generated_parser.py:258
  /home/runner/miniconda3/envs/test/lib/python3.11/site-packages/traits/observation/_generated_parser.py:258: DeprecationWarning: module 'sre_parse' is deprecated
    import sre_parse

../../../miniconda3/envs/test/lib/python3.11/site-packages/traits/observation/_generated_parser.py:259
  /home/runner/miniconda3/envs/test/lib/python3.11/site-packages/traits/observation/_generated_parser.py:259: DeprecationWarning: module 'sre_constants' is deprecated
    import sre_constants

tests/test_indexing/test_merge_crystal_maps.py::TestMergeCrystalMaps::test_merge_crystal_maps_1d[map_shape1-1-phase_names1]
tests/test_indexing/test_merge_crystal_maps.py::TestMergeCrystalMaps::test_merge_crystal_maps_1d[map_shape1-1-phase_names1]
tests/test_indexing/test_merge_crystal_maps.py::TestMergeCrystalMaps::test_merge_crystal_maps_1d[map_shape1-1-phase_names1]
tests/test_indexing/test_merge_crystal_maps.py::TestMergeCrystalMaps::test_merge_crystal_maps_1d[map_shape3-1-phase_names3]
tests/test_indexing/test_merge_crystal_maps.py::TestMergeCrystalMaps::test_merge_crystal_maps_1d[map_shape3-1-phase_names3]
tests/test_indexing/test_merge_crystal_maps.py::TestMergeCrystalMaps::test_merge_crystal_maps_1d[map_shape3-1-phase_names3]
  /home/runner/miniconda3/envs/test/lib/python3.11/site-packages/kikuchipy/tests/test_indexing/test_merge_crystal_maps.py:71: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
    desired_scores[i] = xmap[i].prop[scores_prop]

tests/test_indexing/test_merge_crystal_maps.py::TestMergeCrystalMaps::test_merge_crystal_maps_1d[map_shape1-1-phase_names1]
tests/test_indexing/test_merge_crystal_maps.py::TestMergeCrystalMaps::test_merge_crystal_maps_1d[map_shape1-1-phase_names1]
tests/test_indexing/test_merge_crystal_maps.py::TestMergeCrystalMaps::test_merge_crystal_maps_1d[map_shape1-1-phase_names1]
tests/test_indexing/test_merge_crystal_maps.py::TestMergeCrystalMaps::test_merge_crystal_maps_1d[map_shape3-1-phase_names3]
tests/test_indexing/test_merge_crystal_maps.py::TestMergeCrystalMaps::test_merge_crystal_maps_1d[map_shape3-1-phase_names3]
tests/test_indexing/test_merge_crystal_maps.py::TestMergeCrystalMaps::test_merge_crystal_maps_1d[map_shape3-1-phase_names3]
  /home/runner/miniconda3/envs/test/lib/python3.11/site-packages/kikuchipy/tests/test_indexing/test_merge_crystal_maps.py:72: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
    desired_idx[i] = xmap[i].prop[sim_idx_prop]

tests/test_indexing/test_merge_crystal_maps.py::TestMergeCrystalMaps::test_merge_crystal_maps_2d[map_shape1-1-phase_names1-1]
tests/test_indexing/test_merge_crystal_maps.py::TestMergeCrystalMaps::test_merge_crystal_maps_2d[map_shape1-1-phase_names1-1]
tests/test_indexing/test_merge_crystal_maps.py::TestMergeCrystalMaps::test_merge_crystal_maps_2d[map_shape1-1-phase_names1-1]
tests/test_indexing/test_merge_crystal_maps.py::TestMergeCrystalMaps::test_merge_crystal_maps_2d[map_shape3-1-phase_names3-1]
tests/test_indexing/test_merge_crystal_maps.py::TestMergeCrystalMaps::test_merge_crystal_maps_2d[map_shape3-1-phase_names3-1]
tests/test_indexing/test_merge_crystal_maps.py::TestMergeCrystalMaps::test_merge_crystal_maps_2d[map_shape3-1-phase_names3-1]
  /home/runner/miniconda3/envs/test/lib/python3.11/site-packages/kikuchipy/tests/test_indexing/test_merge_crystal_maps.py:156: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
    desired_scores[j] = xmap[idx].prop[scores_prop]

tests/test_indexing/test_merge_crystal_maps.py::TestMergeCrystalMaps::test_merge_crystal_maps_2d[map_shape1-1-phase_names1-1]
tests/test_indexing/test_merge_crystal_maps.py::TestMergeCrystalMaps::test_merge_crystal_maps_2d[map_shape1-1-phase_names1-1]
tests/test_indexing/test_merge_crystal_maps.py::TestMergeCrystalMaps::test_merge_crystal_maps_2d[map_shape1-1-phase_names1-1]
tests/test_indexing/test_merge_crystal_maps.py::TestMergeCrystalMaps::test_merge_crystal_maps_2d[map_shape3-1-phase_names3-1]
tests/test_indexing/test_merge_crystal_maps.py::TestMergeCrystalMaps::test_merge_crystal_maps_2d[map_shape3-1-phase_names3-1]
tests/test_indexing/test_merge_crystal_maps.py::TestMergeCrystalMaps::test_merge_crystal_maps_2d[map_shape3-1-phase_names3-1]
  /home/runner/miniconda3/envs/test/lib/python3.11/site-packages/kikuchipy/tests/test_indexing/test_merge_crystal_maps.py:157: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
    desired_idx[j] = xmap[idx].prop[sim_idx_prop]

tests/test_io/test_kikuchipy_h5ebsd.py::TestKikuchipyH5EBSD::test_save_load_0d_nav[h5]
  /home/runner/miniconda3/envs/test/lib/python3.11/site-packages/orix/crystal_map/crystal_map.py:288: DeprecationWarning: Calling nonzero on 0d arrays is deprecated, as it behaves surprisingly. Use `atleast_1d(cond).nonzero()` if the old behavior was intended. If the context of this warning is of the form `arr[nonzero(cond)]`, just use `arr[cond]`.

The test will be skipped there until it is fixed in a release here.

@hakonanes hakonanes added bug Something isn't working maintenance This relates to package maintenance labels Dec 8, 2024
@hakonanes hakonanes mentioned this issue Dec 30, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working maintenance This relates to package maintenance
Projects
None yet
Development

No branches or pull requests

1 participant