summaryrefslogtreecommitdiff
path: root/pint/facets/measurement/objects.py
diff options
context:
space:
mode:
authorHernan Grecco <hgrecco@gmail.com>2023-04-29 19:44:20 -0300
committerHernan Grecco <hgrecco@gmail.com>2023-04-29 19:44:20 -0300
commitb63697287ba1e5de7300890ea4c03b8781b04863 (patch)
tree0eb5db03beef71ddfb5a094521034b9f0b212b5b /pint/facets/measurement/objects.py
parent10f69c4870ef9acda1b5dd21f2bf87f15855d3ea (diff)
downloadpint-b63697287ba1e5de7300890ea4c03b8781b04863.tar.gz
Run pyupgrade --py39-plus in all files except _vendor
Diffstat (limited to 'pint/facets/measurement/objects.py')
-rw-r--r--pint/facets/measurement/objects.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/pint/facets/measurement/objects.py b/pint/facets/measurement/objects.py
index 0fed93f..6fa860c 100644
--- a/pint/facets/measurement/objects.py
+++ b/pint/facets/measurement/objects.py
@@ -23,7 +23,7 @@ class MeasurementQuantity:
def plus_minus(self, error, relative=False):
if isinstance(error, self.__class__):
if relative:
- raise ValueError("{} is not a valid relative error.".format(error))
+ raise ValueError(f"{error} is not a valid relative error.")
error = error.to(self._units).magnitude
else:
if relative:
@@ -98,7 +98,7 @@ class Measurement(PlainQuantity):
)
def __str__(self):
- return "{}".format(self)
+ return f"{self}"
def __format__(self, spec):
spec = spec or self.default_format
@@ -133,7 +133,7 @@ class Measurement(PlainQuantity):
# scientific notation ('e' or 'E' and sometimes 'g' or 'G').
mstr = mstr.replace("(", "").replace(")", " ")
ustr = siunitx_format_unit(self.units._units, self._REGISTRY)
- return r"\SI%s{%s}{%s}" % (opts, mstr, ustr)
+ return r"\SI{}{{{}}}{{{}}}".format(opts, mstr, ustr)
# standard cases
if "L" in spec: