Skip to content

Commit

Permalink
appease new ruff formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
pressler-vsc committed Jan 9, 2025
1 parent 151e165 commit 6716d72
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
3 changes: 1 addition & 2 deletions sarkit/standards/general/nitf_elements/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ class ImageBand(NITFElement):
True,
3,
default_value="",
docstring="Standard Image Filter Code. This field is reserved "
"for future use.",
docstring="Standard Image Filter Code. This field is reserved for future use.",
) # type: str

def __init__(self, **kwargs):
Expand Down
8 changes: 4 additions & 4 deletions sarkit/standards/sidd/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ def segmentation_algorithm(
idlvl=z,
ialvl=0,
iloc="0000000000",
iid1=f"SIDD{k+1:03d}001", # Document says 'm', but there is no m variable
iid1=f"SIDD{k + 1:03d}001", # Document says 'm', but there is no m variable
nrows=num_rows_k,
ncols=num_cols_k,
)
Expand All @@ -939,7 +939,7 @@ def segmentation_algorithm(
idlvl=z,
ialvl=0,
iloc="0000000000",
iid1=f"SIDD{k+1:03d}001", # Document says 'm', but there is no m variable
iid1=f"SIDD{k + 1:03d}001", # Document says 'm', but there is no m variable
nrows=num_rows_limit_k,
ncols=num_cols_k,
)
Expand All @@ -952,7 +952,7 @@ def segmentation_algorithm(
idlvl=z,
ialvl=z - 1,
iloc=f"{num_rows_limit_k:05d}00000",
iid1=f"SIDD{k+1:03d}{n+1:03d}",
iid1=f"SIDD{k + 1:03d}{n + 1:03d}",
nrows=num_rows_limit_k,
ncols=num_cols_k,
)
Expand All @@ -965,7 +965,7 @@ def segmentation_algorithm(
idlvl=z,
ialvl=z - 1,
iloc=f"{num_rows_limit_k:05d}00000", # Document says "lastSegRows", but we need the number of rows in the previous IS
iid1=f"SIDD{k+1:03d}{num_seg_per_image_k:03d}",
iid1=f"SIDD{k + 1:03d}{num_seg_per_image_k:03d}",
nrows=last_seg_rows,
ncols=num_cols_k,
)
Expand Down
2 changes: 1 addition & 1 deletion sarkit/standards/xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def set_elem(self, elem: lxml.etree.Element, val: npt.ArrayLike) -> None:
elem_ns = self.child_ns if self.child_ns else lxml.etree.QName(elem).namespace
ns = f"{{{elem_ns}}}" if elem_ns else ""
for dim, ncoef in enumerate(coefs.shape):
elem.set(f"order{dim+1}", str(ncoef - 1))
elem.set(f"order{dim + 1}", str(ncoef - 1))
for coord, coef in np.ndenumerate(coefs):
attribs = {f"exponent{d + 1}": str(c) for d, c in enumerate(coord)}
lxml.etree.SubElement(elem, ns + "Coef", attrib=attribs).text = str(coef)
Expand Down
2 changes: 1 addition & 1 deletion sarkit/verification/cphd_consistency.py
Original file line number Diff line number Diff line change
Expand Up @@ -1317,7 +1317,7 @@ def check_pad_after_xml(self):
bytes_after_xml = fp.read(num_bytes_after_xml)
terminator = bytes_after_xml[:2]
pad = np.array(
struct.unpack(f"{num_bytes_after_xml-2}B", bytes_after_xml[2:])
struct.unpack(f"{num_bytes_after_xml - 2}B", bytes_after_xml[2:])
)

with self.need("Section terminator exists"):
Expand Down
2 changes: 1 addition & 1 deletion sarkit/verification/sicd_consistency.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def check_nitf_imseg(self) -> None:
assert imsegs[0].IID1.rstrip() == "SICD000"
else:
expected_iid1s = [
f"SICD{idx+1:03d} " for idx in range(len(imsegs))
f"SICD{idx + 1:03d} " for idx in range(len(imsegs))
]
actual_iid1s = [imseg.IID1 for imseg in imsegs]
assert actual_iid1s == expected_iid1s
Expand Down

0 comments on commit 6716d72

Please sign in to comment.