mapillary / mapillary/OpenSfM

opensfm/test/test_commands.py::test_run_all doesn't pass with matplotlib 3.8.0

Open
#1,029 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
3.8k
Forks
899
PR merge metrics
No merged PRs in 30d

Description

Hi! I presumed that this may an issue and that opensfm would be supposed to work across a range of matplotlib verisons, since matplotlib hasn't been pinned. Cf. the transcript

python3.11-OpenSfM-unstable> =================================== FAILURES ===================================         
python3.11-OpenSfM-unstable> _________________________________ test_run_all _________________________________                                                                                                                               
python3.11-OpenSfM-unstable> tmpdir = local('/build/pytest-of-nixbld/pytest-0/test_run_all0')        
python3.11-OpenSfM-unstable>     def test_run_all(tmpdir) -> None:                                                    
python3.11-OpenSfM-unstable>         data = data_generation.create_berlin_test_folder(tmpdir)
...
python3.11-OpenSfM-unstable>         for module in run_all_commands:                                       
python3.11-OpenSfM-unstable>             command = module.Command()                                                   
python3.11-OpenSfM-unstable>             options = command_options.get(module, [])                                                                                                                                                          
python3.11-OpenSfM-unstable> >           run_command(command, [data.data_path] + options)                             
python3.11-OpenSfM-unstable> opensfm/test/test_commands.py:51:                                                                                                                                                                              python3.11-OpenSfM-unstable> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
python3.11-OpenSfM-unstable> opensfm/test/test_commands.py:12: in run_command                                                                                                                                                               
python3.11-OpenSfM-unstable>     command.run(dataset.DataSet(parsed_args.dataset), parsed_args)                                                                                                                                             
python3.11-OpenSfM-unstable> opensfm/commands/command.py:13: in run                                                                                                                                                                         
python3.11-OpenSfM-unstable>     self.run_impl(data, args)                                                                                                                                                                                  
python3.11-OpenSfM-unstable> opensfm/commands/compute_statistics.py:12: in run_impl                                   
python3.11-OpenSfM-unstable>     compute_statistics.run_dataset(dataset, args.diagram_max_points)                                                                                                                                           
python3.11-OpenSfM-unstable> opensfm/actions/compute_statistics.py:26: in run_dataset                                                                                                                                                       
python3.11-OpenSfM-unstable>     stats.save_residual_grids(                                                           
python3.11-OpenSfM-unstable> opensfm/stats.py:961: in save_residual_grids                                                                                                                                                                   
python3.11-OpenSfM-unstable>     plt.colorbar(                                                                        
python3.11-OpenSfM-unstable> /nix/store/mi8bsmpp11k96g7d1ds7591gmdzx88i7-python3.11-matplotlib-3.8.0/lib/python3.11/site-packages/matplotlib/pyplot.py:2326: in colorbar                                                                    
python3.11-OpenSfM-unstable>     ret = gcf().colorbar(mappable, cax=cax, ax=ax, **kwargs)                             
python3.11-OpenSfM-unstable> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _                                                                                                                                
python3.11-OpenSfM-unstable> self = <Figure size 1200x1000 with 1 Axes>                              
python3.11-OpenSfM-unstable> mappable = <matplotlib.cm.ScalarMappable object at 0x7ffed1173c10>, cax = None 
...
python3.11-OpenSfM-unstable>         if cax is None:                                                                                                                                                                                        python3.11-OpenSfM-unstable>             if ax is None:                                                               
python3.11-OpenSfM-unstable> >               raise ValueError(           
python3.11-OpenSfM-unstable>                     'Unable to determine Axes to steal space for Colorbar. '
python3.11-OpenSfM-unstable>                     'Either provide the *cax* argument to use as the Axes for '                                                                                                                                python3.11-OpenSfM-unstable>                     'the Colorbar, provide the *ax* argument to steal space '
python3.11-OpenSfM-unstable>                     'from it, or add *mappable* to an Axes.') 
python3.11-OpenSfM-unstable> E               ValueError: Unable to determine Axes to steal space for Colorbar. Either provide the *cax* argument to use as the Axes for the Colorbar, provide the *ax* argument to steal space from it, or a
dd *mappable* to an Axes.                                                                                             
python3.11-OpenSfM-unstable> /nix/store/mi8bsmpp11k96g7d1ds7591gmdzx88i7-python3.11-matplotlib-3.8.0/lib/python3.11/site-packages/matplotlib/figure.py:1285: ValueError

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with opensfm/test/test_commands.py::test_run_all and reproduce the failure using matplotlib 3.8.0. Trace the call through opensfm/actions/compute_statistics.py to opensfm/stats.py::save_residual_grids, where plt.colorbar raises the error. Done means the command test passes with the supported matplotlib range, including version 3.8.0.

Written by the indexing model from the issue text.

Assessment

Tech stack
matplotlib, python
Domain
data-visualization, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.