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

`gclose` shows no view when `gopen` is called with `file` set

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

@sadielbartholomew ci sta già lavorando.

Dal 14/5/2024.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

bug

The gclose parameter view fails to behave correctly, notably to produce a graphical display window showing the relevant plot when defaulting or set to True or equivalent, only in the case that a gopen call with a set file file name has been provided (a parameter-free gopen() exhibits correct view behaviour). As the below example shows, this affects future calls to gclose, even when another gopen is called between.

Minimal reproducer

Running the below short script shows no graphical window display with the plots, when it should produce two separately from both calls to gopen because the default is view=True and (to double check) when setting that manually nothing changes. Note though that when we remove the file="delme.png" specification to the first gopen call, both plots then are displayed. (Either way, the plots are still saved correctly, just not displayed to the user, as requested from the view parameter.)

PATH_TO_DATASETS = "~/git-repos/cf-plot/cfplot_data"

# Use this import order to avoid seg fault RE ESMF/matplotlib interfacing
import cfplot as cfp
import cf

# Using docs 'Example 1 - basic cylindrical projection' to illustrate issue
cfp.gopen(file="delme.png")  # without file=<name> set, viewing works
f=cf.read(f"{PATH_TO_DATASETS}/tas_A1.nc")[0]
cfp.con(f.subspace(time=15))
cfp.gclose()

cfp.gopen()  # even if file=<name> set is not set here, view fails still
f=cf.read(f"{PATH_TO_DATASETS}/tas_A1.nc")[0]
cfp.con(f.subspace(time=15))
cfp.gclose(view=True)  # try re-stating the default, still viewing won't work

Lingua principale
Python
Stelle
21
Fork
11
Merge medio
7h 11m
PR unite (30g)
1

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.