Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Use of lambert conformal projection leads to axes limit error

Aperta
#75 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@sadielbartholomew ci sta già lavorando.

Dal 2/10/2024.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

bug plotting

Recently when attempting a contour plot using the lambert conformal 'lcc' map projection, I see a ValueError: Axis limits cannot be NaN or Inf error, though previously we have not seen this sort of issue. I've tried upgrading cartopy and matplotlib but the error still emerges, so needs investigating in case it is a cf-plot issue.

MRE with environment
>>> import cfplot as cfp
>>> import cf
>>> 
>> cf.environment(paths=False)
Platform: Linux-6.5.13-7-MANJARO-x86_64-with-glibc2.40
HDF5 library: 1.14.2
netcdf library: 4.9.2
udunits2 library: /home/slb93/miniconda3/envs/cf-env-312/lib/libudunits2.so.0
esmpy/ESMF: 8.4.2
Python: 3.12.0
dask: 2024.7.1
netCDF4: 1.6.5
psutil: 5.9.5
packaging: 23.2
numpy: 1.26.4
scipy: 1.14.0
matplotlib: 3.9.2
cftime: 1.6.2
cfunits: 3.3.7
cfplot: 3.3.0
cfdm: 1.11.1.0
cf: 3.16.2
>>>
>>> PATH = "~/git-repos/cf-plot/cfplot/test/cfplot_data"
>>> f = cf.read(f"{PATH}/ggap.nc")[0]
>>> cfp.mapset(proj="lcc")
>>> cfp.con(f.subspace(pressure=850))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/slb93/git-repos/cf-plot/cfplot/cfplot.py", line 3665, in con
    _set_map()
  File "/home/slb93/git-repos/cf-plot/cfplot/cfplot.py", line 2377, in _set_map
    mymap.set_extent(
  File "/home/slb93/miniconda3/envs/cf-env-312/lib/python3.12/site-packages/cartopy/mpl/geoaxes.py", line 862, in set_extent
    self.set_xlim([x1, x2])
  File "/home/slb93/miniconda3/envs/cf-env-312/lib/python3.12/site-packages/matplotlib/axes/_base.py", line 3739, in set_xlim
    return self.xaxis._set_lim(left, right, emit=emit, auto=auto)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/slb93/miniconda3/envs/cf-env-312/lib/python3.12/site-packages/matplotlib/axis.py", line 1236, in _set_lim
    v0 = self.axes._validate_converted_limits(v0, self.convert_units)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/slb93/miniconda3/envs/cf-env-312/lib/python3.12/site-packages/matplotlib/axes/_base.py", line 3660, in _validate_converted_limits
    raise ValueError("Axis limits cannot be NaN or Inf")
ValueError: Axis limits cannot be NaN or Inf
Lingua principale
Python
Stelle
21
Fork
11
Merge medio
3h 36m
PR unite (30g)
2

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di NCAS-CMS/cf-plot

Tutte le issue di NCAS-CMS/cf-plot

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.