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

Specific package versions for matplotlib and pandas? #192

Open
joshuak94 opened this issue Jun 15, 2024 · 1 comment
Open

Specific package versions for matplotlib and pandas? #192

joshuak94 opened this issue Jun 15, 2024 · 1 comment

Comments

@joshuak94
Copy link

Hi Kau,

I'm re-running some analysis with FAN-C and created a fresh virtual environment to install into. Using pip install fanc I installed the package and its dependencies. Automatically, matplotlib was installed to its latest version (3.9). However, the function register_cmap doesn't exist in matplotlib 3.9, so I had to manually downgrade to matplotlib 3.5.1.

Now I'm running into a problem with my pandas version (currently 2.2.2). Specifically:

Traceback (most recent call last):                                                                                                                                                                                                            
  File "/project/venv/bin/fanc", line 127, in <module>                                                                                                                                         
    Fanc()                                                                                                                                                                                                                                    
  File "/project/venv/bin/fanc", line 93, in __init__                                                                                                                                          
    command([sys.argv[0]] + sys.argv[option_ix:], log_level=log_level, verbosity=verbosity)                                                                                                                                                   
  File "/project/venv/lib/python3.11/site-packages/fanc/commands/fanc_commands.py", line 1134, in pairs                                                                                        
    restriction_site_distance_plot(pairs, ax=ax)                                                                                                                                                                                              
  File "/project/venv/lib/python3.11/site-packages/fanc/plotting/statistics.py", line 179, in restriction_site_distance_plot                                                                   
    sns.distplot(distances, ax=ax, color=color, **kwargs)                                                                                                                                                                                     
  File "/project/venv/lib/python3.11/site-packages/seaborn/distributions.py", line 2496, in distplot                                                                                           
    kdeplot(**{axis: a}, ax=ax, color=kde_color, **kde_kws)                                                                                                                                                                                   
  File "/project/venv/lib/python3.11/site-packages/seaborn/distributions.py", line 1701, in kdeplot                                                                                            
    p.plot_univariate_density(                                                                                                                                                                                                                
  File "/project/venv/lib/python3.11/site-packages/seaborn/distributions.py", line 991, in plot_univariate_density                                                                             
    artist, = ax.plot(support, density, **artist_kws)                                                                                                                                                                                         
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                                         
  File "/project/venv/lib/python3.11/site-packages/matplotlib/axes/_axes.py", line 1632, in plot                                                                                               
    lines = [*self._get_lines(*args, data=data, **kwargs)]                                                                                                                                                                                    
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                                    
  File "/project/venv/lib/python3.11/site-packages/matplotlib/axes/_base.py", line 312, in __call__                                                                                            
    yield from self._plot_args(this, kwargs)                                                                                                                                                                                                  
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                                                  
  File "/project/venv/lib/python3.11/site-packages/matplotlib/axes/_base.py", line 487, in _plot_args                                                                                          
    x = _check_1d(xy[0])                                                                                                                                                                                                                      
        ^^^^^^^^^^^^^^^^                                                                                                                                                                                                                      
  File "/project/venv/lib/python3.11/site-packages/matplotlib/cbook/__init__.py", line 1327, in _check_1d                                                                                      
    ndim = x[:, None].ndim                                                                                                                                                                                                                    
           ~^^^^^^^^^                                                                                                                                                                                                                         
  File "/project/venv/lib/python3.11/site-packages/pandas/core/indexes/base.py", line 5419, in __getitem__                                                                                     
    disallow_ndim_indexing(result)                                                                                                                                                                                                            
  File "/project/venv/lib/python3.11/site-packages/pandas/core/indexers/utils.py", line 341, in disallow_ndim_indexing
    raise ValueError(
ValueError: Multi-dimensional indexing (e.g. `obj[:, None]`) is no longer supported. Convert to a numpy array before indexing instead.
/project/venv/lib/python3.11/site-packages/tables/file.py:113: UnclosedFileWarning: Closing remaining open file: ../output/inv/wt/pairs/sample_inv_ref_wt.pairs
  warnings.warn(UnclosedFileWarning(msg))
Traceback (most recent call last):
  File "/project/venv/bin/fanc", line 127, in <module>
    Fanc()
  File "/project/venv/bin/fanc", line 93, in __init__
    command([sys.argv[0]] + sys.argv[option_ix:], log_level=log_level, verbosity=verbosity)
  File "/project/venv/lib/python3.11/site-packages/fanc/commands/fanc_commands.py", line 123, in auto
    return fanc.commands.auto.auto(argv, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/project/venv/lib/python3.11/site-packages/fanc/commands/auto.py", line 1311, in auto
    runner.run()
  File "/project/venv/lib/python3.11/site-packages/fanc/commands/auto.py", line 141, in run
    raise RuntimeError("Task {} had non-zero exit status. " 
RuntimeError: Task 8aa573b9-5320-4f1b-95fa-c6c93f4fb45e had non-zero exit status. Cancelling execution of all tasks.

Some googling tells me that it's likely an incompatibility with my matplotlib and pandas versions. Could you specify versions of dependencies which have been tested and are stable?

Thank you!

@joshuak94
Copy link
Author

Quick update, I seem to have got everything to be happy with the following:

pandas version 2.2.2, matplotlib version 3.6.0

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

1 participant