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

add pretty formatting for units

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

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
python
領域
data

調査の方向性

Start with the Pint Unit formatting examples in the issue, including the ~P format and the proposed Pcf formatter. Determine the desired pretty-string behavior for units such as degrees_east and degrees, then document what output would count as done.

索引モデルが issue の本文から書いたものです。

説明

Continuing from https://github.com/xarray-contrib/cf-xarray/pull/284#issuecomment-1018130308 (cc @keewis)

I see pint has a "pretty" formatting mode. Is there a way we can define the "pretty" string?

u = units.Unit("degrees_east")
f"{u:~P}"
degrees_east

EDIT: I see even pint doesn't do the pretty ° for "degrees"

u = units.Unit("degrees")
f"{u:P}"
degree

EDIT2: Should we define a Pcf formatter for our own pretty strings?

主要言語
Python
スター
181
フォーク
51
平均マージ
6時間 39分
マージ済み PR(30日)
1

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

xarray-contrib/cf-xarray のほかの issue

xarray-contrib/cf-xarray の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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