Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#53 コメント 0 件 リアクション 0 件 担当者 1 名 GitHub で見る

@sadielbartholomew がすでに取り組んでいます。

2024年5月14日 から。

評価

この issue はまだ評価されていません。

説明

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

主要言語
Python
スター
21
フォーク
11
平均マージ
7時間 11分
マージ済み PR(30日)
1

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

NCAS-CMS/cf-plot のほかの issue

NCAS-CMS/cf-plot の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。