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

Mapping in collections is depricated since 3.3 and removed in 3.10 #65

Open
TAlonglong opened this issue Dec 8, 2021 · 1 comment
Open

Comments

@TAlonglong
Copy link
Collaborator

Mappings in collections is depricated since 3.3 and removed in 3.10.

in 3.10 its failing like this:

Traceback (most recent call last):
  File "/software/miniconda/envs/pytroll/lib/python3.10/threading.py", line 1009, in _bootstrap_inner
    self.run()
  File "/software/miniconda/envs/pytroll/lib/python3.10/site-packages/pytroll_collectors/triggers/_posttroll.py", line 68, in run
    self.process(msg)
  File "/software/miniconda/envs/pytroll/lib/python3.10/site-packages/pytroll_collectors/triggers/_base.py", line 186, in add_file
    self._process_pathname(pathname)
  File "/software/miniconda/envs/pytroll/lib/python3.10/site-packages/pytroll_collectors/triggers/_base.py", line 182, in _process_pathname
    Trigger._process_metadata(self, mda)
  File "/software/miniconda/envs/pytroll/lib/python3.10/site-packages/pytroll_collectors/triggers/_base.py", line 85, in _process_metadata
    res = collector(metadata.copy())
  File "/software/miniconda/envs/pytroll/lib/python3.10/site-packages/pytroll_collectors/region_collector.py", line 69, in __call__
    return self.collect(granule_metadata)
  File "/software/miniconda/envs/pytroll/lib/python3.10/site-packages/pytroll_collectors/region_collector.py", line 105, in collect
    if _granule_covers_region(granule_metadata, self.region):
  File "/software/miniconda/envs/pytroll/lib/python3.10/site-packages/pytroll_collectors/region_collector.py", line 306, in _granule_covers_region
    granule_pass = Pass(_get_platform_name(granule_metadata),
  File "/software/miniconda/envs/pytroll/lib/python3.10/site-packages/trollsched/satpass.py", line 138, in __init__
    SimplePass.__init__(self, satellite, risetime, falltime)
  File "/software/miniconda/envs/pytroll/lib/python3.10/site-packages/trollsched/satpass.py", line 65, in __init__
    from trollsched.schedule import Satellite
  File "/software/miniconda/envs/pytroll/lib/python3.10/site-packages/trollsched/schedule.py", line 40, in <module>
    from trollsched import utils
  File "/software/miniconda/envs/pytroll/lib/python3.10/site-packages/trollsched/utils.py", line 28, in <module>
    from collections import Mapping
ImportError: cannot import name 'Mapping' from 'collections' (/software/miniconda/envs/pytroll/lib/python3.10/collections/__init__.py)

In 3.3 onwards Mapping is moved to
https://docs.python.org/3.9/library/collections.abc.html#module-collections.abc

This module needs to be updated accordingly

@pnuu
Copy link
Member

pnuu commented Dec 8, 2021

Hmm, this seems to be already fixed in the main branch: https://github.com/pytroll/pytroll-schedule/blob/main/trollsched/utils.py#L28

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

No branches or pull requests

2 participants