matplotlib / matplotlib/basemap

Regression in addcyclic behaviour

Open
#139 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
817
Forks
395
PR merge metrics
No merged PRs in 30d

Description

Pull request #138 changed the behaviour of basemap.addcyclic. The data and longitude arrays are now being treated the same, i.e. the first point being appended to the end, but previously the longitude array was handled by adding the difference between longitudes to the last longitude, which is in my mind the correct behaviour.

An example:

import numpy as np
from mpl_toolkits.basemap import addcyclic

lons = np.arange(0, 360, 60)
data = np.ones([5, len(lons)]) * np.arange(len(lons))
new_data, new_lons = addcyclic(data, lons)
print new_lons

Prior to #138 being merged this would result in [0, 60, 120, 180, 240, 300, 360] but after it results in [0, 60, 120, 180, 240, 300, 0].

Contributor guide

No contributing guide indexed for this repository

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 by reading the implementation of basemap.addcyclic and the change introduced by pull request #138. Reproduce the issue with the NumPy example in the report, then verify that data receives the cyclic point while the longitude array ends at 360 rather than repeating 0.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, python
Domain
data-visualization
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.