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

Pandas Import Typing Error #56

Closed
trhallam opened this issue Feb 8, 2022 · 2 comments
Closed

Pandas Import Typing Error #56

trhallam opened this issue Feb 8, 2022 · 2 comments

Comments

@trhallam
Copy link

trhallam commented Feb 8, 2022

I am getting an ImportError because I think the latest version of Pandas (v1.4) has changed some internal references to the Types used by Subsurface.

It looks like FilePathorBuffer has been split into two separate types. Perhaps it is not a great idea to import private Types from Pandas?

tests\test_accessor.py:29: in <module>
    from subsurface import StructuredData
C:\Users\trhal\miniconda3\envs\s38\lib\site-packages\subsurface\__init__.py:1: in <module>
    import subsurface.reader
C:\Users\trhal\miniconda3\envs\s38\lib\site-packages\subsurface\reader\__init__.py:5: in <module>
    from .topography.topo_core import read_structured_topography, read_unstructured_topography
C:\Users\trhal\miniconda3\envs\s38\lib\site-packages\subsurface\reader\topography\topo_core.py:3: in <module>
    from subsurface.reader.readers_data import ReaderFilesHelper, ReaderUnstructuredHelper
C:\Users\trhal\miniconda3\envs\s38\lib\site-packages\subsurface\reader\readers_data.py:9: in <module>
    from pandas._typing import FilePathOrBuffer
E   ImportError: cannot import name 'FilePathOrBuffer' from 'pandas._typing' (C:\Users\trhal\miniconda3\envs\s38\lib\site-packages\pandas\_typing.py)
trhallam added a commit to trhallam/segysak that referenced this issue Feb 8, 2022
-- zgy updated, removed corners empty bug
-- pytest-cases bug commented out - issues with new version
-- subsurface removed for now - typing issue with new pandas see softwareunderground/subsurface#56 (comment)
@Japhiolite
Copy link
Member

for the time being, I've added a check for which pandas version is loaded, and then using the respective types...not very elegant probably

trhallam added a commit to trhallam/segysak that referenced this issue Feb 17, 2023
-- zgy updated, removed corners empty bug
-- pytest-cases bug commented out - issues with new version
-- subsurface removed for now - typing issue with new pandas see softwareunderground/subsurface#56 (comment)
@Japhiolite
Copy link
Member

implemented in #61

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