Skip to content

Commit 949aedc

Browse files
committed
Make OGIP formatter convert ohm to correct string
1 parent 9f655e2 commit 949aedc

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

astropy/units/si.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@
372372
namespace=_ns,
373373
prefixes=True,
374374
doc="Ohm: electrical resistance",
375-
format={"latex": r"\Omega", "unicode": "Ω"},
375+
format={"latex": r"\Omega", "ogip": "ohm", "unicode": "Ω"},
376376
)
377377
def_unit(
378378
["S", "Siemens", "siemens"],
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Converting the ohm to a string with the OGIP unit formatter (e.g.
2+
``f"{u.ohm:ogip}"``) previously produced the string ``'V / A'``, but now
3+
produces ``'ohm'`` as expected.

0 commit comments

Comments
 (0)